Exemplo n.º 1
0
 public String toString() {
   if (declaration != null) {
     return declaration.toString() + "\n" + statement.toString();
   } else {
     return statement.toString();
   }
 }
Exemplo n.º 2
0
 public void printWithLabels() {
   System.out.println("Input Program with labels added:");
   if (declaration != null) {
     System.out.println(declaration.toString());
   }
   if (statement != null) {
     statement.printWithLabels(1);
   }
   System.out.println();
 }