Exemplo n.º 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 ();
		}
Exemplo n.º 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;
 }
Exemplo n.º 3
0
 public void Accept(WhileStatement whileStmt)
 {
     whileStmt.Visit (functionCompiler);
 }
Exemplo n.º 4
0
		public override void Accept (WhileStatement whileStmt)
		{
			errorLog.AddError (ErrorType.ParserError, whileStmt.Location,
				"statement can not exist inside pattern!");
		}
Exemplo n.º 5
0
 public virtual void Accept(WhileStatement whileStmt)
 {
 }
Exemplo n.º 6
0
 public void Accept(WhileStatement whileStmt)
 {
     whileStmt.VisitChildren (this);
 }
Exemplo n.º 7
0
 public void Accept(WhileStatement whileStmt)
 {
     errorLog.AddError (ErrorType.ParserError, whileStmt.Location,
         "Statement not allowed outside function body!");
 }