public override void visit(while_node wn)
        {
            ProcessNode(wn.statements);
            var gt1 = new goto_statement(newLabelName());
            var gt2 = new goto_statement(newLabelName());
            var gt3 = new goto_statement(newLabelName());

            var if0 = new if_node(wn.expr, gt1, null);
            var lb3 = new labeled_statement(gt3.label, if0);
            var lb1 = new labeled_statement(gt1.label, wn.statements);
            var lb2 = new labeled_statement(gt2.label, new empty_statement());

            var stl = new statement_list(lb3, gt2, lb1, gt3, lb2);

            Replace(wn, stl);
            // в declarations ближайшего блока добавить описание labels
            block bl = listNodes.FindLast(x => x is block) as block;

            var ld = new label_definitions(gt1.label, gt2.label, gt3.label);

            bl.defs.Add(ld);
        }
Esempio n. 2
0
 public override void visit(goto_statement _goto_statement)
 {
 }
 public override void visit(goto_statement gt)
 {
     // Empty
 }
Esempio n. 4
0
 public virtual void visit(goto_statement _goto_statement)
 {
     DefaultVisit(_goto_statement);
 }
Esempio n. 5
0
		public virtual void post_do_visit(goto_statement _goto_statement)
		{
		}
Esempio n. 6
0
		public override void visit(goto_statement _goto_statement)
		{
			DefaultVisit(_goto_statement);
			pre_do_visit(_goto_statement);
			visit(goto_statement.label);
			post_do_visit(_goto_statement);
		}
Esempio n. 7
0
 public virtual void visit(goto_statement _goto_statement)
 {
 }
Esempio n. 8
0
 virtual public void goto_statement(goto_statement ast, int indent)
 {
     Write("goto {0}", indent, ast.id.str);
     Semicolon(indent);
 }
Esempio n. 9
0
 private void VisitGoto(goto_statement stmt)
 {
 }
 public ReplaceBreakContinueWithGotoLabelVisitor(goto_statement gotoContinue, goto_statement gotoBreak)
 {
     this.GotoContinue = gotoContinue;
     this.GotoBreak    = gotoBreak;
 }
Esempio n. 11
0
		public virtual void visit(goto_statement _goto_statement)
		{
		}
		public virtual void visit(goto_statement _goto_statement)
		{
			DefaultVisit(_goto_statement);
		}
Esempio n. 13
0
 public override void visit(goto_statement _goto_statement)
 {
     prepare_node(_goto_statement.label, "to");
 }
Esempio n. 14
0
		public override void visit(goto_statement _goto_statement)
		{
			executer.visit(_goto_statement);
			if (_goto_statement.label != null)
				this.visit((dynamic)_goto_statement.label);
			if (_goto_statement.attributes != null)
				this.visit((dynamic)_goto_statement.attributes);
		}
Esempio n. 15
0
 virtual public void goto_statement(goto_statement ast, int indent)
 {
     //        WriteLine("goto {0};", indent, ast.id.str);
 }
Esempio n. 16
0
 public override void visit(goto_statement _goto_statement)
 {
     _goto_statement.label.visit(this);
 }
Esempio n. 17
0
 public virtual void goto_statement(goto_statement ast)
 {
     ast.exitstry = exitstry(ast, AST.leastCommonAncestor(ast.target, ast));
 }