|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcoins.casttohir.ToHirC
Convert ASTree(abstruct syntax tree) to HIR-C.
| Field Summary | |
(package private) static byte[] |
astPrototype
|
(package private) static int |
lListNum
|
| 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 |
| 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 |
| Constructor Summary | |
ToHirC(ToHir tohir)
Constructor. |
|
| Method Summary | |
void |
astToHirC(java.io.InputStream stream)
Create ASTree by ast.Parser.read(), and visit ASTree to create corresponding HIR-C. |
void |
atAddressExpr(AddressExpr ast)
Create reference expression. |
void |
atArithBinaryExpr(ArithBinaryExpr ast)
Create arithmetic binary expression. |
void |
atArithUnaryExpr(ArithUnaryExpr ast)
Create arithmetic unary expression. |
void |
atArrayExpr(ArrayExpr ast)
Create array subscript expression. |
void |
atArrayInitializer(ArrayInitializer ast)
At array initializer. |
void |
atAsmExpr(AsmExpr ast)
|
void |
atAssignExpr(AssignExpr ast)
Create assign expression. |
void |
atASTList(ASTList ast)
At AST list. |
void |
atBreakStmnt(BreakStmnt ast)
Create break statement. |
void |
atCallExpr(CallExpr ast)
Create function call expression. |
void |
atCaseLabel(CaseLabel ast)
Create case statement. |
void |
atCastExpr(CastExpr ast)
Create cast expression. |
void |
atCommaExpr(CommaExpr ast)
Create comma expression. |
void |
atCompoundStmnt(CompoundStmnt ast)
At compound statement. |
void |
atConditionalExpr(ConditionalExpr ast)
Create conditional expression. |
void |
atConstantExpr(ConstantExpr ast)
Create constant expression. |
void |
atContinueStmnt(ContinueStmnt ast)
Create continue statement. |
void |
atDeclarator(Declarator ast)
Create symbol and add into symbol table. |
void |
atDeclaratorList(DeclaratorList ast)
At declaration list. |
void |
atDefaultLabel(DefaultLabel ast)
Create default statement. |
void |
atDereferenceExpr(DereferenceExpr ast)
Create dereference expression. |
void |
atDoStmnt(DoStmnt ast)
Create do-while statement. |
void |
atEnum(Enum ast)
Create EnumType and add symTableCurrent. |
void |
atExpressionStmnt(ExpressionStmnt ast)
Create expression statement. |
void |
atForStmnt(ForStmnt ast)
Create for statement. |
void |
atFunction(Function ast)
Create function, and add programRoot. |
void |
atGotoStmnt(GotoStmnt ast)
Create goto statement. |
void |
atIfStmnt(IfStmnt ast)
Create if statement. |
void |
atMemberExpr(MemberExpr ast)
Create member-access expression. |
void |
atNamedLabel(NamedLabel ast)
Create label statement. |
void |
atNullStmnt(NullStmnt ast)
Create null statement. |
void |
atPair(Pair ast)
At Pair. |
void |
atPointerBinaryExpr(PointerBinaryExpr ast)
Create pointer binary expression. |
void |
atPostfixExpr(PostfixExpr ast)
Create postfix expression. |
void |
atPragma(Pragma ast)
atPragma changes Pragma to InfStmt whose inf-body is the String specified in the pragma statement. |
void |
atPrefixExpr(PrefixExpr ast)
Create prefix expression. |
void |
atReturnStmnt(ReturnStmnt ast)
Create return statement. |
void |
atSizeofExpr(SizeofExpr ast)
Create sizeof expression. |
void |
atStringLiteral(StringLiteral ast)
Create string literal expression. |
void |
atStruct(Struct ast)
Create StructType and add to symTableCurrent. |
StructType |
atStructDeclarator(Struct ast)
|
void |
atSwitchStmnt(SwitchStmnt ast)
Create switch statement. |
void |
atUnion(Union ast)
Create UnionType and add symTableCurrent. |
UnionType |
atUnionDeclarator(Union ast)
Create UnionType and add symTableCurrent. |
void |
atVariableExpr(VariableExpr ast)
Create variable expression. |
void |
atWhileStmnt(WhileStmnt ast)
Create while statement. |
protected void |
message(int level,
java.lang.String mes)
Output debug message. |
Exp |
pPromotion(Exp e)
Pointer promotion (selfish naming). |
HIR |
visit(ASTree ast)
Visit ASTree. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
static final byte[] astPrototype
static int lListNum
| Constructor Detail |
public ToHirC(ToHir tohir)
tohir - Offers cooperation with the object of other packages.| Method Detail |
protected void message(int level,
java.lang.String mes)
level - Debug level.mes - Debug message.
public void astToHirC(java.io.InputStream stream)
throws java.io.IOException,
FatalError
stream - Input stream.
java.io.IOException
FatalErrorpublic HIR visit(ASTree ast)
public void atASTList(ASTList ast)
atASTList in interface Visitorast - ASTListpublic void atPragma(Pragma ast)
atPragma in interface Visitorast - Pragma character string contained in the pragma statement.public void atAsmExpr(AsmExpr ast)
atAsmExpr in interface Visitorpublic void atCompoundStmnt(CompoundStmnt ast)
atCompoundStmnt in interface Visitorast - ASTListpublic void atStruct(Struct ast)
atStruct in interface Visitorast - Structpublic StructType atStructDeclarator(Struct ast)
public void atUnion(Union ast)
atUnion in interface Visitorast - Unionpublic UnionType atUnionDeclarator(Union ast)
ast - Unionpublic void atEnum(Enum ast)
atEnum in interface Visitorast - Enumpublic void atDeclarator(Declarator ast)
atDeclarator in interface Visitorast - Declaratorpublic void atDeclaratorList(DeclaratorList ast)
atDeclaratorList in interface Visitorast - DeclaratorListpublic void atArrayInitializer(ArrayInitializer ast)
atArrayInitializer in interface Visitorast - ArrayInitializerpublic void atFunction(Function ast)
atFunction in interface Visitorast - Functionpublic void atPair(Pair ast)
atPair in interface Visitorast - Pairpublic void atAddressExpr(AddressExpr ast)
atAddressExpr in interface Visitorast - AddressExprpublic void atArithBinaryExpr(ArithBinaryExpr ast)
atArithBinaryExpr in interface Visitorast - ArithBinaryExprpublic void atArithUnaryExpr(ArithUnaryExpr ast)
atArithUnaryExpr in interface Visitorast - ArithUnaryExprpublic void atArrayExpr(ArrayExpr ast)
atArrayExpr in interface Visitorast - ArrayExprpublic void atAssignExpr(AssignExpr ast)
atAssignExpr in interface Visitorast - AssignExprpublic void atCallExpr(CallExpr ast)
atCallExpr in interface Visitorast - CallExprpublic void atCastExpr(CastExpr ast)
atCastExpr in interface Visitorast - CastExprpublic void atSizeofExpr(SizeofExpr ast)
atSizeofExpr in interface Visitorast - SizeofExprpublic void atCommaExpr(CommaExpr ast)
atCommaExpr in interface Visitorast - CommaExprpublic void atConditionalExpr(ConditionalExpr ast)
atConditionalExpr in interface Visitorast - ConditionalExprpublic void atConstantExpr(ConstantExpr ast)
atConstantExpr in interface Visitorast - ConstantExprpublic void atDereferenceExpr(DereferenceExpr ast)
atDereferenceExpr in interface Visitorast - DereferenceExprpublic void atMemberExpr(MemberExpr ast)
atMemberExpr in interface Visitorast - MemberExprpublic void atPointerBinaryExpr(PointerBinaryExpr ast)
atPointerBinaryExpr in interface Visitorast - PointerBinaryExprpublic void atPostfixExpr(PostfixExpr ast)
atPostfixExpr in interface Visitorast - PostfixExprpublic void atPrefixExpr(PrefixExpr ast)
atPrefixExpr in interface Visitorast - PrefixExprpublic void atStringLiteral(StringLiteral ast)
atStringLiteral in interface Visitorast - StringLiteralpublic void atVariableExpr(VariableExpr ast)
atVariableExpr in interface Visitorast - VariableExprpublic void atBreakStmnt(BreakStmnt ast)
atBreakStmnt in interface Visitorpublic void atCaseLabel(CaseLabel ast)
atCaseLabel in interface Visitorast - CaseLabelpublic void atContinueStmnt(ContinueStmnt ast)
atContinueStmnt in interface Visitorast - ContinueStmntpublic void atDefaultLabel(DefaultLabel ast)
atDefaultLabel in interface Visitorast - DefaultLabelpublic void atDoStmnt(DoStmnt ast)
atDoStmnt in interface Visitorast - DoStmntpublic void atExpressionStmnt(ExpressionStmnt ast)
atExpressionStmnt in interface Visitorast - ExpressionStmntpublic void atForStmnt(ForStmnt ast)
atForStmnt in interface Visitorast - ForStmntpublic void atGotoStmnt(GotoStmnt ast)
atGotoStmnt in interface Visitorast - GotoStmntpublic void atIfStmnt(IfStmnt ast)
atIfStmnt in interface Visitorast - IfStmntpublic void atNamedLabel(NamedLabel ast)
atNamedLabel in interface Visitorast - NamedLabelpublic void atNullStmnt(NullStmnt ast)
atNullStmnt in interface Visitorast - NullStmntpublic void atReturnStmnt(ReturnStmnt ast)
atReturnStmnt in interface Visitorast - ReturnStmntpublic void atSwitchStmnt(SwitchStmnt ast)
atSwitchStmnt in interface Visitorast - SwitchStmntpublic void atWhileStmnt(WhileStmnt ast)
atWhileStmnt in interface Visitorast - WhileStmntpublic Exp pPromotion(Exp e)
e - Expression which has VectorType/SubpType.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||