本文整理汇总了C#中ParseTreeNode.HasChildNodes方法的典型用法代码示例。如果您正苦于以下问题:C# ParseTreeNode.HasChildNodes方法的具体用法?C# ParseTreeNode.HasChildNodes怎么用?C# ParseTreeNode.HasChildNodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParseTreeNode
的用法示例。
在下文中一共展示了ParseTreeNode.HasChildNodes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetContent
public void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
if (parseNode.HasChildNodes())
{
ParallelTasks = Convert.ToUInt32(parseNode.ChildNodes[1].Token.Value);
}
}
示例2: GetContent
public void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
var _GraphQL = GetGraphQLGrammar(context);
if (parseNode.HasChildNodes())
{
var _Terminal = parseNode.ChildNodes[0].Token.Terminal;
if (_Terminal == _GraphQL.S_ALL)
{
DumpType = DumpTypes.GDDL | DumpTypes.GDML;
}
else if (_Terminal == _GraphQL.S_GDDL)
{
DumpType = DumpTypes.GDDL;
}
else if (_Terminal == _GraphQL.S_GDML)
{
DumpType = DumpTypes.GDML;
}
else
{
throw new GraphDBException(new Errors.Error_InvalidDumpType(_Terminal.DisplayName));
}
}
else
{
DumpType = DumpTypes.GDDL | DumpTypes.GDML;
}
}
示例3: GetContent
private void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
if (parseNode.HasChildNodes())
{
if (parseNode.ChildNodes[3] != null && parseNode.ChildNodes[3].HasChildNodes() && parseNode.ChildNodes[3].ChildNodes[0].Term.Name.ToUpper() == "DESC")
_OrderDirection = SortDirection.Desc;
else
_OrderDirection = SortDirection.Asc;
_OrderByAttributeList = new List<OrderByAttributeDefinition>();
foreach (ParseTreeNode treeNode in parseNode.ChildNodes[2].ChildNodes)
{
if (treeNode.AstNode != null && treeNode.AstNode is IDNode)
{
_OrderByAttributeList.Add(new OrderByAttributeDefinition(((IDNode)treeNode.AstNode).IDChainDefinition, null));
}
else
{
_OrderByAttributeList.Add(new OrderByAttributeDefinition(null, treeNode.Token.ValueString));
}
}
OrderByDefinition = new OrderByDefinition(_OrderDirection, _OrderByAttributeList);
}
}
示例4: GetContent
public void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
TypesSettingScope? settingType;
if (parseNode.HasChildNodes() && (parseNode.ChildNodes.Count >= 2))
{
switch (parseNode.ChildNodes[1].Token.Text.ToUpper())
{
case "TYPE":
settingType = TypesSettingScope.TYPE;
_DescribeSettingDefinition = new DescribeSettingDefinition(settingType, myTypeName: (parseNode.ChildNodes[2].ChildNodes[0].AstNode as ATypeNode).ReferenceAndType.TypeName);
break;
case "ATTRIBUTE":
settingType = TypesSettingScope.ATTRIBUTE;
_DescribeSettingDefinition = new DescribeSettingDefinition(settingType, myIDChain: (parseNode.ChildNodes[2].ChildNodes[2].AstNode as IDNode).IDChainDefinition);
break;
case "DB":
settingType = TypesSettingScope.DB;
_DescribeSettingDefinition = new DescribeSettingDefinition(settingType);
break;
case "SESSION":
settingType = TypesSettingScope.SESSION;
_DescribeSettingDefinition = new DescribeSettingDefinition(settingType);
break;
default:
settingType = null;
_DescribeSettingDefinition = new DescribeSettingDefinition(settingType);
break;
}
}
}
示例5: GetContent
/// <summary>
/// This handles the Where Expression Node with all the
/// </summary>
/// <param name="context"></param>
/// <param name="parseNode"></param>
/// <param name="typeManager"></param>
public void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
if (parseNode.HasChildNodes())
{
BinExprNode = (BinaryExpressionNode)parseNode.ChildNodes[1].AstNode;
}
}
示例6: GetContent
public void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
if (parseNode.HasChildNodes())
{
_DescrAggrDefinition = new DescribeAggregateDefinition(parseNode.ChildNodes[1].Token.ValueString.ToUpper());
}
}
示例7: GetContent
public override void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
if (parseNode.HasChildNodes())
{
//get type
if (parseNode.ChildNodes[1] != null && parseNode.ChildNodes[1].AstNode != null)
{
_Type = ((ATypeNode)(parseNode.ChildNodes[1].AstNode)).ReferenceAndType.TypeName;
}
else
{
throw new GraphDBException(new Error_NotImplemented(new System.Diagnostics.StackTrace(true)));
}
if (parseNode.ChildNodes[3] != null && parseNode.ChildNodes[3].HasChildNodes())
{
_AttributeAssignList = new List<AAttributeAssignOrUpdate>((parseNode.ChildNodes[3].AstNode as AttrUpdateOrAssignListNode).ListOfUpdate.Select(e => e as AAttributeAssignOrUpdate));
}
if (parseNode.ChildNodes[4] != null && ((WhereExpressionNode)parseNode.ChildNodes[4].AstNode).BinaryExpressionDefinition != null)
{
_WhereExpression = ((WhereExpressionNode)parseNode.ChildNodes[4].AstNode).BinaryExpressionDefinition;
}
}
}
示例8: GetContent
private void GetContent(CompilerContext myCompilerContext, ParseTreeNode myParseTreeNode)
{
if (myParseTreeNode.HasChildNodes())
_IsUnique = true;
else
_IsUnique = false;
}
示例9: GetContent
private void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
_Shards = null;
if (parseNode.HasChildNodes())
{
_Shards = UInt16.Parse(parseNode.ChildNodes[1].Token.ValueString);
}
}
示例10: GetContent
public void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
var verbosityType = VerbosityType;
if (parseNode.HasChildNodes() && Enum.TryParse<VerbosityTypes>(parseNode.ChildNodes[1].Token.Text, true, out verbosityType))
{
VerbosityType = verbosityType;
}
}
示例11: GetContent
private void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
if (parseNode.HasChildNodes())
{
IndexType = parseNode.ChildNodes[1].Token.ValueString;
}
}
示例12: GetContent
public void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
if (parseNode.HasChildNodes())
{
foreach (var child in (parseNode.ChildNodes[1].AstNode as TupleNode).TupleDefinition)
{
Comments.Add((child.Value as ValueDefinition).Value.ToString());
}
}
}
示例13: GetContent
private void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
if (parseNode.HasChildNodes())
{
if (parseNode.ChildNodes[1] != null)
{
Count = Convert.ToUInt64(parseNode.ChildNodes[1].Token.Value);
}
}
}
示例14: GetContent
private void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
if (parseNode.HasChildNodes())
{
if (parseNode.ChildNodes[1].Token.ValueString.ToLower() == "graph")
_SelectOutputType = SelectOutputTypes.Graph;
else
_SelectOutputType = SelectOutputTypes.Tree;
}
}
示例15: GetContent
private void GetContent(CompilerContext context, ParseTreeNode parseNode)
{
if (!parseNode.HasChildNodes())
return;
IsSorted = true;
if (parseNode.ChildNodes.Count == 3 && parseNode.ChildNodes[2].Token.Text.ToUpper() == GraphQL.GraphQueryLanguage.TERMINAL_DESC)
SortDirection = SortDirection.Desc;
else
SortDirection = SortDirection.Asc;
}