예제 #1
0
		public virtual object VisitElseIfSection(ElseIfSection elseIfSection, object data) {
			Debug.Assert((elseIfSection != null));
			Debug.Assert((elseIfSection.Condition != null));
			Debug.Assert((elseIfSection.EmbeddedStatement != null));
			elseIfSection.Condition.AcceptVisitor(this, data);
			return elseIfSection.EmbeddedStatement.AcceptVisitor(this, data);
		}
		public virtual object VisitElseIfSection(ElseIfSection elseIfSection, object data) {
			throw new global::System.NotImplementedException("ElseIfSection");
		}
예제 #3
0
		public virtual object VisitElseIfSection(ElseIfSection elseIfSection, object data) {
			Debug.Assert((elseIfSection != null));
			Debug.Assert((elseIfSection.Condition != null));
			Debug.Assert((elseIfSection.EmbeddedStatement != null));
			nodeStack.Push(elseIfSection.Condition);
			elseIfSection.Condition.AcceptVisitor(this, data);
			elseIfSection.Condition = ((Expression)(nodeStack.Pop()));
			nodeStack.Push(elseIfSection.EmbeddedStatement);
			elseIfSection.EmbeddedStatement.AcceptVisitor(this, data);
			elseIfSection.EmbeddedStatement = ((Statement)(nodeStack.Pop()));
			return null;
		}
예제 #4
0
	void IfStatement(out Statement statement) {
		Expression expr = null; Statement embeddedStatement; statement = null;
		Expect(135);
		Location ifStartLocation = t.Location;
		Expr(out expr);
		if (la.kind == 214) {
			Get();
		}
		if (la.kind == 1 || la.kind == 21) {
			EndOfStmt();
			Block(out embeddedStatement);
			IfElseStatement ifStatement = new IfElseStatement(expr, embeddedStatement);
				ifStatement.StartLocation = ifStartLocation;
				Location elseIfStart;

			while (la.kind == 112 || (IsElseIf())) {
				if (IsElseIf()) {
					Expect(111);
					elseIfStart = t.Location;
					Expect(135);
				} else {
					Get();
					elseIfStart = t.Location;
				}
				Expression condition = null; Statement block = null;
				Expr(out condition);
				if (la.kind == 214) {
					Get();
				}
				EndOfStmt();
				Block(out block);
				ElseIfSection elseIfSection = new ElseIfSection(condition, block);
					elseIfSection.StartLocation = elseIfStart;
					elseIfSection.EndLocation = t.Location;
					elseIfSection.Parent = ifStatement;
					ifStatement.ElseIfSections.Add(elseIfSection);

			}
			if (la.kind == 111) {
				Get();
				if (la.kind == 1 || la.kind == 21) {
					EndOfStmt();
				}
				Block(out embeddedStatement);
				ifStatement.FalseStatement.Add(embeddedStatement);

			}
			Expect(113);
			Expect(135);
			ifStatement.EndLocation = t.Location;
				statement = ifStatement;

		} else if (StartOf(44)) {
			IfElseStatement ifStatement = new IfElseStatement(expr);
				ifStatement.StartLocation = ifStartLocation;

			SingleLineStatementList(ifStatement.TrueStatement);
			if (la.kind == 111) {
				Get();
				if (StartOf(44)) {
					SingleLineStatementList(ifStatement.FalseStatement);
				}
			}
			ifStatement.EndLocation = t.Location; statement = ifStatement;
		} else SynErr(310);
	}
예제 #5
0
		public virtual object TrackedVisitElseIfSection(ElseIfSection elseIfSection, object data) {
			return base.VisitElseIfSection(elseIfSection, data);
		}
예제 #6
0
		public sealed override object VisitElseIfSection(ElseIfSection elseIfSection, object data) {
			this.BeginVisit(elseIfSection);
			object result = this.TrackedVisitElseIfSection(elseIfSection, data);
			this.EndVisit(elseIfSection);
			return result;
		}