Change tabbing for everything....
[IRC.git] / Robust / src / IR / Tree / BlockNode.java
index 47ebb1f5245ff2b52771f7813202e209916928b7..297bbc34b8dc8428024ad3a533f99ce8b33069b6 100644 (file)
@@ -3,82 +3,82 @@ import java.util.Vector;
 import IR.*;
 
 public class BlockNode extends TreeNode {
-    Vector blockstatements;
-    int printStyle=0;
-    protected SymbolTable table;
+  Vector blockstatements;
+  int printStyle=0;
+  protected SymbolTable table;
 
-    public final static int NORMAL=0;
-    public final static int NOBRACES=1;
-    public final static int EXPRLIST=2;
-    
-    public BlockNode() {
-       blockstatements=new Vector();
-       table=new SymbolTable();
-    }
+  public final static int NORMAL=0;
+  public final static int NOBRACES=1;
+  public final static int EXPRLIST=2;
 
-    public SymbolTable getVarTable() {
-       return table;
-    }
+  public BlockNode() {
+    blockstatements=new Vector();
+    table=new SymbolTable();
+  }
 
-    public void addBlockStatement(BlockStatementNode bsn) {
-       blockstatements.add(bsn);
-    }
+  public SymbolTable getVarTable() {
+    return table;
+  }
 
-    public void addFirstBlockStatement(BlockStatementNode bsn) {
-       blockstatements.insertElementAt(bsn,0);
-    }
+  public void addBlockStatement(BlockStatementNode bsn) {
+    blockstatements.add(bsn);
+  }
 
-    public void setStyle(int style) {
-       printStyle=style;
-    }
+  public void addFirstBlockStatement(BlockStatementNode bsn) {
+    blockstatements.insertElementAt(bsn,0);
+  }
 
-    public int size() {
-       return blockstatements.size();
-    }
+  public void setStyle(int style) {
+    printStyle=style;
+  }
 
-    public BlockStatementNode get(int i) {
-       return (BlockStatementNode) blockstatements.get(i);
-    }
+  public int size() {
+    return blockstatements.size();
+  }
 
-    public String printNode(int indent) {
-       if (printStyle==NORMAL) {
-           String st="{\n";
-           for(int i=0;i<blockstatements.size();i++) {
-               BlockStatementNode bsn=(BlockStatementNode)blockstatements.get(i);
-               st+=printSpace(indent+INDENT)+bsn.printNode(indent+INDENT);
-               if (!((bsn instanceof SubBlockNode)||
-                     (bsn instanceof LoopNode)||
-                     (bsn instanceof IfStatementNode)))
-                   st+=";\n";
-               if (bsn instanceof IfStatementNode)
-                   st+="\n";
-           }
-           st+=printSpace(indent)+"}";
-           return st;
-       } else if (printStyle==NOBRACES) {
-           String st="";
-           for(int i=0;i<blockstatements.size();i++) {
-               BlockStatementNode bsn=(BlockStatementNode)blockstatements.get(i);
-               st+=printSpace(indent)+bsn.printNode(indent);
-               if (!((bsn instanceof SubBlockNode)||
-                     (bsn instanceof LoopNode)||
-                     (bsn instanceof IfStatementNode)))
-                   st+=";";
-           }
-           return st;
-       } else if (printStyle==EXPRLIST) {
-           String st="";
-           for(int i=0;i<blockstatements.size();i++) {
-               BlockStatementNode bsn=(BlockStatementNode)blockstatements.get(i);
-               st+=bsn.printNode(0);
-               if ((i+1)!=blockstatements.size())
-                   st+=", ";
-           }
-           return st;
-       } else throw new Error();
-    }
-    
-    public int kind() {
-       return Kind.BlockNode;
-    }
+  public BlockStatementNode get(int i) {
+    return (BlockStatementNode) blockstatements.get(i);
+  }
+
+  public String printNode(int indent) {
+    if (printStyle==NORMAL) {
+      String st="{\n";
+      for(int i=0; i<blockstatements.size(); i++) {
+       BlockStatementNode bsn=(BlockStatementNode)blockstatements.get(i);
+       st+=printSpace(indent+INDENT)+bsn.printNode(indent+INDENT);
+       if (!((bsn instanceof SubBlockNode)||
+             (bsn instanceof LoopNode)||
+             (bsn instanceof IfStatementNode)))
+         st+=";\n";
+       if (bsn instanceof IfStatementNode)
+         st+="\n";
+      }
+      st+=printSpace(indent)+"}";
+      return st;
+    } else if (printStyle==NOBRACES) {
+      String st="";
+      for(int i=0; i<blockstatements.size(); i++) {
+       BlockStatementNode bsn=(BlockStatementNode)blockstatements.get(i);
+       st+=printSpace(indent)+bsn.printNode(indent);
+       if (!((bsn instanceof SubBlockNode)||
+             (bsn instanceof LoopNode)||
+             (bsn instanceof IfStatementNode)))
+         st+=";";
+      }
+      return st;
+    } else if (printStyle==EXPRLIST) {
+      String st="";
+      for(int i=0; i<blockstatements.size(); i++) {
+       BlockStatementNode bsn=(BlockStatementNode)blockstatements.get(i);
+       st+=bsn.printNode(0);
+       if ((i+1)!=blockstatements.size())
+         st+=", ";
+      }
+      return st;
+    } else throw new Error();
+  }
+
+  public int kind() {
+    return Kind.BlockNode;
+  }
 }