示例#1
0
        public AstPrinterNode Visit(ConstDecl node)
        {
            var printer = new AstPrinterNode(node.ToString());

            printer.AddChild(node.Ident.Accept(this));
            printer.AddChild(node.Expression.Accept(this));
            return(printer);
        }
        public bool Visit(ConstDecl node)
        {
            node.Expression.Accept(this);

            CheckIdentifierDuplicate(node.Ident.Token);

            _symStack.AddConstant(node.IsLocal, node.Ident.ToString(), node.Expression.SymType);

            return(true);
        }