public override AttributeDefinition VisitAttribute_name(V1QueryParser.Attribute_nameContext context) { var parts = context.attribute_name_part(); var result = Visit(parts[0]); if (parts.Length > 1) { for (var i = 1; i < parts.Length; i++) { var part = parts[i]; var subVisitor = new AttributeDefinitionVisitor(result.RelatedAssetType, _metaModel); var relatedAttributeDefinition = subVisitor.Visit(part); result = result.CreateJoinAttributeDefinition(relatedAttributeDefinition); } } var agg = context.aggregation_name(); if (agg != null) { var aggregateName = agg.NAME().GetText(); var aggregateType = (AggregateType)Enum.Parse(typeof(AggregateType), aggregateName); result = result.CreateAggregateAttributeDefinition(aggregateType); } return(result); }
/// <summary> /// Exit a parse tree produced by <see cref="V1QueryParser.attribute_name"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitAttribute_name([NotNull] V1QueryParser.Attribute_nameContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="V1QueryParser.attribute_name"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitAttribute_name([NotNull] V1QueryParser.Attribute_nameContext context) { return(VisitChildren(context)); }