Exemple #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));
                    }
                }
            }
        }
Exemple #2
0
 public void VisitFactorTail(FactorTail node)
 {
     node.Accept(this.typeChecker);
 }