Class LiteralFolding
- java.lang.Object
-
- org.benf.cfr.reader.bytecode.analysis.parse.literal.LiteralFolding
-
public class LiteralFolding extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description LiteralFolding()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.Double
computeLiteral(double l, double r, ArithOp op)
private static java.lang.Double
computeLiteral(double l, ArithOp op)
private static java.lang.Float
computeLiteral(float l, float r, ArithOp op)
private static java.lang.Float
computeLiteral(float l, ArithOp op)
private static java.lang.Integer
computeLiteral(int l, int r, ArithOp op)
private static java.lang.Integer
computeLiteral(int l, ArithOp op)
private static java.lang.Long
computeLiteral(long l, long r, ArithOp op)
private static java.lang.Long
computeLiteral(long l, ArithOp op)
private static TypedLiteral
computeLiteral(RawJavaType type, TypedLiteral l, ArithOp op)
private static TypedLiteral
computeLiteral(RawJavaType type, TypedLiteral l, TypedLiteral r, ArithOp op)
static Literal
foldArithmetic(RawJavaType returnType, Literal l, ArithOp op)
static Literal
foldArithmetic(RawJavaType returnType, Literal l, Literal r, ArithOp op)
Fold an arithmetic operations.static Literal
foldCast(Literal val, RawJavaType returnType)
private static TypedLiteral
getCast(TypedLiteral val, RawJavaType fromType, RawJavaType returnType)
private static RawJavaType
getRawType(Literal l)
-
-
-
Method Detail
-
foldArithmetic
public static Literal foldArithmetic(RawJavaType returnType, Literal l, Literal r, ArithOp op)
Fold an arithmetic operations. Anything that may fail at runtime must return null.
-
computeLiteral
private static TypedLiteral computeLiteral(RawJavaType type, TypedLiteral l, TypedLiteral r, ArithOp op)
-
computeLiteral
private static java.lang.Double computeLiteral(double l, double r, ArithOp op)
-
computeLiteral
private static java.lang.Float computeLiteral(float l, float r, ArithOp op)
-
computeLiteral
private static java.lang.Long computeLiteral(long l, long r, ArithOp op)
-
computeLiteral
private static java.lang.Integer computeLiteral(int l, int r, ArithOp op)
-
foldArithmetic
public static Literal foldArithmetic(RawJavaType returnType, Literal l, ArithOp op)
-
computeLiteral
private static TypedLiteral computeLiteral(RawJavaType type, TypedLiteral l, ArithOp op)
-
computeLiteral
private static java.lang.Double computeLiteral(double l, ArithOp op)
-
computeLiteral
private static java.lang.Float computeLiteral(float l, ArithOp op)
-
computeLiteral
private static java.lang.Long computeLiteral(long l, ArithOp op)
-
computeLiteral
private static java.lang.Integer computeLiteral(int l, ArithOp op)
-
foldCast
public static Literal foldCast(Literal val, RawJavaType returnType)
-
getCast
private static TypedLiteral getCast(TypedLiteral val, RawJavaType fromType, RawJavaType returnType)
-
getRawType
private static RawJavaType getRawType(Literal l)
-
-