Why are antlr3 c# parser methods private?
问题 I'm building a parser in antlr which compiles to a working java target. When I retarget for c#2 it produces a parser in which all of the parse methods are private but marked with a [GrammarRule("rulename")] attribute. What is the approved means to actually invoke the parser? I am using ANTLR 3.3 Nov 30, 2010 12:45:30 Thanks, Andy 回答1: Make at least one parser rule "public" like this: grammar T; options { language=CSharp2; } public parse : privateRule+ EOF ; privateRule : Token+ ; // ... You