Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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;
        }
Beispiel #4
0
 public void VisitSimpleExpressionTail(SimpleExpressionTail node)
 {
     node.Accept(this.typeChecker);
     node.Term.Accept(this);
 }