Reputation: 25367
I can't find something like that
@parser::using
{
using System;
using System.Collections.Generic;
// ..
}
to generate my parser. Does anybody know how I can include such using
lines into my parser?
I need this e.g. for a Dictionary:
@parser::members
{
protected Dictionary<String, String> m_myDictionary= new Dictionary<String, String>();
}
And I don't want to write the whole namespace
for all objects all the time ..
Upvotes: 1
Views: 151
Reputation: 99859
You can use
@parser::header
{
}
and/or this, depending on context.
@lexer::header
{
}
However, I recommend not using this construct, and instead moving all of the C# code to a listener or visitor that executes after the parsing is complete.
Upvotes: 1