public override IQueryElement VisitObject_initialization_element([NotNull] QueryGrammarParser.Object_initialization_elementContext context) { ObjectInitializationElement objectElement = new ObjectInitializationElement(); objectElement.FieldName = context.NAME().GetText(); IQueryElement attributeValue = Visit(GetElementValue(context)); objectElement.Add(attributeValue); return(objectElement); }
private IParseTree GetElementValue([NotNull] QueryGrammarParser.Object_initialization_elementContext context) { if (context.literal() != null) { return(context.literal()); } else if (context.get_stmt() != null) { return(context.get_stmt()); } throw new SyntaxException("Attribute literal or statement"); }