public SimpleExpressionTail(Token token, TokenType operation, TermNode term, SimpleExpressionTail tail, Scope scope) : base(token, scope) { this.operation = operation; this.term = term; this.tail = tail; }
public void VisitTermNode(TermNode node) { if (node.HasAlreadyBeenEvaluated) { return; } node.Factor.Accept(this); TokenType factorEval = node.Factor.EvaluationType; if (node.TermTail != null) { node.TermTail.Accept(this); TokenType tailEval = node.TermTail.EvaluationType; if (!LegitOperationChecker.IsLegitOperationForEvaluations(node.TermTail.Operation, factorEval, tailEval)) { factorEval = TokenType.ERROR; } // MUST HANDLE CASES WHERE INT + REAL EVALUATED } node.EvaluationType = factorEval; }
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; }
public void VisitTermNode(TermNode node) { node.Accept(this.typeChecker); Factor factor = node.Factor; TermTail tail = node.TermTail; factor.Accept(this); if (tail != null) { tail.Accept(this); } if (node.EvaluationType == TokenType.ERROR) { analyzer.notifyError(new IllegalTypeError(node)); } }