At 13:06 8/01/2011, Geoffrey Romer wrote: >But that seems like it's not always possible. So far as I can tell, >there's no way to keep syntactic or semantic predicates outside the >grammar (now would it be very desirable if you could). Keeping rule >arguments and return values outside the grammar is a contradiction >in terms. I can't even find a way to skip whitespace without >writing code in the target language. Am I missing something?
One way to do it depends on how compatible the two languages are, particularly with method call syntax (for example, C++ and Java have compatible method call syntax). If this is the case then you can just write every predicate as a call to a method (left undefined in the grammar), and then either subclass or superclass the resulting parser class to provide the actual implementation. (You can do something similar with C, but you'd have to call global functions, and possibly alter the parameters a little.) 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.
