|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object
|
+--coins.casttohir.ToHirVisit
|
+--coins.casttohir.ToHirBase
Convert HIR-C to HIR-base.
| フィールドの概要 | |
int |
fDbgLevel
|
protected HIR |
hir
HIR instance (used to create HIR objects). |
protected BlockStmt |
nowBlock
Now processing block (used to create initializer). |
protected Sym |
sym
Sym instance (used to create Sym objects). |
protected ToHir |
toHir
Offers cooperation with the object of other packages. |
| コンストラクタの概要 | |
ToHirBase(ToHir tohir)
Constructor. |
|
| メソッドの概要 | |
protected Exp |
atAdd(Exp e)
At add expression node. |
protected Exp |
atAddAssign(Exp e)
At add-assign expression node. |
protected Exp |
atAddr(Exp e)
At address expression node. |
protected Exp |
atAnd(Exp e)
At and expression node. |
protected Exp |
atAndAssign(Exp e)
At and-assign expression node. |
protected Exp |
atArrow(Exp e)
At arrow expression node. |
protected Exp |
atARShift(Exp e)
At arithmetic R-shift expression node. |
protected Exp |
atAssign(Exp e)
At assign expression node. |
protected void |
atAssignStmt(AssignStmt s)
At assign statement node. |
protected void |
atBlock(BlockStmt s)
At block statement node. |
protected Exp |
atCall(FunctionExp e)
At function call expression node. |
protected Exp |
atCmpEq(Exp e)
At EQ expression node. |
protected Exp |
atCmpGe(Exp e)
At GE expression node. |
protected Exp |
atCmpGt(Exp e)
At GT expression node. |
protected Exp |
atCmpLe(Exp e)
At LE expression node. |
protected Exp |
atCmpLt(Exp e)
At LT expression node. |
protected Exp |
atCmpNe(Exp e)
At NE expression node. |
protected Exp |
atComma(Exp e)
At comma expression node. |
protected Exp |
atConst(ConstNode e)
At constant node. |
protected Exp |
atContents(Exp e)
At indirection expression node. |
protected Exp |
atConv(Exp e)
At cast expression node. |
protected Exp |
atDecay(Exp e)
At decay expression node. |
protected Exp |
atDiv(Exp e)
At div expression node. |
protected Exp |
atDivAssign(Exp e)
At div-assign expression node. |
protected Exp |
atElem(ElemNode e)
At element node. |
protected Exp |
atEqZero(Exp e)
At logical-not expression node. |
protected Exp |
atExpList(ExpListExp e)
At expression list node. |
protected Exp |
atExpRepeat(Exp e)
At expression repeatation node. |
protected void |
atExpStmt(ExpStmt s)
At expression statement node. |
protected void |
atFor(LoopStmt s)
At for statement node. |
protected void |
atIf(IfStmt s)
At if statement node. |
protected Exp |
atIndex(Exp e)
At index expression node. |
protected InfStmt |
atInfStmt(InfStmt pInf)
atInfStmt parses the pragma body in the form of String and change its symbols to instances of Sym (Var, Subp, Label, Const) and items enclosed in parenthesis to IrList changing its elements to Sym, etc. |
protected void |
atJump(JumpStmt s)
At goto statement node. |
protected void |
atLabeledStmt(LabeledStmt s)
At labeled statement node. |
protected Exp |
atLgAnd(Exp e)
At logical-and expression node. |
protected Exp |
atLgOr(Exp e)
At logical-or expression node. |
protected Exp |
atLShift(Exp e)
At L-shift expression node. |
protected Exp |
atLShiftAssign(Exp e)
At L-shift-assign expression node. |
protected Exp |
atMod(Exp e)
At mod expression node. |
protected Exp |
atModAssign(Exp e)
At mod-assign expression node. |
protected Exp |
atMul(Exp e)
At mul expression node. |
protected Exp |
atMulAssign(Exp e)
At mul-assign expression node. |
protected Exp |
atNeg(Exp e)
At negative expression node. |
protected Exp |
atNot(Exp e)
At logical not expression node. |
protected Exp |
atOffset(Exp e)
At offset(difference of address) expression node. |
protected Exp |
atOr(Exp e)
At or expression node. |
protected Exp |
atOrAssign(Exp e)
At or-assign expression node. |
protected Exp |
atPost(int op,
Exp e)
At post-operator expression node. |
protected Exp |
atPre(int op,
Exp e)
At pre-operator expression node. |
protected Exp |
atQual(Exp e)
At member-access expression node. |
protected void |
atReturn(ReturnStmt s)
At return statement node. |
protected Exp |
atRShift(Exp e)
At logical R-shift expression node. |
protected Exp |
atRShiftAssign(Exp e)
At R-shift-assign expression node. |
protected Exp |
atSelect(Exp e)
At selection expression node. |
protected void |
atSetDataStmt(SetDataStmt s)
At datacode statement node. |
protected Exp |
atSub(Exp e)
At sub expression node. |
protected Exp |
atSubAssign(Exp e)
At sub-assign expression node. |
protected Exp |
atSubp(SubpNode e)
At function node. |
protected SubpDefinition |
atSubpDefinition(SubpDefinition s)
At block statement node. |
protected Exp |
atSubs(Exp e)
At subscript expression node. |
protected void |
atSwitch(SwitchStmt s)
At switch statement node. |
protected Exp |
atUndecay(Exp e)
At undecay expression node. |
protected void |
atUntil(LoopStmt s)
At do-while statement node. |
protected Exp |
atVar(VarNode e)
At variable node. |
protected void |
atWhile(LoopStmt s)
At while statement node. |
protected Exp |
atXor(Exp e)
At xor expression node. |
protected Exp |
atXorAssign(Exp e)
At xor-assign expression node. |
protected boolean |
inInitBlock()
Return true if now processing in the initialization block. |
protected void |
message(int level,
java.lang.String mes)
Output debug message. |
(パッケージプライベート) IrList |
processPragmaItem(ParseString pParseString,
java.lang.String pNextItem,
IrList pList)
|
(パッケージプライベート) Exp |
visitExp(Exp e)
|
protected void |
visitExpAsExpStmt(Exp e)
Do the same as visitExpAsSequencePoint but this is for an expression whose value is not used (in such cases as procedure call (ExpStmt), non-last expression of comma expression (x of (x, y)), etc.). |
protected Exp |
visitExpAsSequencePoint(Exp e)
Visit the expression e. |
void |
visitProgram()
Visit HIR program tree. |
(パッケージプライベート) void |
visitProgram(Program program)
Visit HIR program tree. |
(パッケージプライベート) void |
visitStmt(Stmt s)
Call appropriate method by operator of statement node. |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
protected final ToHir toHir
protected final HIR hir
protected final Sym sym
protected BlockStmt nowBlock
public final int fDbgLevel
| コンストラクタの詳細 |
public ToHirBase(ToHir tohir)
tohir - Offers cooperation with the object of other packages.| メソッドの詳細 |
protected void message(int level,
java.lang.String mes)
ToHirVisit 内の messagelevel - Debug level.mes - Debug message.protected void atIf(IfStmt s)
ToHirVisit 内の atIfs - IfStmtprotected void atWhile(LoopStmt s)
ToHirVisit 内の atWhiles - LoopStmtprotected void atFor(LoopStmt s)
ToHirVisit 内の atFors - LoopStmtprotected void atUntil(LoopStmt s)
ToHirVisit 内の atUntils - LoopStmtprotected void atSwitch(SwitchStmt s)
ToHirVisit 内の atSwitchs - SwitchStmtprotected void atReturn(ReturnStmt s)
ToHirVisit 内の atReturns - ReturnStmtprotected void atExpStmt(ExpStmt s)
ToHirVisit 内の atExpStmts - ExpStmtprotected void atSetDataStmt(SetDataStmt s)
ToHirVisit 内の atSetDataStmts - SetDataStmtprotected Exp visitExpAsSequencePoint(Exp e)
e - Expression to be visited.
protected void visitExpAsExpStmt(Exp e)
e - Expression to be visited.protected Exp atSubs(Exp e)
ToHirVisit 内の atSubse - Exp
protected Exp atCall(FunctionExp e)
ToHirVisit 内の atCalle - Exp
protected Exp atAdd(Exp e)
ToHirVisit 内の atAdde - Exp
protected Exp atSub(Exp e)
ToHirVisit 内の atSube - Exp
protected Exp atMul(Exp e)
ToHirVisit 内の atMule - Exp
protected Exp atDiv(Exp e)
ToHirVisit 内の atDive - Exp
protected Exp atMod(Exp e)
ToHirVisit 内の atMode - Exp
protected Exp atAnd(Exp e)
ToHirVisit 内の atAnde - Exp
protected Exp atOr(Exp e)
ToHirVisit 内の atOre - Exp
protected Exp atXor(Exp e)
ToHirVisit 内の atXore - Exp
protected Exp atCmpEq(Exp e)
1) a==b; => a; b; 2) x = a==b; => if(a==b) x=1; else x=0; 3) x + a==b; => if(a==b) tmp=1; else tmp=0; x+tmp;
ToHirVisit 内の atCmpEqe - Exp
protected Exp atCmpNe(Exp e)
ToHirVisit 内の atCmpNee - Exp
protected Exp atCmpGt(Exp e)
ToHirVisit 内の atCmpGte - Exp
protected Exp atCmpGe(Exp e)
ToHirVisit 内の atCmpGee - Exp
protected Exp atCmpLt(Exp e)
ToHirVisit 内の atCmpLte - Exp
protected Exp atCmpLe(Exp e)
ToHirVisit 内の atCmpLee - Exp
protected Exp atLShift(Exp e)
ToHirVisit 内の atLShifte - Exp
protected Exp atRShift(Exp e)
ToHirVisit 内の atRShifte - Exp
protected Exp atARShift(Exp e)
ToHirVisit 内の atARShifte - Exp
protected Exp atNot(Exp e)
ToHirVisit 内の atNote - Exp
protected Exp atNeg(Exp e)
ToHirVisit 内の atNege - Exp
protected Exp atAssign(Exp e)
At first, visit the left operand and immediately store its result
as left operand. (The left operand may be refered in the process
of visiting the right operand.)
Second, visit the right operand and then do following operations
according to its returned expression:
1) If same to the left operand, return the left operand;
2) If null, return the left operand because an AssignStmt is already
sweped out.
3) If not null, sweep out AssignStmt during which do following operations
according to parent type:
a) If the parent is null, return null after sweeping out AssignStmt.
b) If the parent is not null, return expression with less overhead
by doing following transformation:
i) a = b[i] --> a = b[i]; (return the left side a)
ii) a[i] = 1 --> a[i] = 1; (return the right side 1)
iii) a[i] = b[j] --> t=b[j]; a[i]=t; (return the temporal variable t)
ToHirVisit 内の atAssigne - Exp to be visited.
protected Exp atOffset(Exp e)
ToHirVisit 内の atOffsete - Exp
protected Exp atLgAnd(Exp e)
ToHirVisit 内の atLgAnde - Exp
protected Exp atLgOr(Exp e)
ToHirVisit 内の atLgOre - Exp
protected Exp atSelect(Exp e)
ToHirVisit 内の atSelecte - Exp
protected Exp atComma(Exp e)
ToHirVisit 内の atCommae - Exp
protected Exp atPre(int op,
Exp e)
1) ++v => ( v=v+1, v )
2) ++*p => ( *p=*p+1, *p )
3) ++*(p+j) => ( tmp=p+j, *tmp=*tmp+1, *tmp )
else) ++s.m => ( tmp=&s.m, *tmp=*tmp+1, *tmp )
ToHirVisit 内の atPree - Exp
protected Exp atPost(int op,
Exp e)
ToHirVisit 内の atPoste - Exp
protected Exp atAddAssign(Exp e)
ToHirVisit 内の atAddAssigne - Exp
protected Exp atSubAssign(Exp e)
ToHirVisit 内の atSubAssigne - Exp
protected Exp atMulAssign(Exp e)
ToHirVisit 内の atMulAssigne - Exp
protected Exp atDivAssign(Exp e)
ToHirVisit 内の atDivAssigne - Exp
protected Exp atModAssign(Exp e)
ToHirVisit 内の atModAssigne - Exp
protected Exp atLShiftAssign(Exp e)
ToHirVisit 内の atLShiftAssigne - Exp
protected Exp atRShiftAssign(Exp e)
ToHirVisit 内の atRShiftAssigne - Exp
protected Exp atAndAssign(Exp e)
ToHirVisit 内の atAndAssigne - Exp
protected Exp atOrAssign(Exp e)
ToHirVisit 内の atOrAssigne - Exp
protected Exp atXorAssign(Exp e)
ToHirVisit 内の atXorAssigne - Exp
protected boolean inInitBlock()
public final void visitProgram()
final void visitProgram(Program program)
program - Programfinal void visitStmt(Stmt s)
s - Visited statement.protected void atBlock(BlockStmt s)
s - BlockStmtprotected void atLabeledStmt(LabeledStmt s)
s - LabeledStmtprotected void atAssignStmt(AssignStmt s)
s - AssignStmtprotected void atJump(JumpStmt s)
s - JumpStmtfinal Exp visitExp(Exp e)
protected Exp atConst(ConstNode e)
e - Exp
protected Exp atVar(VarNode e)
e - Exp
protected Exp atSubp(SubpNode e)
e - Exp
protected Exp atElem(ElemNode e)
e - Exp
protected Exp atIndex(Exp e)
e - Exp
protected Exp atQual(Exp e)
e - Exp
protected Exp atArrow(Exp e)
e - Exp
protected Exp atAddr(Exp e)
e - Exp
protected Exp atConv(Exp e)
e - Exp
protected Exp atDecay(Exp e)
e - Exp
protected Exp atUndecay(Exp e)
e - Exp
protected Exp atContents(Exp e)
e - Exp
protected Exp atEqZero(Exp e)
e - Exp
protected Exp atExpList(ExpListExp e)
e - Exp
protected Exp atExpRepeat(Exp e)
e - Exp
protected SubpDefinition atSubpDefinition(SubpDefinition s)
s - BlockStmtprotected InfStmt atInfStmt(InfStmt pInf)
IrList processPragmaItem(ParseString pParseString,
java.lang.String pNextItem,
IrList pList)
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||