Пример #1
0
		public override void PostWalk(VarDeclaration node) { }
Пример #2
0
		// VarDeclaration
		public override bool Walk(VarDeclaration node) { return false; }
Пример #3
0
		public virtual void PostWalk(VarDeclaration node) { }
Пример #4
0
		// VarDeclaration
		public virtual bool Walk(VarDeclaration node) { return true; }
Пример #5
0
        private Stmt ParseVarDeclaration()
        {
            Eat(TokenType.KeywordVar);
            int gstart = GetStart();
            List<VarInitialization> vars = new List<VarInitialization>();
            do
            {
                int start = GetStart();
                NameToken t = NextToken() as NameToken;
                Expr initValue = null;
                if (t == null)
                {
                    ReportSyntaxError("Expected NameToken.");
                    break;
                }

                if (MaybeEat(TokenType.Assign))
                {
                    initValue = ParseExpr();
                }

                VarInitialization v = new VarInitialization(t.Name, initValue);
                v.SetLoc(_globalParent, start, GetEnd());
                vars.Add(v);
            } while (MaybeEat(TokenType.Comma));

            VarDeclaration decl = new VarDeclaration(vars.ToArray());
            decl.SetLoc(_globalParent, gstart, GetEnd());

            EatSemiOrInteractiveEndOfFile();
            return decl;
        }
		// VarDeclaration
		public override bool Walk(VarDeclaration node)
		{
			node.Parent = _currentScope;
			
			return base.Walk(node);
		}