1 24 25 package org.aspectj.compiler.base.ast; 26 27 import org.aspectj.compiler.base.FlowCheckerPass; 28 import org.aspectj.compiler.base.JavaCompiler; 29 import org.aspectj.compiler.base.CodeWriter; 30 import java.io.IOException ; 31 32 import java.util.*; 33 34 import org.aspectj.compiler.base.bcg.CodeBuilder; 35 import org.aspectj.compiler.base.bcg.Label; 36 37 41 public class LogNotOpExpr extends UnopExpr { 42 43 protected LiteralExpr halfFold(Type type, LiteralExpr lit) { 44 return type.foldLogNotOp(lit); 45 } 46 47 protected Type discoverType() { 48 if (! getRand1().getType().isBoolean()) { 49 showOperatorTypeError(getRand1().getType()); 50 } 51 return getTypeManager().booleanType; 52 } 53 54 protected Type getLiftType() { 55 return getType(); 56 } 57 58 61 public void walkFlow(FlowCheckerPass w) { 62 w.processBoolean(getRand1()); 63 FlowCheckerPass.Vars p1 = w.getVars(); 64 65 w.setVars(p1.getFalse(), p1.getTrue()); 66 } 67 68 71 public void normalizeFlow(FlowCheckerPass w) { 72 } 73 74 protected void cgTest(CodeBuilder cb, Label tdest, Label fdest) { 77 getRand1().cgTest(cb, fdest, tdest); 78 } 79 protected void cgValue(CodeBuilder cb) { 80 getRand1().cgValue(cb); 81 getTypeManager().booleanType.emitLogNot(cb); 82 } 83 84 86 public LogNotOpExpr(SourceLocation location, String _op, Expr _rand1) { 87 super(location, _op, _rand1); 88 89 } 90 protected LogNotOpExpr(SourceLocation source) { 91 super(source); 92 } 93 94 public ASTObject copyWalk(CopyWalker walker) { 95 LogNotOpExpr ret = new LogNotOpExpr(getSourceLocation()); 96 ret.preCopy(walker, this); 97 ret.op = op; 98 if (rand1 != null) ret.setRand1( (Expr)walker.process(rand1) ); 99 return ret; 100 } 101 102 103 public String getDefaultDisplayName() { 104 return "LogNotOpExpr(op: "+op+")"; 105 } 106 107 } 109 | Popular Tags |