public Grammar(Tool tool)
{
nameSpaceChecker = new NameSpaceChecker( this );
ll1Analyzer = new LL1Analyzer( this );
sanity = new GrammarSanity( this );
builtFromString = true;
composite = new CompositeGrammar( this );
Tool = tool;
TemplateGroup lexerGrammarTemplateGroup = new TemplateGroupString(lexerGrammarTemplateText);
_lexerGrammarTemplate = lexerGrammarTemplateGroup.GetInstanceOf("grammar");
string targetsDirectory = Path.Combine(AntlrTool.ToolPathRoot, "Targets");
target = CodeGenerator.LoadLanguageTarget((string)GetOption("language"), targetsDirectory);
}