@Override public boolean visit(IntLiteral intLiteral, BlockScope scope) { intLiteral.computeConstant(); CtLiteral<Integer> l = factory.Code().createLiteral(intLiteral.constant.intValue()); context.enter(l, intLiteral); return true; }
@Override public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) { doubleLiteral.computeConstant(); context.enter(factory.Code().createLiteral(doubleLiteral.constant.doubleValue()), doubleLiteral); return true; }
@Override public boolean visit(FloatLiteral floatLiteral, BlockScope scope) { floatLiteral.computeConstant(); context.enter(factory.Code().createLiteral(floatLiteral.constant.floatValue()), floatLiteral); return true; }
public static final Constant computeConstantOperationAND_AND(Constant left, int leftId, Constant right, int rightId) { return BooleanConstant.fromValue(left.booleanValue() && right.booleanValue()); }
environment = getLibraryAccess(); CompilerOptions compilerOptions = new CompilerOptions(this.options); compilerOptions.parseLiteralExpressionsAsConstants = false;
@Override public boolean visit(CharLiteral charLiteral, BlockScope scope) { charLiteral.computeConstant(); context.enter(factory.Code().createLiteral(charLiteral.constant.charValue()), charLiteral); return true; }
@Override public boolean visit(LongLiteral longLiteral, BlockScope scope) { longLiteral.computeConstant(); context.enter(factory.Code().createLiteral(longLiteral.constant.longValue()), longLiteral); return true; }
/** * Initializing the compiler options with external settings * @param settings */ public CompilerOptions(Map<String, String> settings){ resetDefaults(); if (settings != null) { set(settings); } }
public static Constant fromValue(long value) { if (value == 0L) { return ZERO; } else if (value == Long.MIN_VALUE) { return MIN_VALUE; } return new LongConstant(value); }
public void computeConstant() { //The source is a char[3] first and last char are ' //This is true for both regular char AND unicode char //BUT not for escape char like '\b' which are char[4].... this.constant = CharConstant.fromValue(this.value); }
public LongLiteralMinValue(char[] token, char[] reducedForm, int start, int end) { super(token, reducedForm, start, end); this.constant = LongConstant.fromValue(Long.MIN_VALUE); } public void computeConstant() {
/** * Constructor with initial irritant set */ public IrritantSet(IrritantSet other) { initialize(other); }
public static final Constant computeConstantOperationOR_OR(Constant left, int leftId, Constant right, int rightId) { return BooleanConstant.fromValue(left.booleanValue() || right.booleanValue()); }
public static Constant fromValue(long value) { if (value == 0L) { return ZERO; } else if (value == Long.MIN_VALUE) { return MIN_VALUE; } return new LongConstant(value); }
public static final Constant computeConstantOperationAND_AND(Constant left, int leftId, Constant right, int rightId) { return BooleanConstant.fromValue(left.booleanValue() && right.booleanValue()); }
public static final Constant computeConstantOperationOR_OR(Constant left, int leftId, Constant right, int rightId) { return BooleanConstant.fromValue(left.booleanValue() || right.booleanValue()); }
public static final Constant computeConstantOperationAND_AND(Constant left, int leftId, Constant right, int rightId) { return BooleanConstant.fromValue(left.booleanValue() && right.booleanValue()); }
public static final Constant computeConstantOperationOR_OR(Constant left, int leftId, Constant right, int rightId) { return BooleanConstant.fromValue(left.booleanValue() || right.booleanValue()); }