On Mon, Feb 22, 2010 at 6:16 PM, Jim Idle <[email protected]> wrote:
> You might deal with this the way I do for the JavaFX parser: > > Thanks for the example. I cannot understand how you check whether semicolon is required or not? > Then do not put your ';' in a different channel. The checkForSemi() method > encapsulates the code for deciding if the semi colon is allowed to be > missing or not - languages really should not make such things optional, it > makes it very difficult to generate decent error messages - and issues an > error message if it is required, otherwise just returns silently. > Unfortunately it is optional, standard says so: "In writing specimens of any construct defined by a Repetition production specifying the semicolon ";" as separator, it is permitted, without any effect on the syntax structure, validity and semantics of the software, to omit any of the semicolons, or to add a semicolon after the last element.". > > You can get the JavaFX compiler source code from Kenai: > http://kenai.com/projects/openjfx-compiler > > Actions that are specified as: > > {{ }} > > Will be executed within predicate lookahead as well as normal mode and you > can then check the backtracking flag to see if you are in predicate mode. > However, I suggest that you will find that difficult to maintain. > Great, thanks, didn't know about this syntax. -- Greetings Marcin Rzeźnicki List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/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.
