Beispiel #1
0
        public void Init(ParsingContext context, ParseTreeNode parseNode)
        {
            var grammar = (SonesGQLGrammar)context.Language.Grammar;
            if (parseNode.ChildNodes[0].Term == grammar.S_REFUUID || parseNode.ChildNodes[0].Term == grammar.S_REFERENCEUUID)
            {
                IsREFUUID = true;
            }

            if (parseNode.ChildNodes.Count >3)
            {
                var tupleNode = parseNode.ChildNodes[4].AstNode as TupleNode;

                if (tupleNode == null)
                {
                    throw new NotImplementedQLException("");
                }

                Dictionary<string, object> parameters = null;
                if (parseNode.ChildNodes[5].AstNode is ParametersNode)
                {
                    parameters = (parseNode.ChildNodes[5].AstNode as ParametersNode).ParameterValues;
                }

                String referencedVertexType = parseNode.ChildNodes[2].Token.ValueString;

                SetRefDefinition = new SetRefDefinition(tupleNode.TupleDefinition, IsREFUUID, referencedVertexType, parameters);
            }
            else
            {
                var tupleNode = parseNode.ChildNodes[1].AstNode as TupleNode;

                if (tupleNode == null)
                {
                    throw new NotImplementedQLException("");
                }

                Dictionary<string, object> parameters = null;
                if (parseNode.ChildNodes[2].AstNode is ParametersNode)
                {
                    parameters = (parseNode.ChildNodes[2].AstNode as ParametersNode).ParameterValues;
                }

                SetRefDefinition = new SetRefDefinition(tupleNode.TupleDefinition, IsREFUUID, String.Empty, parameters);
            }

            
        }
 public AttributeAssignOrUpdateSetRef(IDChainDefinition myIDChainDefinition, SetRefDefinition mySetRefDefinition)
     : base(myIDChainDefinition)
 {
     SetRefDefinition = mySetRefDefinition;
 }
 public AttributeAssignOrUpdateSetRef(IDChainDefinition myIDChainDefinition, SetRefDefinition mySetRefDefinition)
     : base(myIDChainDefinition)
 {
     SetRefDefinition = mySetRefDefinition;
 }