コード例 #1
0
 public void Visit(Expression node)
 {
 }
コード例 #2
0
 public void Visit(Expression node)
 {
     node.Child.Accept(this);
 }
コード例 #3
0
        public void Visit(Expression node)
        {
            //if expression is literal
            if (node.Child == null)
            {
                throw new Exception("Expression should have one and only one child");
            }

            node.Child.Accept(this);

            ReferenceTables.SetValue(node, ReferenceTables.GetValue(node.Child));
        }
コード例 #4
0
ファイル: StatementUnit.cs プロジェクト: javachengwc/many-ql
 public StatementUnit(Identifier identifier, Expression expression, string unitText, IStaticReturnType dataType, SourceLocation sourceLocation)
     : base(identifier, dataType, unitText, sourceLocation)
 {
     Expression = expression;
 }
コード例 #5
0
        private ITerminalWrapper GetValue(Expression key)
        {
            if (key.Child is IStaticReturnType)
            {
                TerminalWrapperFactory terminalWrapperFactory = new TerminalWrapperFactory();
                return terminalWrapperFactory.CreateWrapper(key.Child as IStaticReturnType);
            }

            return GetValue(key.Child);
        }
コード例 #6
0
 public void Visit(Expression node)
 {
 }
コード例 #7
0
ファイル: QLListener.cs プロジェクト: javachengwc/many-ql
        public override void ExitExpression(QLParser.ExpressionContext context)
        {
            IList<ElementBase> children = GetChildren();
            Expression expression;

            if (children.Count() == 1)
            {
                expression = new Expression(children[0], SourceLocation.CreateFor(context));
            }
            else if (children.Count() == 3)
            {
                ElementBase leftNode = children[0];
                BinaryTreeElementBase operatorNode = (BinaryTreeElementBase)children[1];
                ElementBase rightNode = children[2];

                operatorNode.Left = leftNode;
                operatorNode.Right = rightNode;

                expression = new Expression(operatorNode, SourceLocation.CreateFor(context));
            }
            else
            {
                _astBuilderExceptions.Add(new ParserError("Expression without a child"));
                return;
            }

            AppendToAST(expression);
        }