Пример #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 VisitFactorMain(FactorMain node)
 {
     node.Accept(this.typeChecker);
     node.Evaluee.Accept(this);
 }