Partial grammar for counting class count
问题 I need to count the number of classes in correct C# source file. I wrote the following grammar: grammar CSharpClassGrammar; options { language=CSharp2; } @parser::namespace { CSharpClassGrammar.Generated } @lexer::namespace { CSharpClassGrammar.Generated } @header { using System; using System.Collections.Generic; } @members { private List<string> _classCollector = new List<string>(); public List<string> ClassCollector { get { return _classCollector; } } } /*-----------------------------------