Inheritance: ICSharpCode.NRefactory.Ast.Statement
 public override object TrackedVisitYieldStatement(YieldStatement yieldStatement, object data)
 {
     return null;
 }
		public virtual object TrackedVisitYieldStatement(YieldStatement yieldStatement, object data) {
			return base.VisitYieldStatement(yieldStatement, data);
		}
		public sealed override object VisitYieldStatement(YieldStatement yieldStatement, object data) {
			this.BeginVisit(yieldStatement);
			object result = this.TrackedVisitYieldStatement(yieldStatement, data);
			this.EndVisit(yieldStatement);
			return result;
		}
Ejemplo n.º 4
0
	void EmbeddedStatement(
#line  1555 "cs.ATG" 
out Statement statement) {

#line  1557 "cs.ATG" 
		TypeReference type = null;
		Expression expr = null;
		Statement embeddedStatement = null;
		BlockStatement block = null;
		statement = null;
		

#line  1564 "cs.ATG" 
		Location startLocation = la.Location; 
		if (la.kind == 16) {
			Block(
#line  1566 "cs.ATG" 
out block);

#line  1566 "cs.ATG" 
			statement = block; 
		} else if (la.kind == 11) {
			lexer.NextToken();

#line  1569 "cs.ATG" 
			statement = new EmptyStatement(); 
		} else if (
#line  1572 "cs.ATG" 
UnCheckedAndLBrace()) {

#line  1572 "cs.ATG" 
			bool isChecked = true; 
			if (la.kind == 58) {
				lexer.NextToken();
			} else if (la.kind == 118) {
				lexer.NextToken();

#line  1573 "cs.ATG" 
				isChecked = false;
			} else SynErr(198);
			Block(
#line  1574 "cs.ATG" 
out block);

#line  1574 "cs.ATG" 
			statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block); 
		} else if (la.kind == 79) {
			IfStatement(
#line  1577 "cs.ATG" 
out statement);
		} else if (la.kind == 110) {
			lexer.NextToken();

#line  1579 "cs.ATG" 
			List<SwitchSection> switchSections = new List<SwitchSection>(); 
			Expect(20);
			Expr(
#line  1580 "cs.ATG" 
out expr);
			Expect(21);
			Expect(16);
			SwitchSections(
#line  1581 "cs.ATG" 
switchSections);
			Expect(17);

#line  1583 "cs.ATG" 
			statement = new SwitchStatement(expr, switchSections); 
		} else if (la.kind == 125) {
			lexer.NextToken();
			Expect(20);
			Expr(
#line  1586 "cs.ATG" 
out expr);
			Expect(21);
			EmbeddedStatement(
#line  1587 "cs.ATG" 
out embeddedStatement);

#line  1588 "cs.ATG" 
			statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.Start);
		} else if (la.kind == 65) {
			lexer.NextToken();
			EmbeddedStatement(
#line  1590 "cs.ATG" 
out embeddedStatement);
			Expect(125);
			Expect(20);
			Expr(
#line  1591 "cs.ATG" 
out expr);
			Expect(21);
			Expect(11);

#line  1592 "cs.ATG" 
			statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.End); 
		} else if (la.kind == 76) {
			lexer.NextToken();

#line  1594 "cs.ATG" 
			List<Statement> initializer = null; List<Statement> iterator = null; 
			Expect(20);
			if (StartOf(6)) {
				ForInitializer(
#line  1595 "cs.ATG" 
out initializer);
			}
			Expect(11);
			if (StartOf(6)) {
				Expr(
#line  1596 "cs.ATG" 
out expr);
			}
			Expect(11);
			if (StartOf(6)) {
				ForIterator(
#line  1597 "cs.ATG" 
out iterator);
			}
			Expect(21);
			EmbeddedStatement(
#line  1598 "cs.ATG" 
out embeddedStatement);

#line  1599 "cs.ATG" 
			statement = new ForStatement(initializer, expr, iterator, embeddedStatement); 
		} else if (la.kind == 77) {
			lexer.NextToken();
			Expect(20);
			Type(
#line  1601 "cs.ATG" 
out type);
			Identifier();

#line  1601 "cs.ATG" 
			string varName = t.val; 
			Expect(81);
			Expr(
#line  1602 "cs.ATG" 
out expr);
			Expect(21);
			EmbeddedStatement(
#line  1603 "cs.ATG" 
out embeddedStatement);

#line  1604 "cs.ATG" 
			statement = new ForeachStatement(type, varName , expr, embeddedStatement); 
		} else if (la.kind == 53) {
			lexer.NextToken();
			Expect(11);

#line  1607 "cs.ATG" 
			statement = new BreakStatement(); 
		} else if (la.kind == 61) {
			lexer.NextToken();
			Expect(11);

#line  1608 "cs.ATG" 
			statement = new ContinueStatement(); 
		} else if (la.kind == 78) {
			GotoStatement(
#line  1609 "cs.ATG" 
out statement);
		} else if (
#line  1611 "cs.ATG" 
IsYieldStatement()) {
			Expect(132);
			if (la.kind == 101) {
				lexer.NextToken();
				Expr(
#line  1612 "cs.ATG" 
out expr);

#line  1612 "cs.ATG" 
				statement = new YieldStatement(new ReturnStatement(expr)); 
			} else if (la.kind == 53) {
				lexer.NextToken();

#line  1613 "cs.ATG" 
				statement = new YieldStatement(new BreakStatement()); 
			} else SynErr(199);
			Expect(11);
		} else if (la.kind == 101) {
			lexer.NextToken();
			if (StartOf(6)) {
				Expr(
#line  1616 "cs.ATG" 
out expr);
			}
			Expect(11);

#line  1616 "cs.ATG" 
			statement = new ReturnStatement(expr); 
		} else if (la.kind == 112) {
			lexer.NextToken();
			if (StartOf(6)) {
				Expr(
#line  1617 "cs.ATG" 
out expr);
			}
			Expect(11);

#line  1617 "cs.ATG" 
			statement = new ThrowStatement(expr); 
		} else if (StartOf(6)) {
			StatementExpr(
#line  1620 "cs.ATG" 
out statement);
			while (!(la.kind == 0 || la.kind == 11)) {SynErr(200); lexer.NextToken(); }
			Expect(11);
		} else if (la.kind == 114) {
			TryStatement(
#line  1623 "cs.ATG" 
out statement);
		} else if (la.kind == 86) {
			lexer.NextToken();
			Expect(20);
			Expr(
#line  1626 "cs.ATG" 
out expr);
			Expect(21);
			EmbeddedStatement(
#line  1627 "cs.ATG" 
out embeddedStatement);

#line  1627 "cs.ATG" 
			statement = new LockStatement(expr, embeddedStatement); 
		} else if (la.kind == 121) {

#line  1630 "cs.ATG" 
			Statement resourceAcquisitionStmt = null; 
			lexer.NextToken();
			Expect(20);
			ResourceAcquisition(
#line  1632 "cs.ATG" 
out resourceAcquisitionStmt);
			Expect(21);
			EmbeddedStatement(
#line  1633 "cs.ATG" 
out embeddedStatement);

#line  1633 "cs.ATG" 
			statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement); 
		} else if (la.kind == 119) {
			lexer.NextToken();
			Block(
#line  1636 "cs.ATG" 
out block);

#line  1636 "cs.ATG" 
			statement = new UnsafeStatement(block); 
		} else if (la.kind == 74) {

#line  1638 "cs.ATG" 
			Statement pointerDeclarationStmt = null; 
			lexer.NextToken();
			Expect(20);
			ResourceAcquisition(
#line  1640 "cs.ATG" 
out pointerDeclarationStmt);
			Expect(21);
			EmbeddedStatement(
#line  1641 "cs.ATG" 
out embeddedStatement);

#line  1641 "cs.ATG" 
			statement = new FixedStatement(pointerDeclarationStmt, embeddedStatement); 
		} else SynErr(201);

#line  1643 "cs.ATG" 
		if (statement != null) {
		statement.StartLocation = startLocation;
		statement.EndLocation = t.EndLocation;
		}
		
	}
Ejemplo n.º 5
0
		public virtual object VisitYieldStatement(YieldStatement yieldStatement, object data) {
			throw new global::System.NotImplementedException("YieldStatement");
		}
Ejemplo n.º 6
0
 public virtual object VisitYieldStatement(YieldStatement yieldStatement, object data) {
     throw CreateException(yieldStatement);
 }
Ejemplo n.º 7
0
	void EmbeddedStatement(
#line  3077 "VBNET.ATG" 
out Statement statement) {

#line  3079 "VBNET.ATG" 
		Statement embeddedStatement = null;
		statement = null;
		Expression expr = null;
		string name = String.Empty;
		List<Expression> p = null;
		Location startLocation = la.Location;
		
		if (la.kind == 122) {
			lexer.NextToken();

#line  3087 "VBNET.ATG" 
			ExitType exitType = ExitType.None; 
			switch (la.kind) {
			case 213: {
				lexer.NextToken();

#line  3089 "VBNET.ATG" 
				exitType = ExitType.Sub; 
				break;
			}
			case 129: {
				lexer.NextToken();

#line  3091 "VBNET.ATG" 
				exitType = ExitType.Function; 
				break;
			}
			case 189: {
				lexer.NextToken();

#line  3093 "VBNET.ATG" 
				exitType = ExitType.Property; 
				break;
			}
			case 110: {
				lexer.NextToken();

#line  3095 "VBNET.ATG" 
				exitType = ExitType.Do; 
				break;
			}
			case 126: {
				lexer.NextToken();

#line  3097 "VBNET.ATG" 
				exitType = ExitType.For; 
				break;
			}
			case 221: {
				lexer.NextToken();

#line  3099 "VBNET.ATG" 
				exitType = ExitType.Try; 
				break;
			}
			case 234: {
				lexer.NextToken();

#line  3101 "VBNET.ATG" 
				exitType = ExitType.While; 
				break;
			}
			case 200: {
				lexer.NextToken();

#line  3103 "VBNET.ATG" 
				exitType = ExitType.Select; 
				break;
			}
			default: SynErr(302); break;
			}

#line  3105 "VBNET.ATG" 
			statement = new ExitStatement(exitType); 
		} else if (la.kind == 221) {
			TryStatement(
#line  3106 "VBNET.ATG" 
out statement);
		} else if (la.kind == 91) {
			lexer.NextToken();

#line  3107 "VBNET.ATG" 
			ContinueType continueType = ContinueType.None; 
			if (la.kind == 110 || la.kind == 126 || la.kind == 234) {
				if (la.kind == 110) {
					lexer.NextToken();

#line  3107 "VBNET.ATG" 
					continueType = ContinueType.Do; 
				} else if (la.kind == 126) {
					lexer.NextToken();

#line  3107 "VBNET.ATG" 
					continueType = ContinueType.For; 
				} else {
					lexer.NextToken();

#line  3107 "VBNET.ATG" 
					continueType = ContinueType.While; 
				}
			}

#line  3107 "VBNET.ATG" 
			statement = new ContinueStatement(continueType); 
		} else if (la.kind == 218) {
			lexer.NextToken();
			if (StartOf(25)) {
				Expr(
#line  3109 "VBNET.ATG" 
out expr);
			}

#line  3109 "VBNET.ATG" 
			statement = new ThrowStatement(expr); 
		} else if (la.kind == 198) {
			lexer.NextToken();
			if (StartOf(25)) {
				Expr(
#line  3111 "VBNET.ATG" 
out expr);
			}

#line  3111 "VBNET.ATG" 
			statement = new ReturnStatement(expr); 
		} else if (la.kind == 240) {
			lexer.NextToken();
			if (StartOf(25)) {
				Expr(
#line  3112 "VBNET.ATG" 
out expr);
			}

#line  3112 "VBNET.ATG" 
			statement = new YieldStatement(new ReturnStatement(expr)); 
		} else if (la.kind == 214) {
			lexer.NextToken();
			Expr(
#line  3114 "VBNET.ATG" 
out expr);
			EndOfStmt();
			Block(
#line  3114 "VBNET.ATG" 
out embeddedStatement);
			Expect(115);
			Expect(214);

#line  3115 "VBNET.ATG" 
			statement = new LockStatement(expr, embeddedStatement); 
		} else if (la.kind == 192) {
			lexer.NextToken();
			Identifier();

#line  3117 "VBNET.ATG" 
			name = t.val; 
			if (la.kind == 37) {
				lexer.NextToken();
				if (StartOf(44)) {
					ArgumentList(
#line  3118 "VBNET.ATG" 
out p);
				}
				Expect(38);
			}

#line  3120 "VBNET.ATG" 
			statement = new RaiseEventStatement(name, p);
			
		} else if (la.kind == 236) {
			WithStatement(
#line  3123 "VBNET.ATG" 
out statement);
		} else if (la.kind == 56) {
			lexer.NextToken();

#line  3125 "VBNET.ATG" 
			Expression handlerExpr = null; 
			Expr(
#line  3126 "VBNET.ATG" 
out expr);
			Expect(22);
			Expr(
#line  3126 "VBNET.ATG" 
out handlerExpr);

#line  3128 "VBNET.ATG" 
			statement = new AddHandlerStatement(expr, handlerExpr);
			
		} else if (la.kind == 196) {
			lexer.NextToken();

#line  3131 "VBNET.ATG" 
			Expression handlerExpr = null; 
			Expr(
#line  3132 "VBNET.ATG" 
out expr);
			Expect(22);
			Expr(
#line  3132 "VBNET.ATG" 
out handlerExpr);

#line  3134 "VBNET.ATG" 
			statement = new RemoveHandlerStatement(expr, handlerExpr);
			
		} else if (la.kind == 234) {
			lexer.NextToken();
			Expr(
#line  3137 "VBNET.ATG" 
out expr);
			EndOfStmt();
			Block(
#line  3138 "VBNET.ATG" 
out embeddedStatement);
			Expect(115);
			Expect(234);

#line  3140 "VBNET.ATG" 
			statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.Start);
			
		} else if (la.kind == 110) {
			lexer.NextToken();

#line  3145 "VBNET.ATG" 
			ConditionType conditionType = ConditionType.None;
			
			if (la.kind == 227 || la.kind == 234) {
				WhileOrUntil(
#line  3148 "VBNET.ATG" 
out conditionType);
				Expr(
#line  3148 "VBNET.ATG" 
out expr);
				EndOfStmt();
				Block(
#line  3149 "VBNET.ATG" 
out embeddedStatement);
				Expect(155);

#line  3152 "VBNET.ATG" 
				statement = new DoLoopStatement(expr, 
				                               embeddedStatement, 
				                               conditionType == ConditionType.While ? ConditionType.DoWhile : conditionType, 
				                               ConditionPosition.Start);
				
			} else if (la.kind == 1 || la.kind == 21) {
				EndOfStmt();
				Block(
#line  3159 "VBNET.ATG" 
out embeddedStatement);
				Expect(155);
				if (la.kind == 227 || la.kind == 234) {
					WhileOrUntil(
#line  3160 "VBNET.ATG" 
out conditionType);
					Expr(
#line  3160 "VBNET.ATG" 
out expr);
				}

#line  3162 "VBNET.ATG" 
				statement = new DoLoopStatement(expr, embeddedStatement, conditionType, ConditionPosition.End);
				
			} else SynErr(303);
		} else if (la.kind == 126) {
			lexer.NextToken();

#line  3167 "VBNET.ATG" 
			Expression group = null;
			TypeReference typeReference;
			string        typeName;
			
			if (la.kind == 112) {
				lexer.NextToken();
				LoopControlVariable(
#line  3173 "VBNET.ATG" 
out typeReference, out typeName);
				Expect(140);
				Expr(
#line  3174 "VBNET.ATG" 
out group);
				EndOfStmt();
				Block(
#line  3175 "VBNET.ATG" 
out embeddedStatement);
				Expect(166);
				if (StartOf(25)) {
					Expr(
#line  3176 "VBNET.ATG" 
out expr);
				}

#line  3178 "VBNET.ATG" 
				statement = new ForeachStatement(typeReference, 
				                                typeName,
				                                group, 
				                                embeddedStatement, 
				                                expr);
				statement.StartLocation = startLocation;
				statement.EndLocation   = t.EndLocation;
				
				
			} else if (StartOf(45)) {

#line  3189 "VBNET.ATG" 
				Expression start = null;
				Expression end = null;
				Expression step = null;
				Expression variableExpr = null;
				Expression nextExpr = null;
				List<Expression> nextExpressions = null;
				
				if (
#line  3196 "VBNET.ATG" 
IsLoopVariableDeclaration()) {
					LoopControlVariable(
#line  3197 "VBNET.ATG" 
out typeReference, out typeName);
				} else {

#line  3199 "VBNET.ATG" 
					typeReference = null; typeName = null; 
					SimpleExpr(
#line  3200 "VBNET.ATG" 
out variableExpr);
				}
				Expect(20);
				Expr(
#line  3202 "VBNET.ATG" 
out start);
				Expect(219);
				Expr(
#line  3202 "VBNET.ATG" 
out end);
				if (la.kind == 208) {
					lexer.NextToken();
					Expr(
#line  3202 "VBNET.ATG" 
out step);
				}
				EndOfStmt();
				Block(
#line  3203 "VBNET.ATG" 
out embeddedStatement);
				Expect(166);
				if (StartOf(25)) {
					Expr(
#line  3206 "VBNET.ATG" 
out nextExpr);

#line  3208 "VBNET.ATG" 
					nextExpressions = new List<Expression>();
					nextExpressions.Add(nextExpr);
					
					while (la.kind == 22) {
						lexer.NextToken();
						Expr(
#line  3211 "VBNET.ATG" 
out nextExpr);

#line  3211 "VBNET.ATG" 
						nextExpressions.Add(nextExpr); 
					}
				}

#line  3214 "VBNET.ATG" 
				statement = new ForNextStatement {
				TypeReference = typeReference,
				VariableName = typeName, 
				LoopVariableExpression = variableExpr,
				Start = start, 
				End = end, 
				Step = step, 
				EmbeddedStatement = embeddedStatement, 
				NextExpressions = nextExpressions
				};
				
			} else SynErr(304);
		} else if (la.kind == 120) {
			lexer.NextToken();
			Expr(
#line  3227 "VBNET.ATG" 
out expr);

#line  3227 "VBNET.ATG" 
			statement = new ErrorStatement(expr); 
		} else if (la.kind == 194) {
			lexer.NextToken();

#line  3229 "VBNET.ATG" 
			bool isPreserve = false; 
			if (la.kind == 187) {
				lexer.NextToken();

#line  3229 "VBNET.ATG" 
				isPreserve = true; 
			}
			ReDimClause(
#line  3230 "VBNET.ATG" 
out expr);

#line  3232 "VBNET.ATG" 
			ReDimStatement reDimStatement = new ReDimStatement(isPreserve);
			statement = reDimStatement;
			SafeAdd(reDimStatement, reDimStatement.ReDimClauses, expr as InvocationExpression);
			
			while (la.kind == 22) {
				lexer.NextToken();
				ReDimClause(
#line  3236 "VBNET.ATG" 
out expr);

#line  3237 "VBNET.ATG" 
				SafeAdd(reDimStatement, reDimStatement.ReDimClauses, expr as InvocationExpression); 
			}
		} else if (la.kind == 119) {
			lexer.NextToken();
			Expr(
#line  3241 "VBNET.ATG" 
out expr);

#line  3243 "VBNET.ATG" 
			EraseStatement eraseStatement = new EraseStatement();
			if (expr != null) { SafeAdd(eraseStatement, eraseStatement.Expressions, expr);}
			
			while (la.kind == 22) {
				lexer.NextToken();
				Expr(
#line  3246 "VBNET.ATG" 
out expr);

#line  3246 "VBNET.ATG" 
				if (expr != null) { SafeAdd(eraseStatement, eraseStatement.Expressions, expr); }
			}

#line  3247 "VBNET.ATG" 
			statement = eraseStatement; 
		} else if (la.kind == 209) {
			lexer.NextToken();

#line  3249 "VBNET.ATG" 
			statement = new StopStatement(); 
		} else if (
#line  3251 "VBNET.ATG" 
la.kind == Tokens.If) {
			Expect(137);

#line  3252 "VBNET.ATG" 
			Location ifStartLocation = t.Location; 
			Expr(
#line  3252 "VBNET.ATG" 
out expr);
			if (la.kind == 217) {
				lexer.NextToken();
			}
			if (la.kind == 1 || la.kind == 21) {
				EndOfStmt();
				Block(
#line  3255 "VBNET.ATG" 
out embeddedStatement);

#line  3257 "VBNET.ATG" 
				IfElseStatement ifStatement = new IfElseStatement(expr, embeddedStatement);
				ifStatement.StartLocation = ifStartLocation;
				Location elseIfStart;
				
				while (la.kind == 114 || 
#line  3263 "VBNET.ATG" 
IsElseIf()) {
					if (
#line  3263 "VBNET.ATG" 
IsElseIf()) {
						Expect(113);

#line  3263 "VBNET.ATG" 
						elseIfStart = t.Location; 
						Expect(137);
					} else {
						lexer.NextToken();

#line  3264 "VBNET.ATG" 
						elseIfStart = t.Location; 
					}

#line  3266 "VBNET.ATG" 
					Expression condition = null; Statement block = null; 
					Expr(
#line  3267 "VBNET.ATG" 
out condition);
					if (la.kind == 217) {
						lexer.NextToken();
					}
					EndOfStmt();
					Block(
#line  3268 "VBNET.ATG" 
out block);

#line  3270 "VBNET.ATG" 
					ElseIfSection elseIfSection = new ElseIfSection(condition, block);
					elseIfSection.StartLocation = elseIfStart;
					elseIfSection.EndLocation = t.Location;
					elseIfSection.Parent = ifStatement;
					ifStatement.ElseIfSections.Add(elseIfSection);
					
				}
				if (la.kind == 113) {
					lexer.NextToken();
					if (la.kind == 1 || la.kind == 21) {
						EndOfStmt();
					}
					Block(
#line  3279 "VBNET.ATG" 
out embeddedStatement);

#line  3281 "VBNET.ATG" 
					ifStatement.FalseStatement.Add(embeddedStatement);
					
				}
				Expect(115);
				Expect(137);

#line  3285 "VBNET.ATG" 
				ifStatement.EndLocation = t.Location;
				statement = ifStatement;
				
			} else if (StartOf(46)) {

#line  3290 "VBNET.ATG" 
				IfElseStatement ifStatement = new IfElseStatement(expr);
				ifStatement.StartLocation = ifStartLocation;
				
				SingleLineStatementList(
#line  3293 "VBNET.ATG" 
ifStatement.TrueStatement);
				if (la.kind == 113) {
					lexer.NextToken();
					if (StartOf(46)) {
						SingleLineStatementList(
#line  3296 "VBNET.ATG" 
ifStatement.FalseStatement);
					}
				}

#line  3298 "VBNET.ATG" 
				ifStatement.EndLocation = t.Location; statement = ifStatement; 
			} else SynErr(305);
		} else if (la.kind == 200) {
			lexer.NextToken();
			if (la.kind == 76) {
				lexer.NextToken();
			}
			Expr(
#line  3301 "VBNET.ATG" 
out expr);
			EndOfStmt();

#line  3302 "VBNET.ATG" 
			List<SwitchSection> selectSections = new List<SwitchSection>();
			Statement block = null;
			
			while (la.kind == 76) {

#line  3306 "VBNET.ATG" 
				List<CaseLabel> caseClauses = null; Location caseLocation = la.Location; 
				lexer.NextToken();
				CaseClauses(
#line  3307 "VBNET.ATG" 
out caseClauses);
				if (
#line  3307 "VBNET.ATG" 
IsNotStatementSeparator()) {
					lexer.NextToken();
				}
				EndOfStmt();

#line  3309 "VBNET.ATG" 
				SwitchSection selectSection = new SwitchSection(caseClauses);
				selectSection.StartLocation = caseLocation;
				
				Block(
#line  3312 "VBNET.ATG" 
out block);

#line  3314 "VBNET.ATG" 
				selectSection.Children = block.Children;
				selectSection.EndLocation = t.EndLocation;
				selectSections.Add(selectSection);
				
			}

#line  3320 "VBNET.ATG" 
			statement = new SwitchStatement(expr, selectSections);
			
			Expect(115);
			Expect(200);
		} else if (la.kind == 174) {

#line  3323 "VBNET.ATG" 
			OnErrorStatement onErrorStatement = null; 
			OnErrorStatement(
#line  3324 "VBNET.ATG" 
out onErrorStatement);

#line  3324 "VBNET.ATG" 
			statement = onErrorStatement; 
		} else if (la.kind == 134) {

#line  3325 "VBNET.ATG" 
			GotoStatement goToStatement = null; 
			GotoStatement(
#line  3326 "VBNET.ATG" 
out goToStatement);

#line  3326 "VBNET.ATG" 
			statement = goToStatement; 
		} else if (la.kind == 197) {

#line  3327 "VBNET.ATG" 
			ResumeStatement resumeStatement = null; 
			ResumeStatement(
#line  3328 "VBNET.ATG" 
out resumeStatement);

#line  3328 "VBNET.ATG" 
			statement = resumeStatement; 
		} else if (StartOf(45)) {

#line  3331 "VBNET.ATG" 
			Expression val = null;
			AssignmentOperatorType op;
			Location startLoc = la.Location;
			
			bool mustBeAssignment = la.kind == Tokens.Plus  || la.kind == Tokens.Minus ||
			                        la.kind == Tokens.Not   || la.kind == Tokens.Times;
			
			SimpleExpr(
#line  3338 "VBNET.ATG" 
out expr);
			if (StartOf(47)) {
				AssignmentOperator(
#line  3340 "VBNET.ATG" 
out op);
				Expr(
#line  3340 "VBNET.ATG" 
out val);

#line  3342 "VBNET.ATG" 
				expr = new AssignmentExpression(expr, op, val);
				expr.StartLocation = startLoc;
				expr.EndLocation = t.EndLocation;
				
			} else if (StartOf(48)) {

#line  3346 "VBNET.ATG" 
				if (mustBeAssignment) Error("error in assignment."); 
			} else SynErr(306);

#line  3349 "VBNET.ATG" 
			// a field reference expression that stands alone is a
			// invocation expression without parantheses and arguments
			if(expr is MemberReferenceExpression || expr is IdentifierExpression) {
				Location endLocation = expr.EndLocation;
				expr = new InvocationExpression(expr);
				expr.StartLocation = startLoc;
				expr.EndLocation = endLocation;
			}
			statement = new ExpressionStatement(expr);
			
		} else if (la.kind == 75) {
			lexer.NextToken();
			SimpleExpr(
#line  3359 "VBNET.ATG" 
out expr);

#line  3359 "VBNET.ATG" 
			statement = new ExpressionStatement(expr); 
		} else if (la.kind == 229) {
			lexer.NextToken();

#line  3361 "VBNET.ATG" 
			Statement block;  
			if (
#line  3362 "VBNET.ATG" 
Peek(1).kind == Tokens.As) {

#line  3363 "VBNET.ATG" 
				LocalVariableDeclaration resourceAquisition = new LocalVariableDeclaration(Modifiers.None); 
				VariableDeclarator(
#line  3364 "VBNET.ATG" 
resourceAquisition.Variables);
				while (la.kind == 22) {
					lexer.NextToken();
					VariableDeclarator(
#line  3366 "VBNET.ATG" 
resourceAquisition.Variables);
				}
				Block(
#line  3368 "VBNET.ATG" 
out block);

#line  3370 "VBNET.ATG" 
				statement = new UsingStatement(resourceAquisition, block);
				
			} else if (StartOf(25)) {
				Expr(
#line  3372 "VBNET.ATG" 
out expr);
				Block(
#line  3373 "VBNET.ATG" 
out block);

#line  3374 "VBNET.ATG" 
				statement = new UsingStatement(new ExpressionStatement(expr), block); 
			} else SynErr(307);
			Expect(115);
			Expect(229);
		} else if (StartOf(49)) {
			LocalDeclarationStatement(
#line  3377 "VBNET.ATG" 
out statement);
		} else SynErr(308);

#line  3380 "VBNET.ATG" 
		if (statement != null) {
		statement.StartLocation = startLocation;
		statement.EndLocation = t.EndLocation;
		}
		
	}
Ejemplo n.º 8
0
 public virtual object VisitYieldStatement(YieldStatement yieldStatement, object data)
 {
     Debug.Assert((yieldStatement != null));
     Debug.Assert((yieldStatement.Statement != null));
     return yieldStatement.Statement.AcceptVisitor(this, data);
 }
		public virtual object VisitYieldStatement(YieldStatement yieldStatement, object data) {
			Debug.Assert((yieldStatement != null));
			Debug.Assert((yieldStatement.Statement != null));
			nodeStack.Push(yieldStatement.Statement);
			yieldStatement.Statement.AcceptVisitor(this, data);
			yieldStatement.Statement = ((Statement)(nodeStack.Pop()));
			return null;
		}
 public object VisitYieldStatement(YieldStatement yieldStatement, object data)
 {
     throw new NotImplementedException ();
 }
 public virtual bool VisitYieldStatement(YieldStatement yieldStatement, object d)
 {
     if ((yieldStatement == null)) {
         return SetFailure();
     }
     if ((d == null)) {
         return SetFailure();
     }
     if ((yieldStatement.Statement == null)) {
         return SetFailure();
     }
     if(yieldStatement.GetType() != d.GetType()) {return SetFailure();}
     var data = (YieldStatement)d;
     if (!IsMatch(yieldStatement, data)) {
         return SetFailure();
     }
     return yieldStatement.Statement.AcceptVisitor(this, data.Statement);
 }
Ejemplo n.º 12
0
		public override object VisitYieldStatement(YieldStatement yieldStatement, object data)
		{
			return base.VisitYieldStatement(yieldStatement, data);
		}
 private bool IsMatch(YieldStatement left, YieldStatement data)
 {
     return true;
 }
Ejemplo n.º 14
0
	void EmbeddedStatement(
#line  1473 "cs.ATG" 
out Statement statement) {

#line  1475 "cs.ATG" 
		TypeReference type = null;
		Expression expr = null;
		Statement embeddedStatement = null;
		statement = null;
		

#line  1481 "cs.ATG" 
		Location startLocation = la.Location; 
		if (la.kind == 16) {
			Block(
#line  1483 "cs.ATG" 
out statement);
		} else if (la.kind == 11) {
			lexer.NextToken();

#line  1486 "cs.ATG" 
			statement = new EmptyStatement(); 
		} else if (
#line  1489 "cs.ATG" 
UnCheckedAndLBrace()) {

#line  1489 "cs.ATG" 
			Statement block; bool isChecked = true; 
			if (la.kind == 58) {
				lexer.NextToken();
			} else if (la.kind == 118) {
				lexer.NextToken();

#line  1490 "cs.ATG" 
				isChecked = false;
			} else SynErr(196);
			Block(
#line  1491 "cs.ATG" 
out block);

#line  1491 "cs.ATG" 
			statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block); 
		} else if (la.kind == 79) {
			IfStatement(
#line  1494 "cs.ATG" 
out statement);
		} else if (la.kind == 110) {
			lexer.NextToken();

#line  1496 "cs.ATG" 
			List<SwitchSection> switchSections = new List<SwitchSection>(); 
			Expect(20);
			Expr(
#line  1497 "cs.ATG" 
out expr);
			Expect(21);
			Expect(16);
			SwitchSections(
#line  1498 "cs.ATG" 
switchSections);
			Expect(17);

#line  1499 "cs.ATG" 
			statement = new SwitchStatement(expr, switchSections); 
		} else if (la.kind == 125) {
			lexer.NextToken();
			Expect(20);
			Expr(
#line  1502 "cs.ATG" 
out expr);
			Expect(21);
			EmbeddedStatement(
#line  1503 "cs.ATG" 
out embeddedStatement);

#line  1504 "cs.ATG" 
			statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.Start);
		} else if (la.kind == 65) {
			lexer.NextToken();
			EmbeddedStatement(
#line  1506 "cs.ATG" 
out embeddedStatement);
			Expect(125);
			Expect(20);
			Expr(
#line  1507 "cs.ATG" 
out expr);
			Expect(21);
			Expect(11);

#line  1508 "cs.ATG" 
			statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.End); 
		} else if (la.kind == 76) {
			lexer.NextToken();

#line  1510 "cs.ATG" 
			List<Statement> initializer = null; List<Statement> iterator = null; 
			Expect(20);
			if (StartOf(6)) {
				ForInitializer(
#line  1511 "cs.ATG" 
out initializer);
			}
			Expect(11);
			if (StartOf(6)) {
				Expr(
#line  1512 "cs.ATG" 
out expr);
			}
			Expect(11);
			if (StartOf(6)) {
				ForIterator(
#line  1513 "cs.ATG" 
out iterator);
			}
			Expect(21);
			EmbeddedStatement(
#line  1514 "cs.ATG" 
out embeddedStatement);

#line  1514 "cs.ATG" 
			statement = new ForStatement(initializer, expr, iterator, embeddedStatement); 
		} else if (la.kind == 77) {
			lexer.NextToken();
			Expect(20);
			Type(
#line  1516 "cs.ATG" 
out type);
			Identifier();

#line  1516 "cs.ATG" 
			string varName = t.val; 
			Expect(81);
			Expr(
#line  1517 "cs.ATG" 
out expr);
			Expect(21);
			EmbeddedStatement(
#line  1518 "cs.ATG" 
out embeddedStatement);

#line  1519 "cs.ATG" 
			statement = new ForeachStatement(type, varName , expr, embeddedStatement); 
		} else if (la.kind == 53) {
			lexer.NextToken();
			Expect(11);

#line  1522 "cs.ATG" 
			statement = new BreakStatement(); 
		} else if (la.kind == 61) {
			lexer.NextToken();
			Expect(11);

#line  1523 "cs.ATG" 
			statement = new ContinueStatement(); 
		} else if (la.kind == 78) {
			GotoStatement(
#line  1524 "cs.ATG" 
out statement);
		} else if (
#line  1526 "cs.ATG" 
IsYieldStatement()) {
			Expect(132);
			if (la.kind == 101) {
				lexer.NextToken();
				Expr(
#line  1527 "cs.ATG" 
out expr);

#line  1527 "cs.ATG" 
				statement = new YieldStatement(new ReturnStatement(expr)); 
			} else if (la.kind == 53) {
				lexer.NextToken();

#line  1528 "cs.ATG" 
				statement = new YieldStatement(new BreakStatement()); 
			} else SynErr(197);
			Expect(11);
		} else if (la.kind == 101) {
			lexer.NextToken();
			if (StartOf(6)) {
				Expr(
#line  1531 "cs.ATG" 
out expr);
			}
			Expect(11);

#line  1531 "cs.ATG" 
			statement = new ReturnStatement(expr); 
		} else if (la.kind == 112) {
			lexer.NextToken();
			if (StartOf(6)) {
				Expr(
#line  1532 "cs.ATG" 
out expr);
			}
			Expect(11);

#line  1532 "cs.ATG" 
			statement = new ThrowStatement(expr); 
		} else if (StartOf(6)) {
			StatementExpr(
#line  1535 "cs.ATG" 
out statement);
			while (!(la.kind == 0 || la.kind == 11)) {SynErr(198); lexer.NextToken(); }
			Expect(11);
		} else if (la.kind == 114) {
			TryStatement(
#line  1538 "cs.ATG" 
out statement);
		} else if (la.kind == 86) {
			lexer.NextToken();
			Expect(20);
			Expr(
#line  1541 "cs.ATG" 
out expr);
			Expect(21);
			EmbeddedStatement(
#line  1542 "cs.ATG" 
out embeddedStatement);

#line  1542 "cs.ATG" 
			statement = new LockStatement(expr, embeddedStatement); 
		} else if (la.kind == 121) {

#line  1545 "cs.ATG" 
			Statement resourceAcquisitionStmt = null; 
			lexer.NextToken();
			Expect(20);
			ResourceAcquisition(
#line  1547 "cs.ATG" 
out resourceAcquisitionStmt);
			Expect(21);
			EmbeddedStatement(
#line  1548 "cs.ATG" 
out embeddedStatement);

#line  1548 "cs.ATG" 
			statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement); 
		} else if (la.kind == 119) {
			lexer.NextToken();
			Block(
#line  1551 "cs.ATG" 
out embeddedStatement);

#line  1551 "cs.ATG" 
			statement = new UnsafeStatement(embeddedStatement); 
		} else if (la.kind == 74) {
			lexer.NextToken();
			Expect(20);
			Type(
#line  1554 "cs.ATG" 
out type);

#line  1554 "cs.ATG" 
			if (type == null || type.PointerNestingLevel == 0) Error("can only fix pointer types");
			List<VariableDeclaration> pointerDeclarators = new List<VariableDeclaration>(1);
			
			Identifier();

#line  1557 "cs.ATG" 
			string identifier = t.val; 
			Expect(3);
			Expr(
#line  1558 "cs.ATG" 
out expr);

#line  1558 "cs.ATG" 
			pointerDeclarators.Add(new VariableDeclaration(identifier, expr)); 
			while (la.kind == 14) {
				lexer.NextToken();
				Identifier();

#line  1560 "cs.ATG" 
				identifier = t.val; 
				Expect(3);
				Expr(
#line  1561 "cs.ATG" 
out expr);

#line  1561 "cs.ATG" 
				pointerDeclarators.Add(new VariableDeclaration(identifier, expr)); 
			}
			Expect(21);
			EmbeddedStatement(
#line  1563 "cs.ATG" 
out embeddedStatement);

#line  1563 "cs.ATG" 
			statement = new FixedStatement(type, pointerDeclarators, embeddedStatement); 
		} else SynErr(199);

#line  1565 "cs.ATG" 
		if (statement != null) {
		statement.StartLocation = startLocation;
		statement.EndLocation = t.EndLocation;
		}
		
	}