Greetings! On Fri, 2011-10-07 at 11:45 -0700, mglyons wrote: > I am trying to build the grammar for a small language, C-. I am getting a > long list of errors and am unable to resolve them with google and my > textbook after almost a day of trying. > > Here is my grammar: > > > Here is the list of errors: > the attachments did not appear (for me) on the mailing list. but found the grammar and list of errors on the nabble link.
i did not try to run your grammar through the ANTLR Tool but by inspection i see two issues: a) starting with your else parser rule and continuing to the end of the grammar, all of these rules appear to be better expressed as lexer rules so make the first letter (at least) of each rule name be an upper case letter. b) your compound statement rule does not quote the { and the } so it consists of just a semantic action that is not valid java code. try fixing the above and see what errors/warnings remain from the Tool. you probably will want/need to left factor several of your rules as the Tool suggests. hope this helps... -jbb 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 il-antlr-inter...@googlegroups.com. To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.