On Saturday 20 September 2008 22:00, Yet ANOTHER Test Runner wrote:
> Sorry for my poor English :(
>
> Many computer languages like TTCN3, allows near '}' token or at the
> last statement inside block statement omit ';' token correctly, like
> this:
>
> if(xx){
>
> const integer i:=1; //error if missing ';'
>
> const integer i2:=2 //ok! even though missing ';'
>
> }
>
> How can I insert a token ';' in the TokenStream if it is omitted.
Why conceptualize it as inserting a semicolon? Why not conceptualize it
as the semicolon being a _separator_, not a _terminator_ and write the
syntax rules accordingly?
E.g., compare these:
/* All statements are terminated by a semicolon */
BlockBody: ( Statement ';' ) *
vs.:
/* Statements are separated by a semicolon */
BlockBody: ( Statement ( ';' Statement ) * ) ?
> ...
Randall Schulz
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---