1 24 25 package org.aspectj.compiler.base.ast; 26 27 import org.aspectj.compiler.base.*; 28 import org.aspectj.compiler.base.JavaCompiler; 29 import org.aspectj.compiler.base.cst.*; 30 31 import org.aspectj.compiler.base.bcg.CodeBuilder; 32 import org.aspectj.compiler.base.bcg.Label; 33 34 37 38 public abstract class Stmt extends ASTObject { 39 40 44 public boolean mustBeLive() { return true; } 45 46 public boolean isBreakable() { return false; } 47 public boolean isContinuable() { return false; } 48 49 public boolean isEmpty() { return false; } 50 51 public void requireBlockStmt() { 52 this.showError("block statement required"); 53 } 54 55 public void requireStmt() { 56 ; 57 } 58 59 62 private boolean completesNormallyFlag; 63 public void setCompletesNormally(boolean b) { completesNormallyFlag = b; } 64 public boolean completesNormally() { return completesNormallyFlag; } 65 66 69 76 final void cgTop(CodeBuilder cb) { 77 registerLocation(cb); 78 cgStmt(cb); 79 if (cb.getStackSize() != 0) { 80 showWarning("Sanity check: stack size is " + cb.getStackSize() + 81 " after stmt " + this); 82 cb.emitStackSize(); 84 cb.setStackSize(0); 85 } 86 } 87 88 protected void registerLocation(CodeBuilder cb) { 90 cb.enterLocation(getSourceLocation()); 91 } 92 93 96 protected void cgStmt(CodeBuilder cb) { 97 throw new RuntimeException ("Invalid statement " + this); 98 } 99 100 102 public Stmt(SourceLocation location) { 103 super(location); 104 105 } 106 107 108 public String getDefaultDisplayName() { 109 return "Stmt()"; 110 } 111 112 } 114 115 116 117 118 119 120 | Popular Tags |