Push() public method

public Push ( ) : string
return string
Beispiel #1
0
        public override void WhileCondition()
        {
            //We have the result of evaluating the condition on the stack.
            //If the result was 0, we should jump to the end label; otherwise,
            //we continue with the loop body from here.

            Output.WriteLine("  if (__POP() == 0) goto {0};", _endWhileLabels.Push());
        }
Beispiel #2
0
        public override void BeginIf()
        {
            //We have the result of evaluating the condition on the stack.
            //If the result was 0, we should jump to the else label; otherwise,
            //we continue with the if statement body from here.

            Output.WriteLine("  if (__POP() == 0) goto {0};", _elseLabels.Push());
        }
Beispiel #3
0
 public override void PossibleElse()
 {
     Output.WriteLine("  goto {0};", _endIfLabels.Push());
     Output.WriteLine("{0}:", _elseLabels.Pop());
 }
Beispiel #4
0
 public override void BeginWhile()
 {
     Output.WriteLine("{0}:", _beginWhileLabels.Push());
 }