本文整理汇总了C#中Record.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# Record.AddChild方法的具体用法?C# Record.AddChild怎么用?C# Record.AddChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Record
的用法示例。
在下文中一共展示了Record.AddChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: recordDef
public Record recordDef()
{
EnterRule_recordDef();
EnterRule("recordDef", 5);
TraceIn("recordDef", 5);
Record rec = default(Record);
IToken identifier8 = default(IToken);
List<Variable> recordVariableList9 = default(List<Variable>);
rec = new Record();
try { DebugEnterRule(GrammarFileName, "recordDef");
DebugLocation(87, 5);
try
{
// D:\\projects\\repository\\ifmo\\Компиляторы\\PascalCompiler\\PascalCompiler\\Grammar\\Pascal.g:92:6: ( TYPE identifier EQUAL RECORD recordVariableList END SEMI )
DebugEnterAlt(1);
// D:\\projects\\repository\\ifmo\\Компиляторы\\PascalCompiler\\PascalCompiler\\Grammar\\Pascal.g:92:8: TYPE identifier EQUAL RECORD recordVariableList END SEMI
{
DebugLocation(92, 8);
Match(input,TYPE,Follow._TYPE_in_recordDef308);
DebugLocation(92, 13);
PushFollow(Follow._identifier_in_recordDef310);
identifier8=identifier();
PopFollow();
DebugLocation(92, 24);
rec.SetName(identifier8);
DebugLocation(92, 58);
Match(input,EQUAL,Follow._EQUAL_in_recordDef314);
DebugLocation(92, 64);
Match(input,RECORD,Follow._RECORD_in_recordDef316);
DebugLocation(93, 7);
PushFollow(Follow._recordVariableList_in_recordDef324);
recordVariableList9=recordVariableList();
PopFollow();
DebugLocation(94, 7);
foreach(var child in recordVariableList9)
{
rec.AddChild(child);
}
DebugLocation(100, 7);
Match(input,END,Follow._END_in_recordDef340);
DebugLocation(100, 11);
Match(input,SEMI,Follow._SEMI_in_recordDef342);
}
}
catch (RecognitionException e)
{
throw e;
}
finally
{
TraceOut("recordDef", 5);
LeaveRule("recordDef", 5);
LeaveRule_recordDef();
}
DebugLocation(101, 5);
} finally { DebugExitRule(GrammarFileName, "recordDef"); }
return rec;
}