On Sunday 21 September 2008 14:44, Randall R Schulz wrote: > On Saturday 20 September 2008 22:00, Yet ANOTHER Test Runner wrote: > > ... > > > > 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 ) * ) ?
NOTE: I should not have used upper-case letters for these rules, since that's for lexer rules. I should be: /* 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 -~----------~----~----~----~------~----~------~--~---
