本文整理匯總了C#中Antlr3.Tool.Grammar.GetOption方法的典型用法代碼示例。如果您正苦於以下問題:C# Antlr3.Tool.Grammar.GetOption方法的具體用法?C# Antlr3.Tool.Grammar.GetOption怎麽用?C# Antlr3.Tool.Grammar.GetOption使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Antlr3.Tool.Grammar
的用法示例。
在下文中一共展示了Antlr3.Tool.Grammar.GetOption方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: HandleGrammarInit
private void HandleGrammarInit(Grammar g, Template recognizerST, Template outputFileST, Template headerFileST)
{
if (state.backtracking == 0)
{
Init(g);
this.recognizerST = recognizerST;
this.outputFileST = outputFileST;
this.headerFileST = headerFileST;
string superClass = (string)g.GetOption("superClass");
outputOption = (string)g.GetOption("output");
if (superClass != null)
recognizerST.SetAttribute("superClass", superClass);
if (g.type != GrammarType.Lexer)
{
object labelType = g.GetOption("ASTLabelType");
if (labelType != null)
recognizerST.SetAttribute("ASTLabelType", labelType);
}
if (g.type == GrammarType.TreeParser && g.GetOption("ASTLabelType") == null)
ErrorManager.GrammarWarning(ErrorManager.MSG_MISSING_AST_TYPE_IN_TREE_GRAMMAR, g, null, g.name);
if (g.type != GrammarType.TreeParser)
{
object labelType = g.GetOption("TokenLabelType");
if (labelType != null)
recognizerST.SetAttribute("labelType", labelType);
}
recognizerST.SetAttribute("numRules", grammar.Rules.Count);
outputFileST.SetAttribute("numRules", grammar.Rules.Count);
headerFileST.SetAttribute("numRules", grammar.Rules.Count);
}
}