Пример #1
0
        public void VisitFactorNode(Factor node)
        {
            node.Accept(this.typeChecker);
            FactorMain main = node.FactorMain;
            FactorTail tail = node.FactorTail;

            main.Accept(this);

            if (tail != null)
            {
                tail.Accept(this);

                if (tail.Token.Type == TokenType.SIZE && main.Variable)
                {
                    VariableIdNode idNode = (VariableIdNode)main.Evaluee;

                    TokenType idEval = idNode.Scope.GetProperty(idNode.ID).GetTokenType();

                    if (idEval != TokenType.TYPE_ARRAY)
                    {
                        analyzer.notifyError(new IllegalTypeError(tail));
                    }
                }
            }
        }
Пример #2
0
 public void VisitFactorTail(FactorTail node)
 {
     node.Accept(this.typeChecker);
 }
Пример #3
0
 public Factor(Token token, Scope scope, FactorMain main, FactorTail tail = null)
     : base(token, scope)
 {
     this.main = main;
     this.tail = tail;
 }
Пример #4
0
 public void VisitFactorTail(FactorTail node)
 {
 }