This is specific to the C# *3* target but shows how I'm currently
working to address this issue.

Delegate grammars currently don't work quite right in the C# 3 target.
Since each grammar type is declared as a 'partial class', I'm
implementing the delegator classes within the grammar they are delegated
to.

GrammarParser.cs:

namespace GrammarNamespace {
public partial class Grammar1 : Parser { ... }
}

GrammarParser.IncludedGrammarParser.cs:

namespace GrammarNamespace {
partial class Grammar1 {
partial class IncludedGrammarParser : Parser { ... }
}
}

-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Jim Idle
Sent: Friday, April 10, 2009 10:35 AM
To: ANTLR-dev Dev
Subject: [antlr-dev] C# 2 target and import grammars

Anyone know how to specify or otherwise make work, import grammars in C#

2 target 3.1.3?

If I specify a @namespace in the base grammars then it can't find the 
delegators in the generated code for the imports. If I don't specify any

namespaces at all then it seems to try to use the name of my grammar for

a type, which it cannot then find . If I add the @namespace option to 
all the grammars including the import grammars, then the main code 
cannot find the delegates.

I can't seem to work out what the correct combination is. Anyone got any

docs or can give me a hint here?

Jim
_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org/mailman/listinfo/antlr-dev
_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org/mailman/listinfo/antlr-dev

Reply via email to