I am relatively new to antlr, and would appreciate suggestions on moving forward to tackle a problem I am having with 'no viable alternative at input'.
I am trying to use the C grammar file from here http://www.antlr.org/grammar/1153358328744/C.g to implement a parser that extracts declarations (typedefs, functions) from C files. More often I am running into problems, as the parser that gets generated seems to be confused with certain forms of function declarations. For example, when I use the following as an input code in antlrworks debugger (using the unmodified grammar from http://www.antlr.org/grammar/1153358328744/C.g); static void function(some_type bus) { } I see the following list of problems get reported by the debugger: __Test___input.txt line 1:20 missing ';' at '(' __Test___input.txt line 1:20 no viable alternative at input '(' __Test___input.txt line 1:20 no viable alternative at input '(' __Test___input.txt line 1:34 no viable alternative at input ')' I think because of this my parser fails to extract all function definitions from the file. I am wondering if anyone here has used or extended the grammar (http://www.antlr.org/grammar/1153358328744/C.g) and encountered the problem I am seeing and has a fix for it. Thank you - sushil 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.
