Push() public méthode

public Push ( ) : string
Résultat string
Exemple #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());
        }
Exemple #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());
        }
Exemple #3
0
 public override void PossibleElse()
 {
     Output.WriteLine("  goto {0};", _endIfLabels.Push());
     Output.WriteLine("{0}:", _elseLabels.Pop());
 }
Exemple #4
0
 public override void BeginWhile()
 {
     Output.WriteLine("{0}:", _beginWhileLabels.Push());
 }