public override void VisitWhileStatement (WhileStatement node)
		{
			WriteKeyword ("while");
			WriteSpace ();
			WriteBetweenParenthesis (node.Condition);
			WriteLine ();
			Visit (node.Body);
		}
Example #2
0
			public override void VisitWhileStatement (WhileStatement node)
			{
				switch (state) {
				case State.Initializer:
					if (!VariableMatcher.FindVariableInExpression (variable, node.Condition))
						break;

					state = State.Condition;
					condition = node.Condition;

					var body = node.Body;

					if (body.Statements.Count == 0)
						break;

					Visit (body.Statements [body.Statements.Count - 1]);

					if (!Match)
						break;

					CreateForStatement (body);
					break;
				}

				Continue = false;
			}
		void AddPreTestedLoop (Instruction instruction)
		{
			var loop = new WhileStatement (Pop (), new BlockStatement ());
			AddLoop (instruction, loop, loop.Body);
		}
Example #4
0
		public virtual void VisitWhileStatement (WhileStatement node)
		{
			Visit (node.Condition);
			Visit (node.Body);
		}