|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttip.analysis.AnalysisAdapter
tip.analysis.DepthFirstAdapter
tip.cfg.cfa.Normalization
public class Normalization
Constructor Summary | |
---|---|
Normalization()
|
Method Summary | |
---|---|
void |
caseABlock(ABlock node)
Handles blocks of statements. |
void |
caseAIfThenElseStm(AIfThenElseStm node)
Handles if-then-else statements. |
void |
caseAIfThenStm(AIfThenStm node)
Handles if-then statements. |
void |
caseAWhileStm(AWhileStm node)
Handles while statements. |
void |
inABody(ABody node)
Clears the list of new identifiers for this body. |
void |
inAReturnStm(AReturnStm node)
Normalizes return statements: S -> return E : E ! |
void |
inAAssignPtrStm(AAssignPtrStm node)
Normalizes pointer assignments: S -> *E1 = E2 : E1 ! |
void |
outABody(ABody node)
Add all new identifiers to a ADeclStm in the start of the body. |
void |
outADerefExp(ADerefExp node)
Normalizes deref expressions: E -> *E1 : E \notin S -> id = E => S -> x = *E1 E -> x |
void |
outAFunctionCallExp(AFunctionCallExp node)
Normalizes function call expressions: E -> f(E1,... |
void |
outAMallocExp(AMallocExp node)
Normalizes malloc expressions: E -> malloc : E \notin S -> id = E => S -> x = malloc E -> x |
void |
outAPointerExp(APointerExp node)
Normalizes pointer expressions: E -> &id : E \notin S -> id1 = &id2 => S -> x = &id2 E -> x |
Methods inherited from class tip.analysis.AnalysisAdapter |
---|
caseEOF, caseTAnd, caseTAssign, caseTComma, caseTCommentBlock, caseTCommentSingle, caseTDiv, caseTElse, caseTEq, caseTGt, caseTIdentifier, caseTIf, caseTInput, caseTIntegerConst, caseTLBrace, caseTLPar, caseTMalloc, caseTMinus, caseTNull, caseTOutput, caseTPlus, caseTRBrace, caseTReturn, caseTRPar, caseTSemicolon, caseTStar, caseTVar, caseTWhile, caseTWhiteSpace, defaultNode, defaultToken, getIn, getOut, setIn, setOut |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Normalization()
Method Detail |
---|
public void caseABlock(ABlock node)
caseABlock
in interface Analysis
caseABlock
in class DepthFirstAdapter
node
- the current blockpublic void inABody(ABody node)
inABody
in class DepthFirstAdapter
node
- the body nodepublic void outABody(ABody node)
outABody
in class DepthFirstAdapter
node
- the current body nodepublic void outAFunctionCallExp(AFunctionCallExp node)
E -> f(E1,...,En) => x1 = E1; ... xn = En xf = f; r = (xf)(x1,...,xn) E -> r
outAFunctionCallExp
in class DepthFirstAdapter
node
- the current function call expressionpublic void outAPointerExp(APointerExp node)
E -> &id : E \notin S -> id1 = &id2 => S -> x = &id2 E -> x
outAPointerExp
in class DepthFirstAdapter
node
- the current pointer expressionpublic void outADerefExp(ADerefExp node)
E -> *E1 : E \notin S -> id = E => S -> x = *E1 E -> x
outADerefExp
in class DepthFirstAdapter
node
- the current deref expressionpublic void outAMallocExp(AMallocExp node)
E -> malloc : E \notin S -> id = E => S -> x = malloc E -> x
outAMallocExp
in class DepthFirstAdapter
node
- the current malloc expressionpublic void inAAssignPtrStm(AAssignPtrStm node)
S -> *E1 = E2 : E1 != id => S1 -> x = E2 S2 -> y = E1 S -> *y = x S -> *E1 = E2 : E1 = id, E2 != id => S1 -> x = E2 S -> *E1 = x
inAAssignPtrStm
in class DepthFirstAdapter
node
- the current pointer assignmentpublic void inAReturnStm(AReturnStm node)
S -> return E : E != id => S1 -> x = E S -> return x
inAReturnStm
in class DepthFirstAdapter
node
- the current return statementpublic void caseAIfThenStm(AIfThenStm node)
caseAIfThenStm
in interface Analysis
caseAIfThenStm
in class DepthFirstAdapter
node
- the current if-then statementpublic void caseAIfThenElseStm(AIfThenElseStm node)
caseAIfThenElseStm
in interface Analysis
caseAIfThenElseStm
in class DepthFirstAdapter
node
- the current if-then-else statementpublic void caseAWhileStm(AWhileStm node)
caseAWhileStm
in interface Analysis
caseAWhileStm
in class DepthFirstAdapter
node
- the current while statement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |