tip.analysis
Class AnalysisAdapter

java.lang.Object
  extended by tip.analysis.AnalysisAdapter
All Implemented Interfaces:
Analysis
Direct Known Subclasses:
DepthFirstAdapter, ReversedDepthFirstAdapter

public class AnalysisAdapter
extends Object
implements Analysis

AnalysisAdapter provides a basic implementation of Analysis. case-methods for alternatives are forwarded to the defaultP-method of their production superclass. case-methods for tokens are forwarded to the defaultToken(Token) method, and all default- methods are forwarded to defaultNode(Node).


Constructor Summary
AnalysisAdapter()
           
 
Method Summary
 void caseABinopExp(ABinopExp node)
          Called by the ABinopExp node from ABinopExp#apply(Switch).
 void caseABlock(ABlock node)
          Called by the ABlock node from ABlock#apply(Switch).
 void caseABlockStm(ABlockStm node)
          Called by the ABlockStm node from ABlockStm#apply(Switch).
 void caseABody(ABody node)
          Called by the ABody node from ABody#apply(Switch).
 void caseADeclStm(ADeclStm node)
          Called by the ADeclStm node from ADeclStm#apply(Switch).
 void caseADerefExp(ADerefExp node)
          Called by the ADerefExp node from ADerefExp#apply(Switch).
 void caseADivideBinop(ADivideBinop node)
          Called by the ADivideBinop node from ADivideBinop#apply(Switch).
 void caseAEqBinop(AEqBinop node)
          Called by the AEqBinop node from AEqBinop#apply(Switch).
 void caseAFuncDecl(AFuncDecl node)
          Called by the AFuncDecl node from AFuncDecl#apply(Switch).
 void caseAFunctionCallExp(AFunctionCallExp node)
          Called by the AFunctionCallExp node from AFunctionCallExp#apply(Switch).
 void caseAFunctionPtrCallExp(AFunctionPtrCallExp node)
          Called by the AFunctionPtrCallExp node from AFunctionPtrCallExp#apply(Switch).
 void caseAGtBinop(AGtBinop node)
          Called by the AGtBinop node from AGtBinop#apply(Switch).
 void caseAIfThenElseStm(AIfThenElseStm node)
          Called by the AIfThenElseStm node from AIfThenElseStm#apply(Switch).
 void caseAIfThenStm(AIfThenStm node)
          Called by the AIfThenStm node from AIfThenStm#apply(Switch).
 void caseAInputExp(AInputExp node)
          Called by the AInputExp node from AInputExp#apply(Switch).
 void caseAIntConstExp(AIntConstExp node)
          Called by the AIntConstExp node from AIntConstExp#apply(Switch).
 void caseALocalDecl(ALocalDecl node)
          Called by the ALocalDecl node from ALocalDecl#apply(Switch).
 void caseAMallocExp(AMallocExp node)
          Called by the AMallocExp node from AMallocExp#apply(Switch).
 void caseAMinusBinop(AMinusBinop node)
          Called by the AMinusBinop node from AMinusBinop#apply(Switch).
 void caseANullExp(ANullExp node)
          Called by the ANullExp node from ANullExp#apply(Switch).
 void caseAOutputStm(AOutputStm node)
          Called by the AOutputStm node from AOutputStm#apply(Switch).
 void caseAPlusBinop(APlusBinop node)
          Called by the APlusBinop node from APlusBinop#apply(Switch).
 void caseAPointerExp(APointerExp node)
          Called by the APointerExp node from APointerExp#apply(Switch).
 void caseAProgram(AProgram node)
          Called by the AProgram node from AProgram#apply(Switch).
 void caseAReturnStm(AReturnStm node)
          Called by the AReturnStm node from AReturnStm#apply(Switch).
 void caseATimesBinop(ATimesBinop node)
          Called by the ATimesBinop node from ATimesBinop#apply(Switch).
 void caseAVarExp(AVarExp node)
          Called by the AVarExp node from AVarExp#apply(Switch).
 void caseAWhileStm(AWhileStm node)
          Called by the AWhileStm node from AWhileStm#apply(Switch).
 void caseEOF(EOF token)
          Called by the EOF node from EOF#apply(Switch).
 void caseStart(Start node)
          Called by the Start node from Start#apply(Switch).
 void caseTAnd(TAnd node)
          Called by the TAnd node from TAnd#apply(Switch).
 void caseTAssign(TAssign node)
          Called by the TAssign node from TAssign#apply(Switch).
 void caseTComma(TComma node)
          Called by the TComma node from TComma#apply(Switch).
 void caseTCommentBlock(TCommentBlock node)
          Called by the TCommentBlock node from TCommentBlock#apply(Switch).
 void caseTCommentSingle(TCommentSingle node)
          Called by the TCommentSingle node from TCommentSingle#apply(Switch).
 void caseTDiv(TDiv node)
          Called by the TDiv node from TDiv#apply(Switch).
 void caseTElse(TElse node)
          Called by the TElse node from TElse#apply(Switch).
 void caseTEq(TEq node)
          Called by the TEq node from TEq#apply(Switch).
 void caseTGt(TGt node)
          Called by the TGt node from TGt#apply(Switch).
 void caseTIdentifier(TIdentifier node)
          Called by the TIdentifier node from TIdentifier#apply(Switch).
 void caseTIf(TIf node)
          Called by the TIf node from TIf#apply(Switch).
 void caseTInput(TInput node)
          Called by the TInput node from TInput#apply(Switch).
 void caseTIntegerConst(TIntegerConst node)
          Called by the TIntegerConst node from TIntegerConst#apply(Switch).
 void caseTLBrace(TLBrace node)
          Called by the TLBrace node from TLBrace#apply(Switch).
 void caseTLPar(TLPar node)
          Called by the TLPar node from TLPar#apply(Switch).
 void caseTMalloc(TMalloc node)
          Called by the TMalloc node from TMalloc#apply(Switch).
 void caseTMinus(TMinus node)
          Called by the TMinus node from TMinus#apply(Switch).
 void caseTNull(TNull node)
          Called by the TNull node from TNull#apply(Switch).
 void caseTOutput(TOutput node)
          Called by the TOutput node from TOutput#apply(Switch).
 void caseTPlus(TPlus node)
          Called by the TPlus node from TPlus#apply(Switch).
 void caseTRBrace(TRBrace node)
          Called by the TRBrace node from TRBrace#apply(Switch).
 void caseTReturn(TReturn node)
          Called by the TReturn node from TReturn#apply(Switch).
 void caseTRPar(TRPar node)
          Called by the TRPar node from TRPar#apply(Switch).
 void caseTSemicolon(TSemicolon node)
          Called by the TSemicolon node from TSemicolon#apply(Switch).
 void caseTStar(TStar node)
          Called by the TStar node from TStar#apply(Switch).
 void caseTVar(TVar node)
          Called by the TVar node from TVar#apply(Switch).
 void caseTWhile(TWhile node)
          Called by the TWhile node from TWhile#apply(Switch).
 void caseTWhiteSpace(TWhiteSpace node)
          Called by the TWhiteSpace node from TWhiteSpace#apply(Switch).
 void caseAAssignPtrStm(AAssignPtrStm node)
          Called by the AAssignPtrStm node from AAssignPtrStm#apply(Switch).
 void caseAAssignVarStm(AAssignVarStm node)
          Called by the AAssignVarStm node from AAssignVarStm#apply(Switch).
 void defaultNode(Node node)
          Base case for all nodes.
 void defaultPBinop(PBinop node)
          Base case for all PBinop nodes.
 void defaultPBlock(PBlock node)
          Base case for all PBlock nodes.
 void defaultPBody(PBody node)
          Base case for all PBody nodes.
 void defaultPDecl(PDecl node)
          Base case for all PDecl nodes.
 void defaultPExp(PExp node)
          Base case for all PExp nodes.
 void defaultPProgram(PProgram node)
          Base case for all PProgram nodes.
 void defaultPStm(PStm node)
          Base case for all PStm nodes.
 void defaultToken(Token token)
          Base case for all tokens.
 Object getIn(Node node)
          Returns the Object associated with the Node node in the in map.
 Object getOut(Node node)
          Returns the Object associated with the Node node in the out map.
 void setIn(Node node, Object o)
          Sets the Object o to be a associated with the Node node in the in map.
 void setOut(Node node, Object o)
          Sets the Object o to be a associated with the Node node in the out map.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalysisAdapter

public AnalysisAdapter()
Method Detail

getIn

public Object getIn(Node node)
Returns the Object associated with the Node node in the in map.

Specified by:
getIn in interface Analysis
Returns:
the Object associated with the Node node in the in map

setIn

public void setIn(Node node,
                  Object o)
Sets the Object o to be a associated with the Node node in the in map. If o is null the associated object for node is removed.

Specified by:
setIn in interface Analysis
Parameters:
node - the Node to which Object o is to be associated.
o - the Object to be associated with the Node node in the in map

getOut

public Object getOut(Node node)
Returns the Object associated with the Node node in the out map.

Specified by:
getOut in interface Analysis
Returns:
the Object associated with the Node node in the out map

setOut

public void setOut(Node node,
                   Object o)
Sets the Object o to be a associated with the Node node in the out map. If o is null the associated object for node is removed.

Specified by:
setOut in interface Analysis
Parameters:
node - the Node to which Object o is to be associated.
o - the Object to be associated with the Node node in the out map

caseStart

public void caseStart(Start node)
Called by the Start node from Start#apply(Switch).

Specified by:
caseStart in interface Analysis
Parameters:
node - the calling Start node

caseAProgram

public void caseAProgram(AProgram node)
Called by the AProgram node from AProgram#apply(Switch).

Specified by:
caseAProgram in interface Analysis
Parameters:
node - the calling AProgram node

caseAFuncDecl

public void caseAFuncDecl(AFuncDecl node)
Called by the AFuncDecl node from AFuncDecl#apply(Switch).

Specified by:
caseAFuncDecl in interface Analysis
Parameters:
node - the calling AFuncDecl node

caseALocalDecl

public void caseALocalDecl(ALocalDecl node)
Called by the ALocalDecl node from ALocalDecl#apply(Switch).

Specified by:
caseALocalDecl in interface Analysis
Parameters:
node - the calling ALocalDecl node

caseABody

public void caseABody(ABody node)
Called by the ABody node from ABody#apply(Switch).

Specified by:
caseABody in interface Analysis
Parameters:
node - the calling ABody node

caseABlock

public void caseABlock(ABlock node)
Called by the ABlock node from ABlock#apply(Switch).

Specified by:
caseABlock in interface Analysis
Parameters:
node - the calling ABlock node

caseAPlusBinop

public void caseAPlusBinop(APlusBinop node)
Called by the APlusBinop node from APlusBinop#apply(Switch).

Specified by:
caseAPlusBinop in interface Analysis
Parameters:
node - the calling APlusBinop node

caseAMinusBinop

public void caseAMinusBinop(AMinusBinop node)
Called by the AMinusBinop node from AMinusBinop#apply(Switch).

Specified by:
caseAMinusBinop in interface Analysis
Parameters:
node - the calling AMinusBinop node

caseATimesBinop

public void caseATimesBinop(ATimesBinop node)
Called by the ATimesBinop node from ATimesBinop#apply(Switch).

Specified by:
caseATimesBinop in interface Analysis
Parameters:
node - the calling ATimesBinop node

caseADivideBinop

public void caseADivideBinop(ADivideBinop node)
Called by the ADivideBinop node from ADivideBinop#apply(Switch).

Specified by:
caseADivideBinop in interface Analysis
Parameters:
node - the calling ADivideBinop node

caseAEqBinop

public void caseAEqBinop(AEqBinop node)
Called by the AEqBinop node from AEqBinop#apply(Switch).

Specified by:
caseAEqBinop in interface Analysis
Parameters:
node - the calling AEqBinop node

caseAGtBinop

public void caseAGtBinop(AGtBinop node)
Called by the AGtBinop node from AGtBinop#apply(Switch).

Specified by:
caseAGtBinop in interface Analysis
Parameters:
node - the calling AGtBinop node

caseABinopExp

public void caseABinopExp(ABinopExp node)
Called by the ABinopExp node from ABinopExp#apply(Switch).

Specified by:
caseABinopExp in interface Analysis
Parameters:
node - the calling ABinopExp node

caseAPointerExp

public void caseAPointerExp(APointerExp node)
Called by the APointerExp node from APointerExp#apply(Switch).

Specified by:
caseAPointerExp in interface Analysis
Parameters:
node - the calling APointerExp node

caseADerefExp

public void caseADerefExp(ADerefExp node)
Called by the ADerefExp node from ADerefExp#apply(Switch).

Specified by:
caseADerefExp in interface Analysis
Parameters:
node - the calling ADerefExp node

caseAIntConstExp

public void caseAIntConstExp(AIntConstExp node)
Called by the AIntConstExp node from AIntConstExp#apply(Switch).

Specified by:
caseAIntConstExp in interface Analysis
Parameters:
node - the calling AIntConstExp node

caseAFunctionCallExp

public void caseAFunctionCallExp(AFunctionCallExp node)
Called by the AFunctionCallExp node from AFunctionCallExp#apply(Switch).

Specified by:
caseAFunctionCallExp in interface Analysis
Parameters:
node - the calling AFunctionCallExp node

caseAFunctionPtrCallExp

public void caseAFunctionPtrCallExp(AFunctionPtrCallExp node)
Called by the AFunctionPtrCallExp node from AFunctionPtrCallExp#apply(Switch).

Specified by:
caseAFunctionPtrCallExp in interface Analysis
Parameters:
node - the calling AFunctionPtrCallExp node

caseAVarExp

public void caseAVarExp(AVarExp node)
Called by the AVarExp node from AVarExp#apply(Switch).

Specified by:
caseAVarExp in interface Analysis
Parameters:
node - the calling AVarExp node

caseAInputExp

public void caseAInputExp(AInputExp node)
Called by the AInputExp node from AInputExp#apply(Switch).

Specified by:
caseAInputExp in interface Analysis
Parameters:
node - the calling AInputExp node

caseAMallocExp

public void caseAMallocExp(AMallocExp node)
Called by the AMallocExp node from AMallocExp#apply(Switch).

Specified by:
caseAMallocExp in interface Analysis
Parameters:
node - the calling AMallocExp node

caseANullExp

public void caseANullExp(ANullExp node)
Called by the ANullExp node from ANullExp#apply(Switch).

Specified by:
caseANullExp in interface Analysis
Parameters:
node - the calling ANullExp node

caseAIfThenStm

public void caseAIfThenStm(AIfThenStm node)
Called by the AIfThenStm node from AIfThenStm#apply(Switch).

Specified by:
caseAIfThenStm in interface Analysis
Parameters:
node - the calling AIfThenStm node

caseAIfThenElseStm

public void caseAIfThenElseStm(AIfThenElseStm node)
Called by the AIfThenElseStm node from AIfThenElseStm#apply(Switch).

Specified by:
caseAIfThenElseStm in interface Analysis
Parameters:
node - the calling AIfThenElseStm node

caseAWhileStm

public void caseAWhileStm(AWhileStm node)
Called by the AWhileStm node from AWhileStm#apply(Switch).

Specified by:
caseAWhileStm in interface Analysis
Parameters:
node - the calling AWhileStm node

caseADeclStm

public void caseADeclStm(ADeclStm node)
Called by the ADeclStm node from ADeclStm#apply(Switch).

Specified by:
caseADeclStm in interface Analysis
Parameters:
node - the calling ADeclStm node

caseAReturnStm

public void caseAReturnStm(AReturnStm node)
Called by the AReturnStm node from AReturnStm#apply(Switch).

Specified by:
caseAReturnStm in interface Analysis
Parameters:
node - the calling AReturnStm node

caseAOutputStm

public void caseAOutputStm(AOutputStm node)
Called by the AOutputStm node from AOutputStm#apply(Switch).

Specified by:
caseAOutputStm in interface Analysis
Parameters:
node - the calling AOutputStm node

caseAAssignVarStm

public void caseAAssignVarStm(AAssignVarStm node)
Called by the AAssignVarStm node from AAssignVarStm#apply(Switch).

Specified by:
caseAAssignVarStm in interface Analysis
Parameters:
node - the calling AAssignVarStm node

caseAAssignPtrStm

public void caseAAssignPtrStm(AAssignPtrStm node)
Called by the AAssignPtrStm node from AAssignPtrStm#apply(Switch).

Specified by:
caseAAssignPtrStm in interface Analysis
Parameters:
node - the calling AAssignPtrStm node

caseABlockStm

public void caseABlockStm(ABlockStm node)
Called by the ABlockStm node from ABlockStm#apply(Switch).

Specified by:
caseABlockStm in interface Analysis
Parameters:
node - the calling ABlockStm node

defaultPProgram

public void defaultPProgram(PProgram node)
Base case for all PProgram nodes.

Parameters:
node - the calling PProgram node

defaultPDecl

public void defaultPDecl(PDecl node)
Base case for all PDecl nodes.

Parameters:
node - the calling PDecl node

defaultPBody

public void defaultPBody(PBody node)
Base case for all PBody nodes.

Parameters:
node - the calling PBody node

defaultPBlock

public void defaultPBlock(PBlock node)
Base case for all PBlock nodes.

Parameters:
node - the calling PBlock node

defaultPBinop

public void defaultPBinop(PBinop node)
Base case for all PBinop nodes.

Parameters:
node - the calling PBinop node

defaultPExp

public void defaultPExp(PExp node)
Base case for all PExp nodes.

Parameters:
node - the calling PExp node

defaultPStm

public void defaultPStm(PStm node)
Base case for all PStm nodes.

Parameters:
node - the calling PStm node

caseTWhiteSpace

public void caseTWhiteSpace(TWhiteSpace node)
Called by the TWhiteSpace node from TWhiteSpace#apply(Switch).

Specified by:
caseTWhiteSpace in interface Analysis
Parameters:
node - the calling TWhiteSpace node

caseTCommentSingle

public void caseTCommentSingle(TCommentSingle node)
Called by the TCommentSingle node from TCommentSingle#apply(Switch).

Specified by:
caseTCommentSingle in interface Analysis
Parameters:
node - the calling TCommentSingle node

caseTCommentBlock

public void caseTCommentBlock(TCommentBlock node)
Called by the TCommentBlock node from TCommentBlock#apply(Switch).

Specified by:
caseTCommentBlock in interface Analysis
Parameters:
node - the calling TCommentBlock node

caseTVar

public void caseTVar(TVar node)
Called by the TVar node from TVar#apply(Switch).

Specified by:
caseTVar in interface Analysis
Parameters:
node - the calling TVar node

caseTInput

public void caseTInput(TInput node)
Called by the TInput node from TInput#apply(Switch).

Specified by:
caseTInput in interface Analysis
Parameters:
node - the calling TInput node

caseTOutput

public void caseTOutput(TOutput node)
Called by the TOutput node from TOutput#apply(Switch).

Specified by:
caseTOutput in interface Analysis
Parameters:
node - the calling TOutput node

caseTIf

public void caseTIf(TIf node)
Called by the TIf node from TIf#apply(Switch).

Specified by:
caseTIf in interface Analysis
Parameters:
node - the calling TIf node

caseTElse

public void caseTElse(TElse node)
Called by the TElse node from TElse#apply(Switch).

Specified by:
caseTElse in interface Analysis
Parameters:
node - the calling TElse node

caseTWhile

public void caseTWhile(TWhile node)
Called by the TWhile node from TWhile#apply(Switch).

Specified by:
caseTWhile in interface Analysis
Parameters:
node - the calling TWhile node

caseTReturn

public void caseTReturn(TReturn node)
Called by the TReturn node from TReturn#apply(Switch).

Specified by:
caseTReturn in interface Analysis
Parameters:
node - the calling TReturn node

caseTMalloc

public void caseTMalloc(TMalloc node)
Called by the TMalloc node from TMalloc#apply(Switch).

Specified by:
caseTMalloc in interface Analysis
Parameters:
node - the calling TMalloc node

caseTNull

public void caseTNull(TNull node)
Called by the TNull node from TNull#apply(Switch).

Specified by:
caseTNull in interface Analysis
Parameters:
node - the calling TNull node

caseTLPar

public void caseTLPar(TLPar node)
Called by the TLPar node from TLPar#apply(Switch).

Specified by:
caseTLPar in interface Analysis
Parameters:
node - the calling TLPar node

caseTRPar

public void caseTRPar(TRPar node)
Called by the TRPar node from TRPar#apply(Switch).

Specified by:
caseTRPar in interface Analysis
Parameters:
node - the calling TRPar node

caseTLBrace

public void caseTLBrace(TLBrace node)
Called by the TLBrace node from TLBrace#apply(Switch).

Specified by:
caseTLBrace in interface Analysis
Parameters:
node - the calling TLBrace node

caseTRBrace

public void caseTRBrace(TRBrace node)
Called by the TRBrace node from TRBrace#apply(Switch).

Specified by:
caseTRBrace in interface Analysis
Parameters:
node - the calling TRBrace node

caseTSemicolon

public void caseTSemicolon(TSemicolon node)
Called by the TSemicolon node from TSemicolon#apply(Switch).

Specified by:
caseTSemicolon in interface Analysis
Parameters:
node - the calling TSemicolon node

caseTComma

public void caseTComma(TComma node)
Called by the TComma node from TComma#apply(Switch).

Specified by:
caseTComma in interface Analysis
Parameters:
node - the calling TComma node

caseTAssign

public void caseTAssign(TAssign node)
Called by the TAssign node from TAssign#apply(Switch).

Specified by:
caseTAssign in interface Analysis
Parameters:
node - the calling TAssign node

caseTPlus

public void caseTPlus(TPlus node)
Called by the TPlus node from TPlus#apply(Switch).

Specified by:
caseTPlus in interface Analysis
Parameters:
node - the calling TPlus node

caseTMinus

public void caseTMinus(TMinus node)
Called by the TMinus node from TMinus#apply(Switch).

Specified by:
caseTMinus in interface Analysis
Parameters:
node - the calling TMinus node

caseTStar

public void caseTStar(TStar node)
Called by the TStar node from TStar#apply(Switch).

Specified by:
caseTStar in interface Analysis
Parameters:
node - the calling TStar node

caseTDiv

public void caseTDiv(TDiv node)
Called by the TDiv node from TDiv#apply(Switch).

Specified by:
caseTDiv in interface Analysis
Parameters:
node - the calling TDiv node

caseTAnd

public void caseTAnd(TAnd node)
Called by the TAnd node from TAnd#apply(Switch).

Specified by:
caseTAnd in interface Analysis
Parameters:
node - the calling TAnd node

caseTGt

public void caseTGt(TGt node)
Called by the TGt node from TGt#apply(Switch).

Specified by:
caseTGt in interface Analysis
Parameters:
node - the calling TGt node

caseTEq

public void caseTEq(TEq node)
Called by the TEq node from TEq#apply(Switch).

Specified by:
caseTEq in interface Analysis
Parameters:
node - the calling TEq node

caseTIntegerConst

public void caseTIntegerConst(TIntegerConst node)
Called by the TIntegerConst node from TIntegerConst#apply(Switch).

Specified by:
caseTIntegerConst in interface Analysis
Parameters:
node - the calling TIntegerConst node

caseTIdentifier

public void caseTIdentifier(TIdentifier node)
Called by the TIdentifier node from TIdentifier#apply(Switch).

Specified by:
caseTIdentifier in interface Analysis
Parameters:
node - the calling TIdentifier node

caseEOF

public void caseEOF(EOF token)
Called by the EOF node from EOF#apply(Switch).

Specified by:
caseEOF in interface Analysis
Parameters:
token - the calling EOF token

defaultToken

public void defaultToken(Token token)
Base case for all tokens.

Parameters:
token - the calling Token token

defaultNode

public void defaultNode(Node node)
Base case for all nodes.

Parameters:
node - the calling Node node