|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcoins.cfront.Evaluator
Evaluator computes constant expressions. All integer constants are processed as long int values.
| Field Summary | |
(package private) int[] |
toSize
|
| Fields inherited from interface coins.ast.TokenId |
AND_E, ANDAND, ARROW, ASM, AUTO, BAD_TOKEN, BREAK, CASE, CAST_OP, CHAR, CHAR_CONST, COND_OP, CONST, CONTINUE, DEFAULT, DIV_E, DO, DOUBLE, DOUBLE_CONST, ELLIPSIS, ELSE, ENUM, EOF, EQ, EXOR_E, EXTERN, FLOAT, FLOAT_CONST, FOR, FUNCALL, GE, GOTO, IDENTIFIER, IF, IGNORE, INDEX_OP, INLINE, INT, INT_CONST, LE, LONG, LONG_CONST, LONG_DOUBLE_CONST, LONGLONG_CONST, LSHIFT, LSHIFT_E, MINUS_E, MINUSMINUS, MOD_E, MUL_E, MUTABLE, NEQ, OR_E, OROR, PLUS_E, PLUSPLUS, PRAGMA, REGISTER, RESTRICT, RETURN, RSHIFT, RSHIFT_E, SHORT, SIGNED, SIZEOF, SKIP_GCC_ASM, SKIP_GCC_ATTRIBUTE, STATIC, STRING_L, STRING_WL, STRUCT, SWITCH, TYPEDEF, TYPEDEF_NAME, UINT_CONST, ULONG_CONST, ULONGLONG_CONST, UNION, UNSIGNED, VOID, VOLATILE, WHILE |
| Fields inherited from interface coins.ast.TypeId |
ARRAY_T, CHAR_T, CONST_T, DOUBLE_T, ELLIPSIS_T, ENUM_BEGIN, ENUM_END, FLOAT_T, FUNCTION_T, INT_T, LONG_DOUBLE_T, LONG_LONG_T, LONG_T, NO_DIMENSION_T, OFFSET_T, POINTER_T, RESTRICT_T, RETURN_T, S_AUTO, S_EXTERN, S_INLINE, S_NONE, S_REGISTER, S_STATIC, SHORT_T, SIGNED_T, SIZE_T, STRUCT_BEGIN, STRUCT_END, UNION_BEGIN, UNION_END, UNSIGNED_T, VOID_T, VOLATILE_T |
| Constructor Summary | |
Evaluator(MachineParam mp)
|
|
| Method Summary | |
ConstantExpr |
applyBinaryOp(Lex lex,
ConstantExpr expr1,
int op,
ConstantExpr expr2)
Constant folding for arithmetic binary expression. |
ConstantExpr |
applyUnaryOp(Lex lex,
int op,
ConstantExpr expr)
Constant folding for arithmetic unary expression. |
ConstantExpr |
cast(Lex lex,
ConstantExpr expr,
EncodedType etype)
Do constant folding by casting the constant expression expr to the type shown by etype. |
ConstantExpr |
make(double value)
|
ConstantExpr |
make(double value,
byte[] type)
|
ConstantExpr |
make(double value,
char type)
Make floating constant expression. |
ConstantExpr |
make(double value,
EncodedType type)
|
ConstantExpr |
make(long value)
|
ConstantExpr |
make(long value,
byte[] type)
|
ConstantExpr |
make(long value,
char sign,
char type)
Make integer constant expression. |
ConstantExpr |
make(long value,
EncodedType type)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
final int[] toSize
| Constructor Detail |
public Evaluator(MachineParam mp)
| Method Detail |
public ConstantExpr make(long value)
public ConstantExpr make(long value,
byte[] type)
public ConstantExpr make(long value,
EncodedType type)
public ConstantExpr make(long value,
char sign,
char type)
public ConstantExpr make(double value)
public ConstantExpr make(double value,
byte[] type)
public ConstantExpr make(double value,
EncodedType type)
public ConstantExpr make(double value,
char type)
public ConstantExpr cast(Lex lex,
ConstantExpr expr,
EncodedType etype)
throws ParseError
ParseError
public ConstantExpr applyUnaryOp(Lex lex,
int op,
ConstantExpr expr)
throws ParseError
ParseError
public ConstantExpr applyBinaryOp(Lex lex,
ConstantExpr expr1,
int op,
ConstantExpr expr2)
throws ParseError
ParseError
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||