Example #1
0
    public override void Generate(int begin, int after)
    {
        int Label = EmitterNode.NewLabel();

        _expression.Jumping(0, after);
        _node.EmitLabel(Label);
        _statement.Generate(Label, after);
    }
 public override void Generate(int begin, int after)
 {
     if (_statement1 == NullStatement)
     {
         _statement2.Generate(begin, after);
     }
     else if (_statement2 == NullStatement)
     {
         _statement1.Generate(begin, after);
     }
     else
     {
         int label = _node.NewLabel();
         _statement1.Generate(begin, label);
         _node.EmitLabel(label);
         _statement2.Generate(label, after);
     }
 }
    public override void Generate(int begin, int after)
    {
        int Label1 = EmitterNode.NewLabel();
        int Label2 = EmitterNode.NewLabel();

        _expression.Jumping(0, Label2);
        _node.EmitLabel(Label1);
        _statement1.Generate(Label1, after);
        _node.Emit($"goto L{after}");
        _node.EmitLabel(Label2);
        _statement2.Generate(Label2, after);
    }
Example #4
0
 public override void Generate()
 {
     _a.Generate();
     _b.Generate();
 }
Example #5
0
 public void Generate()
 {
     Statements.Generate();
 }