Esempio n. 1
0
 public SimpleExpressionTail(Token token, TokenType operation, TermNode term, SimpleExpressionTail tail, Scope scope)
     : base(token, scope)
 {
     this.operation = operation;
     this.term      = term;
     this.tail      = tail;
 }
Esempio n. 2
0
 public SimpleExpression(Token token, TermNode term, SimpleExpressionTail tail, bool additiveInverse, Scope scope)
     : base(token, scope)
 {
     this.term            = term;
     this.tail            = tail;
     this.additiveInverse = additiveInverse;
     this.evaluationType  = TokenType.UNDEFINED;
 }
Esempio n. 3
0
        public void VisitSimpleExpressionTail(SimpleExpressionTail node)
        {
            if (node.HasAlreadyBeenEvaluated)
            {
                return;
            }

            node.Term.Accept(this);
            TokenType termEval = node.Term.EvaluationType;

            if (node.Tail != null)
            {
                node.Tail.Accept(this);
                TokenType tailEval = node.Tail.EvaluationType;

                if (!LegitOperationChecker.IsLegitOperationForEvaluations(node.Tail.Operation, termEval, tailEval))
                {
                    termEval = TokenType.ERROR;
                }
            }

            node.EvaluationType = termEval;
        }
Esempio n. 4
0
 public void VisitSimpleExpressionTail(SimpleExpressionTail node)
 {
     node.Accept(this.typeChecker);
     node.Term.Accept(this);
 }