예제 #1
0
		public override void Accept (WhileStatement whileStmt)
		{
			IodineLabel whileLabel = methodBuilder.CreateLabel ();
			IodineLabel breakLabel = methodBuilder.CreateLabel ();
			breakLabels.Push (breakLabel);
			continueLabels.Push (whileLabel);
			methodBuilder.MarkLabelPosition (whileLabel);
			whileStmt.Condition.Visit (this);
			methodBuilder.EmitInstruction (whileStmt.Condition.Location, Opcode.JumpIfFalse,
				breakLabel);
			whileStmt.Body.Visit (this);
			methodBuilder.EmitInstruction (whileStmt.Body.Location, Opcode.Jump, whileLabel);
			methodBuilder.MarkLabelPosition (breakLabel);
			breakLabels.Pop ();
			continueLabels.Pop ();
		}
예제 #2
0
 private static AstNode ParseWhile(TokenStream stream)
 {
     WhileStatement ret = new WhileStatement (stream.Location);
     stream.Expect (TokenClass.Keyword, "while");
     stream.Expect (TokenClass.OpenParan);
     ret.Add (ParseExpression (stream));
     stream.Expect (TokenClass.CloseParan);
     ret.Add (ParseStatement (stream));
     return ret;
 }
예제 #3
0
 public void Accept(WhileStatement whileStmt)
 {
     whileStmt.Visit (functionCompiler);
 }
예제 #4
0
		public override void Accept (WhileStatement whileStmt)
		{
			errorLog.AddError (ErrorType.ParserError, whileStmt.Location,
				"statement can not exist inside pattern!");
		}
예제 #5
0
 public virtual void Accept(WhileStatement whileStmt)
 {
 }
예제 #6
0
 public void Accept(WhileStatement whileStmt)
 {
     whileStmt.VisitChildren (this);
 }
예제 #7
0
 public void Accept(WhileStatement whileStmt)
 {
     errorLog.AddError (ErrorType.ParserError, whileStmt.Location,
         "Statement not allowed outside function body!");
 }