5 public class StandardCodeWriter implements CodeWriter {
7 boolean linestarted = false;
9 java.io.PrintWriter output;
10 Stack symboltables = new Stack();
11 InvariantValue ivalue;
13 public StandardCodeWriter(java.io.PrintWriter output) { this.output = output; }
15 public void startblock() {
20 public void endblock() {
25 public void indent() {
29 public void unindent() {
33 private void doindent() {
34 for (int i = 0; i < indent; i++) {
40 public void outputline(String s) {
49 public void output(String s) {
57 public void pushSymbolTable(SymbolTable st) {
58 symboltables.push(st);
61 public SymbolTable popSymbolTable() {
62 return (SymbolTable) symboltables.pop();
65 public SymbolTable getSymbolTable() {
66 if (symboltables.empty()) {
67 throw new IRException();
69 return (SymbolTable) symboltables.peek();
72 public InvariantValue getInvariantValue() {
76 public void setInvariantValue(InvariantValue iv) {