public TermTail(Token token, Scope scope, TokenType operation, Factor factor, TermTail termTail = null) : base(token, scope) { this.operation = operation; this.factor = factor; this.termTail = termTail; }
public void VisitTermTailNode(TermTail node) { node.Accept(this.typeChecker); Factor factor = node.Factor; TermTail tail = node.ChildTermTail; factor.Accept(this); if (tail != null) { tail.Accept(this); } if (node.EvaluationType == TokenType.ERROR) { analyzer.notifyError(new IllegalTypeError(node)); } }
public void VisitTermTailNode(TermTail node) { if (node.HasAlreadyBeenEvaluated) { return; } node.Factor.Accept(this); TokenType factorEval = node.Factor.EvaluationType; if (node.ChildTermTail != null) { node.ChildTermTail.Accept(this); TokenType tailEval = node.ChildTermTail.EvaluationType; if (!LegitOperationChecker.IsLegitOperationForEvaluations(node.ChildTermTail.Operation, factorEval, tailEval)) { factorEval = TokenType.ERROR; } } node.EvaluationType = factorEval; }
public TermNode(Token token, Scope scope, Factor factorNode, TermTail termTailNode = null) : base(token, scope) { this.factorNode = factorNode; this.termTailNode = termTailNode; }