Hello! I am trying to implement the ETSI TTCN-3 BNF into Antlr. The major part is done and working as it should but there are some quirks which i don't know how to solve.
I have rules like this: stm : stmGroup1 | stmGroup2 ... | stmGroupX; And all/some of these stmGroup's can start with the same type of token, but they are distinguishable by some token along the line further down the parse tree. I have tried to solve this by using backtrack=true which didn't work. My current solution is a specific order of the stmGroup's and a few syntactic predicates. But i don't like this solution since i don't know if it will work for all possible input (the grammar is really complex). Basically what i want to accomplish is make Antlr try all of the rules in "stm" and only report error if none of them matches. Currently it reports errors even though a rule later in the list will match the input completely, just because the rule reporting the error matches it partly. The only solution other then syntactic predicates and backtrack i can think of is to combine the stmGroup's into a rule which has truly distinctive paths depending on the next token. Is this the way to do it? It will require a huge amount of work since all the stmGroup's are quite large and complex themselves. Also it will make the grammar almost unreadable. An example of a problematic rule is: http://www.trex.informatik.uni-goettingen.de/trac/wiki/ttcn-3_4.0.4#FunctionStatement These are two parts of that problem: -> ConfigurationStatements -> StartTCStatement -> TimerStatements -> StartTimerStatement PS. backtrack is not used at all in the grammar. BR Gustaf 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 -~----------~----~----~----~------~----~------~--~---
