Hope this is very fast :) I wrote the lexer / parser specification in ANTLR3 and aimed at the CSharp2 target. The generated code works correctly, but I can't get ANTLR to put C # output in a namespace.
The corresponding section of the grammar file is as follows:
grammar MyGrammar;
options
{
language = CSharp2;
output = AST;
ASTLabelType = CommonTree;
}
To create the correct namespace, I tried:
@namespace { MyNamespace }
and
@lexer::namespace { MyNamespace }
@parser::namespace { MyNamespace }
but both of these generate errors, claiming that the file has no rules.
Any help is appreciated.
source
share