Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ASTFixer.java

00001 package ca.mcgill.sable.laleh.java.astfix;
00002 
00003 import edu.ksu.cis.bandera.jjjc.parser.*;
00004 import edu.ksu.cis.bandera.jjjc.lexer.*;
00005 import edu.ksu.cis.bandera.jjjc.node.*;
00006 import edu.ksu.cis.bandera.jjjc.analysis.*;
00007 import ca.mcgill.sable.util.*;
00008 
00009 import java.util.Vector;
00010 import java.util.Hashtable;
00011 import java.util.Enumeration;
00012 import java.util.BitSet;
00013 import java.io.IOException;
00014 class ASTFixer extends AnalysisAdapter {
00015     Hashtable table = new Hashtable();
00016     Node result;
00017     public void caseAAbstractMethodDeclaration(AAbstractMethodDeclaration node) {
00018         table.put(node, new AAbstractMethodDeclarationInterfaceMemberDeclaration(node.getMethodHeader(), node.getSemicolon()));
00019         node.setMethodHeader(null);
00020         node.setSemicolon(null);
00021     }
00022     public void caseAAdditiveExpShiftExp(AAdditiveExpShiftExp node) {
00023         table.put(node, (PExp) table.remove(node.getAdditiveExp()));
00024         node.setAdditiveExp(null);
00025     }
00026     public void caseAAndExpAndExp(AAndExpAndExp node) {
00027         table.put(node, new ABinaryExp((PExp) table.remove(node.getAndExp()), new ABitAndBinaryOperator(node.getBitAnd()), (PExp) table.remove(node.getEqualityExp())));
00028         node.setAndExp(null);
00029         node.setBitAnd(null);
00030         node.setEqualityExp(null);
00031     }
00032     public void caseAAndExpExclusiveOrExp(AAndExpExclusiveOrExp node) {
00033         table.put(node, (PExp) table.remove(node.getAndExp()));
00034         node.setAndExp(null);
00035     }
00036     public void caseAArgumentListArgumentList(AArgumentListArgumentList node) {
00037         LinkedList list = (LinkedList) table.remove(node.getArgumentList());
00038         list.add(node.getExp());
00039         table.put(node, list);
00040         node.setArgumentList(null);
00041         node.setComma(null);
00042         node.setExp(null);
00043     }
00044     public void caseAArrayAccessPrimaryNoNewArray(AArrayAccessPrimaryNoNewArray node) {
00045         table.put(node, new AArrayAccessExp(node.getArrayAccess()));
00046         node.setArrayAccess(null);
00047     }
00048     public void caseAArrayCreationExpPrimary(AArrayCreationExpPrimary node) {
00049         table.put(node, (PExp) table.remove(node.getArrayCreationExp()));
00050         node.setArrayCreationExp(null);
00051     }
00052     public void caseAAssertionCompilationUnit(AAssertionCompilationUnit node) {
00053         result = node;
00054     }
00055     public void caseAAssignment(AAssignment node) {
00056         table.put(node, new AAssignmentExp(node.getLeftHandSide(), node.getAssignmentOperator(), (PExp) table.remove(node.getAssignmentExp())));
00057         node.setLeftHandSide(null);
00058         node.setAssignmentOperator(null);
00059         node.setAssignmentExp(null);
00060     }
00061     public void caseAAssignmentAssignmentExp(AAssignmentAssignmentExp node) {
00062         table.put(node, (PExp) table.remove(node.getAssignment()));
00063         node.setAssignment(null);
00064     }
00065     public void caseAAssignmentStmtExp(AAssignmentStmtExp node) {
00066         table.put(node, (PExp) table.remove(node.getAssignment()));
00067         node.setAssignment(null);
00068     }
00069     public void caseABitComplementUnaryExpNotPlusMinus(ABitComplementUnaryExpNotPlusMinus node) {
00070         table.put(node, new AUnaryExp(new ABitComplementUnaryOperator(node.getBitComplement()), (PExp) table.remove(node.getUnaryExp())));
00071         node.setBitComplement(null);
00072         node.setUnaryExp(null);
00073     }
00074     public void caseABlockStmtWithoutTrailingSubstmt(ABlockStmtWithoutTrailingSubstmt node) {
00075         table.put(node, new ABlockStmt(node.getBlock()));
00076         node.setBlock(null);
00077     }
00078     public void caseABooleanPrimitiveType(ABooleanPrimitiveType node) {
00079         result = (PPrimitiveType) table.remove(node.getBoolean());
00080     }
00081     public void caseABreakStmtStmtWithoutTrailingSubstmt(ABreakStmtStmtWithoutTrailingSubstmt node) {
00082         table.put(node, (PStmt) table.remove(node.getOneBreakStmt()));
00083         node.setOneBreakStmt(null);
00084     }
00085     public void caseAByteIntegralType(AByteIntegralType node) {
00086         table.put(node, new ABytePrimitiveType(node.getByte()));
00087         node.setByte(null);
00088     }
00089     public void caseACastExpUnaryExpNotPlusMinus(ACastExpUnaryExpNotPlusMinus node) {
00090         table.put(node, (PExp) table.remove(node.getCastExp()));
00091         node.setCastExp(null);
00092     }
00093     public void caseACharIntegralType(ACharIntegralType node) {
00094         table.put(node, new ACharPrimitiveType(node.getChar()));
00095         node.setChar(null);
00096     }
00097     public void caseAClassDeclarationClassMemberDeclaration(AClassDeclarationClassMemberDeclaration node) {
00098         table.put(node, new AClassClassBodyDeclaration(node.getClassDeclaration()));
00099         node.setClassDeclaration(null);
00100     }
00101     public void caseAClassInstanceCreationExpPrimaryNoNewArray(AClassInstanceCreationExpPrimaryNoNewArray node) {
00102         table.put(node, (PExp) table.remove(node.getClassInstanceCreationExp()));
00103         node.setClassInstanceCreationExp(null);
00104     }
00105     public void caseAClassInstanceCreationExpStmtExp(AClassInstanceCreationExpStmtExp node) {
00106         table.put(node, (PExp) table.remove(node.getClassInstanceCreationExp()));
00107         node.setClassInstanceCreationExp(null);
00108     }
00109     public void caseAClassMemberDeclarationClassBodyDeclaration(AClassMemberDeclarationClassBodyDeclaration node) {
00110         result = (PClassBodyDeclaration) table.remove(node.getClassMemberDeclaration());
00111     }
00112     public void caseAClassOrInterfaceType(AClassOrInterfaceType node) {
00113         table.put(node, node.getName());
00114         node.setName(null);
00115     }
00116     public void caseAClassOrInterfaceTypeArrayCreationExp(AClassOrInterfaceTypeArrayCreationExp node) {
00117         table.put(node, new AClassOrInterfaceTypeExp(node.getNew(), (PName) table.remove(node.getClassOrInterfaceType()), node.getDimExp(), node.getDim()));
00118         node.setNew(null);
00119         node.setClassOrInterfaceType(null);
00120         node.setDimExp(new LinkedList());
00121         node.setDim(new LinkedList());
00122     }
00123     public void caseAClassOrInterfaceTypeReferenceType(AClassOrInterfaceTypeReferenceType node) {
00124         result = new ANameReferenceType((PName) table.remove(node.getClassOrInterfaceType()));
00125     }
00126     public void caseAClassType(AClassType node) {
00127         table.put(node, (PName) table.remove(node.getClassOrInterfaceType()));
00128         node.setClassOrInterfaceType(null);
00129     }
00130     public void caseAClassTypeClassTypeList(AClassTypeClassTypeList node) {
00131         LinkedList list = new LinkedList();
00132         list.add((PName) table.remove(node.getClassType()));
00133         table.put(node, list);
00134         node.setClassType(null);
00135     }
00136     public void caseAClassTypeListClassTypeList(AClassTypeListClassTypeList node) {
00137         LinkedList list = (LinkedList) table.remove(node.getClassTypeList());
00138         list.add((PName) table.remove(node.getClassType()));
00139         table.put(node, list);
00140         node.setClassTypeList(null);
00141         node.setComma(null);
00142         node.setClassType(null);
00143     }
00144     public void caseAComplementUnaryExpNotPlusMinus(AComplementUnaryExpNotPlusMinus node) {
00145         table.put(node, new AUnaryExp(new AComplementUnaryOperator(node.getComplement()), (PExp) table.remove(node.getUnaryExp())));
00146         node.setComplement(null);
00147         node.setUnaryExp(null);
00148     }
00149     public void caseAConditionalAndExpConditionalAndExp(AConditionalAndExpConditionalAndExp node) {
00150         table.put(node, new ABinaryExp((PExp) table.remove(node.getConditionalAndExp()), new AAndBinaryOperator(node.getAnd()), (PExp) table.remove(node.getInclusiveOrExp())));
00151         node.setConditionalAndExp(null);
00152         node.setAnd(null);
00153         node.setInclusiveOrExp(null);
00154     }
00155     public void caseAConditionalAndExpConditionalOrExp(AConditionalAndExpConditionalOrExp node) {
00156         table.put(node, (PExp) table.remove(node.getConditionalAndExp()));
00157         node.setConditionalAndExp(null);
00158     }
00159     public void caseAConditionalExpAssignmentExp(AConditionalExpAssignmentExp node) {
00160         table.put(node, (PExp) table.remove(node.getConditionalExp()));
00161         node.setConditionalExp(null);
00162     }
00163     public void caseAConditionalOrExpConditionalExp(AConditionalOrExpConditionalExp node) {
00164         table.put(node, (PExp) table.remove(node.getConditionalOrExp()));
00165         node.setConditionalOrExp(null);
00166     }
00167     public void caseAConditionalOrExpConditionalOrExp(AConditionalOrExpConditionalOrExp node) {
00168         table.put(node, new ABinaryExp((PExp) table.remove(node.getConditionalOrExp()), new AOrBinaryOperator(node.getOr()), (PExp) table.remove(node.getConditionalAndExp())));
00169         node.setConditionalOrExp(null);
00170         node.setOr(null);
00171         node.setConditionalAndExp(null);
00172     }
00173     public void caseAConstantDeclaration(AConstantDeclaration node) {
00174         table.put(node, new AConstantDeclarationInterfaceMemberDeclaration(node.getFieldDeclaration()));
00175         node.setFieldDeclaration(null);
00176     }
00177     public void caseAConstantExp(AConstantExp node) {
00178         table.put(node, node.getExp());
00179         node.setExp(null);
00180     }
00181     public void caseAContinueStmtStmtWithoutTrailingSubstmt(AContinueStmtStmtWithoutTrailingSubstmt node) {
00182         table.put(node, (PStmt) table.remove(node.getOneContinueStmt()));
00183         node.setOneContinueStmt(null);
00184     }
00185     public void caseADivMultiplicativeExp(ADivMultiplicativeExp node) {
00186         table.put(node, new ABinaryExp((PExp) table.remove(node.getMultiplicativeExp()), new ADivBinaryOperator(node.getDiv()), (PExp) table.remove(node.getUnaryExp())));
00187         node.setMultiplicativeExp(null);
00188         node.setDiv(null);
00189         node.setUnaryExp(null);
00190     }
00191     public void caseADoStmtStmtWithoutTrailingSubstmt(ADoStmtStmtWithoutTrailingSubstmt node) {
00192         table.put(node, (PStmt) table.remove(node.getOneDoStmt()));
00193         node.setOneDoStmt(null);
00194     }
00195     public void caseADoubleFloatingPointType(ADoubleFloatingPointType node) {
00196         table.put(node, new ADoublePrimitiveType(node.getDouble()));
00197         node.setDouble(null);
00198     }
00199     public void caseAEmptyStmtStmtWithoutTrailingSubstmt(AEmptyStmtStmtWithoutTrailingSubstmt node) {
00200         table.put(node, (PStmt) table.remove(node.getSemicolonStmt()));
00201         node.setSemicolonStmt(null);
00202     }
00203     public void caseAEmptyTypeDeclaration(AEmptyTypeDeclaration node) {
00204         result = null;
00205     }
00206     public void caseAEqEqualityExp(AEqEqualityExp node) {
00207         table.put(node, new ABinaryExp((PExp) table.remove(node.getEqualityExp()), new AEqBinaryOperator(node.getEq()), (PExp) table.remove(node.getRelationalExp())));
00208         node.setEqualityExp(null);
00209         node.setEq(null);
00210         node.setRelationalExp(null);
00211     }
00212     public void caseAEqualityExpAndExp(AEqualityExpAndExp node) {
00213         table.put(node, (PExp) table.remove(node.getEqualityExp()));
00214         node.setEqualityExp(null);
00215     }
00216     public void caseAExclusiveOrExpExclusiveOrExp(AExclusiveOrExpExclusiveOrExp node) {
00217         table.put(node, new ABinaryExp((PExp) table.remove(node.getExclusiveOrExp()), new ABitXorBinaryOperator(node.getBitXor()), (PExp) table.remove(node.getAndExp())));
00218         node.setExclusiveOrExp(null);
00219         node.setBitXor(null);
00220         node.setAndExp(null);
00221     }
00222     public void caseAExclusiveOrExpInclusiveOrExp(AExclusiveOrExpInclusiveOrExp node) {
00223         table.put(node, (PExp) table.remove(node.getExclusiveOrExp()));
00224         node.setExclusiveOrExp(null);
00225     }
00226     public void caseAExpArgumentList(AExpArgumentList node) {
00227         LinkedList list = new LinkedList();
00228         list.add(node.getExp());
00229         table.put(node, list);
00230         node.setExp(null);
00231     }
00232     public void caseAExpStmtStmtWithoutTrailingSubstmt(AExpStmtStmtWithoutTrailingSubstmt node) {
00233         table.put(node, new AExpStmt((PExp) table.remove(node.getExpStmt()), new TSemicolon()));
00234         node.setExpStmt(null);
00235     }
00236     public void caseAExtendsExtendsInterfaces(AExtendsExtendsInterfaces node) {
00237         LinkedList list = new LinkedList();
00238         list.add((PName) table.remove(node.getInterfaceType()));
00239         table.put(node, list);
00240         node.setExtends(null);
00241         node.setInterfaceType(null);
00242     }
00243     public void caseAExtendsInterfacesExtendsInterfaces(AExtendsInterfacesExtendsInterfaces node) {
00244         LinkedList list = (LinkedList) table.remove(node.getExtendsInterfaces());
00245         list.add((PName) table.remove(node.getInterfaceType()));
00246         table.put(node, list);
00247         node.setExtendsInterfaces(null);
00248         node.setComma(null);
00249         node.setInterfaceType(null);
00250     }
00251     public void caseAFieldAccessPrimaryNoNewArray(AFieldAccessPrimaryNoNewArray node) {
00252         table.put(node, new AFieldAccessExp(node.getFieldAccess()));
00253         node.setFieldAccess(null);
00254     }
00255     public void caseAFieldDeclarationClassMemberDeclaration(AFieldDeclarationClassMemberDeclaration node) {
00256         table.put(node, new AFieldClassBodyDeclaration(node.getFieldDeclaration()));
00257         node.setFieldDeclaration(null);
00258     }
00259     public void caseAFinallyOneTryStmt(AFinallyOneTryStmt node) {
00260         table.put(node, new ATryFinallyStmt(node.getTry(), node.getBlock(), node.getCatchClause(), node.getFinally()));
00261         node.setTry(null);
00262         node.setBlock(null);
00263         node.setCatchClause((new LinkedList()));
00264         node.setFinally(null);
00265     }
00266     public void caseAFloatFloatingPointType(AFloatFloatingPointType node) {
00267         table.put(node, new AFloatPrimitiveType(node.getFloat()));
00268         node.setFloat(null);
00269     }
00270     public void caseAFloatingPointTypeNumericType(AFloatingPointTypeNumericType node) {
00271         table.put(node, (PPrimitiveType) table.remove(node.getFloatingPointType()));
00272         node.setFloatingPointType(null);
00273     }
00274     public void caseAFormalParameterFormalParameterList(AFormalParameterFormalParameterList node) {
00275         LinkedList list = new LinkedList();
00276         list.add(node.getFormalParameter());
00277         table.put(node, list);
00278         node.setFormalParameter(null);
00279     }
00280     public void caseAFormalParameterListFormalParameterList(AFormalParameterListFormalParameterList node) {
00281         LinkedList list = (LinkedList) table.remove(node.getFormalParameterList());
00282         list.add(node.getFormalParameter());
00283         table.put(node, list);
00284         node.setFormalParameterList(null);
00285         node.setComma(null);
00286         node.setFormalParameter(null);
00287     }
00288     public void caseAForStmtNoShortIf(AForStmtNoShortIf node) {
00289         // list of PBlockedStmt (i.e. AStmtBlockedStmt)
00290         LinkedList list = new LinkedList();
00291         list.add(new AStmtBlockedStmt((PStmt) table.remove(node.getStmtNoShortIf())));
00292         if (node.getForUpdate() == null)
00293             table.put(node, new AForStmt(node.getFor(), node.getLPar(), node.getForInit(), node.getSemicolon1(), node.getExp(), node.getSemicolon2(), new LinkedList(), node.getRPar(), new ABlock(new TLBrace(), list, new TRBrace())));
00294         else
00295             table.put(node, new AForStmt(node.getFor(), node.getLPar(), node.getForInit(), node.getSemicolon1(), node.getExp(), node.getSemicolon2(), (LinkedList) table.remove(node.getForUpdate()), node.getRPar(), new ABlock(new TLBrace(), list, new TRBrace())));
00296         node.setFor(null);
00297         node.setLPar(null);
00298         node.setForInit(null);
00299         node.setSemicolon1(null);
00300         node.setExp(null);
00301         node.setSemicolon2(null);
00302         node.setForUpdate(null);
00303         node.setRPar(null);
00304         node.setStmtNoShortIf(null);
00305     }
00306     public void caseAForStmtNoShortIfStmtNoShortIf(AForStmtNoShortIfStmtNoShortIf node) {
00307         table.put(node, (PStmt) table.remove(node.getForStmtNoShortIf()));
00308         node.setForStmtNoShortIf(null);
00309     }
00310     public void caseAForStmtStmt(AForStmtStmt node) {
00311         result = (PStmt) table.remove(node.getOneForStmt());
00312     }
00313     public void caseAForUpdate(AForUpdate node) {
00314         table.put(node, (LinkedList) table.remove(node.getStmtExpList()));
00315     }
00316     public void caseAGteqRelationalExp(AGteqRelationalExp node) {
00317         table.put(node, new ABinaryExp((PExp) table.remove(node.getRelationalExp()), new AGteqBinaryOperator(node.getGteq()), (PExp) table.remove(node.getShiftExp())));
00318         node.setRelationalExp(null);
00319         node.setGteq(null);
00320         node.setShiftExp(null);
00321     }
00322     public void caseAGtRelationalExp(AGtRelationalExp node) {
00323         table.put(node, new ABinaryExp((PExp) table.remove(node.getRelationalExp()), new AGtBinaryOperator(node.getGt()), (PExp) table.remove(node.getShiftExp())));
00324         node.setRelationalExp(null);
00325         node.setGt(null);
00326         node.setShiftExp(null);
00327     }
00328     public void caseAIfThenElseStmt(AIfThenElseStmt node) {
00329         // list of PBlockedStmt (i.e. AStmtBlockedStmt)
00330         LinkedList list1 = new LinkedList();
00331         LinkedList list2 = new LinkedList();
00332         list1.add(new AStmtBlockedStmt((PStmt) table.remove(node.getStmtNoShortIf())));
00333         list2.add(new AStmtBlockedStmt(node.getStmt()));
00334         table.put(node, new AIfStmt(node.getIf(), node.getLPar(), node.getExp(), node.getRPar(), new ABlock(new TLBrace(), list1, new TRBrace()), node.getElse(), new ABlock(new TLBrace(), list2, new TRBrace())));
00335         node.setIf(null);
00336         node.setLPar(null);
00337         node.setExp(null);
00338         node.setRPar(null);
00339         node.setStmtNoShortIf(null);
00340         node.setElse(null);
00341         node.setStmt(null);
00342     }
00343     public void caseAIfThenElseStmtNoShortIf(AIfThenElseStmtNoShortIf node) {
00344         // list of PBlockedStmt (i.e. AStmtBlockedStmt)
00345         LinkedList list1 = new LinkedList();
00346         LinkedList list2 = new LinkedList();
00347         list1.add(new AStmtBlockedStmt((PStmt) table.remove(node.getStmtNoShortIf1())));
00348         list2.add(new AStmtBlockedStmt((PStmt) table.remove(node.getStmtNoShortIf2())));
00349         table.put(node, new AIfStmt(node.getIf(), node.getLPar(), node.getExp(), node.getRPar(), new ABlock(new TLBrace(), list1, new TRBrace()), node.getElse(), new ABlock(new TLBrace(), list2, new TRBrace())));
00350         node.setIf(null);
00351         node.setLPar(null);
00352         node.setExp(null);
00353         node.setRPar(null);
00354         node.setStmtNoShortIf1(null);
00355         node.setElse(null);
00356         node.setStmtNoShortIf2(null);
00357     }
00358     public void caseAIfThenElseStmtNoShortIfStmtNoShortIf(AIfThenElseStmtNoShortIfStmtNoShortIf node) {
00359         table.put(node, (PStmt) table.remove(node.getIfThenElseStmtNoShortIf()));
00360         node.setIfThenElseStmtNoShortIf(null);
00361     }
00362     public void caseAIfThenElseStmtStmt(AIfThenElseStmtStmt node) {
00363         result = (PStmt) table.remove(node.getIfThenElseStmt());
00364     }
00365     public void caseAIfThenStmt(AIfThenStmt node) {
00366         LinkedList list = new LinkedList();
00367         list.add(new AStmtBlockedStmt(node.getStmt()));
00368         table.put(node, new AIfStmt(node.getIf(), node.getLPar(), node.getExp(), node.getRPar(), new ABlock(new TLBrace(), list, new TRBrace()), new TElse(), new ABlock(new TLBrace(), new LinkedList(), new TRBrace())));
00369         node.setIf(null);
00370         node.setLPar(null);
00371         node.setExp(null);
00372         node.setRPar(null);
00373         node.setStmt(null);
00374     }
00375     public void caseAIfThenStmtStmt(AIfThenStmtStmt node) {
00376         result = (PStmt) table.remove(node.getIfThenStmt());
00377     }
00378     public void caseAInclusiveOrExpConditionalAndExp(AInclusiveOrExpConditionalAndExp node) {
00379         table.put(node, (PExp) table.remove(node.getInclusiveOrExp()));
00380         node.setInclusiveOrExp(null);
00381     }
00382     public void caseAInclusiveOrExpInclusiveOrExp(AInclusiveOrExpInclusiveOrExp node) {
00383         table.put(node, new ABinaryExp((PExp) table.remove(node.getInclusiveOrExp()), new ABitOrBinaryOperator(node.getBitOr()), (PExp) table.remove(node.getExclusiveOrExp())));
00384         node.setInclusiveOrExp(null);
00385         node.setBitOr(null);
00386         node.setExclusiveOrExp(null);
00387     }
00388     public void caseAInitClassInterfaceArrayCreationExp(AInitClassInterfaceArrayCreationExp node) {
00389         table.put(node, new AInitClassInterfaceExp(node.getNew(), (PName) table.remove(node.getClassOrInterfaceType()), node.getDim(), node.getArrayInitializer()));
00390         node.setNew(null);
00391         node.setClassOrInterfaceType(null);
00392         node.setDim(new LinkedList());
00393         node.setArrayInitializer(null);
00394     }
00395     public void caseAInitPrimitiveArrayCreationExp(AInitPrimitiveArrayCreationExp node) {
00396         table.put(node, new AInitPrimitiveExp(node.getNew(), node.getPrimitiveType(), node.getDim(), node.getArrayInitializer()));
00397         node.setNew(null);
00398         node.setPrimitiveType(null);
00399         node.setDim(new LinkedList());
00400         node.setArrayInitializer(null);
00401     }
00402     public void caseAInstanceofRelationalExp(AInstanceofRelationalExp node) {
00403         table.put(node, new AInstanceofExp((PExp) table.remove(node.getRelationalExp()), node.getInstanceof(), node.getReferenceType()));
00404         node.setRelationalExp(null);
00405         node.setInstanceof(null);
00406         node.setReferenceType(null);
00407     }
00408     public void caseAIntegralTypeNumericType(AIntegralTypeNumericType node) {
00409         table.put(node, (PPrimitiveType) table.remove(node.getIntegralType()));
00410         node.setIntegralType(null);
00411     }
00412     public void caseAInterfaceDeclarationClassMemberDeclaration(AInterfaceDeclarationClassMemberDeclaration node) {
00413         table.put(node, new AInterfaceClassBodyDeclaration(node.getInterfaceDeclaration()));
00414         node.setInterfaceDeclaration(null);
00415     }
00416     public void caseAInterfaceType(AInterfaceType node) {
00417         table.put(node, (PName) table.remove(node.getClassOrInterfaceType()));
00418         node.setClassOrInterfaceType(null);
00419     }
00420     public void caseAInterfaceTypeInterfaceTypeList(AInterfaceTypeInterfaceTypeList node) {
00421         LinkedList list = new LinkedList();
00422         list.add((PName) table.remove(node.getInterfaceType()));
00423         table.put(node, list);
00424         node.setInterfaceType(null);
00425     }
00426     public void caseAInterfaceTypeListInterfaceTypeList(AInterfaceTypeListInterfaceTypeList node) {
00427         LinkedList list = (LinkedList) table.remove(node.getInterfaceTypeList());
00428         list.add((PName) table.remove(node.getInterfaceType()));
00429         table.put(node, list);
00430         node.setInterfaceType(null);
00431         node.setComma(null);
00432         node.setInterfaceTypeList(null);
00433     }
00434     public void caseAIntIntegralType(AIntIntegralType node) {
00435         table.put(node, new AIntPrimitiveType(node.getInt()));
00436         node.setInt(null);
00437     }
00438     public void caseALabeledStmt(ALabeledStmt node) {
00439         // list of PBlockedStmt (i.e. AStmtBlockedStmt)
00440         LinkedList list = new LinkedList();
00441         list.add((new AStmtBlockedStmt(node.getStmt())));
00442         table.put(node, new ALabelStmt(node.getId(), node.getColon(), new ABlock(new TLBrace(), list, new TRBrace())));
00443         node.setId(null);
00444         node.setColon(null);
00445         node.setStmt(null);
00446     }
00447     public void caseALabeledStmtNoShortIf(ALabeledStmtNoShortIf node) {
00448         //  list of PBlockedStmt (i.e. AStmtBlockedStmt)
00449         LinkedList list = new LinkedList();
00450         list.add(new AStmtBlockedStmt((PStmt) table.remove(node.getStmtNoShortIf())));
00451         table.put(node, new ALabelStmt(node.getId(), node.getColon(), new ABlock(new TLBrace(), list, new TRBrace())));
00452         node.setId(null);
00453         node.setColon(null);
00454         node.setStmtNoShortIf(null);
00455     }
00456     public void caseALabeledStmtNoShortIfStmtNoShortIf(ALabeledStmtNoShortIfStmtNoShortIf node) {
00457         table.put(node, (PStmt) table.remove(node.getLabeledStmtNoShortIf()));
00458         node.setLabeledStmtNoShortIf(null);
00459     }
00460     public void caseALabeledStmtStmt(ALabeledStmtStmt node) {
00461         result = (PStmt) table.remove(node.getLabeledStmt());
00462     }
00463     public void caseALiteralPrimaryNoNewArray(ALiteralPrimaryNoNewArray node) {
00464         table.put(node, new ALiteralExp(node.getLiteral()));
00465         node.setLiteral(null);
00466     }
00467     public void caseALocalVariableDeclarationStmt(ALocalVariableDeclarationStmt node) {
00468         table.put(node, (new ALocalVariableDeclarationInBlockedStmt(node.getLocalVariableDeclaration(), node.getSemicolon())));
00469         node.setLocalVariableDeclaration(null);
00470         node.setSemicolon(null);
00471     }
00472     public void caseALocalVariableDeclarationStmtBlockedStmt(ALocalVariableDeclarationStmtBlockedStmt node) {
00473         result = (PBlockedStmt) table.remove(node.getLocalVariableDeclarationStmt());
00474     }
00475     public void caseALongIntegralType(ALongIntegralType node) {
00476         table.put(node, new ALongPrimitiveType(node.getLong()));
00477         node.setLong(null);
00478     }
00479     /*public void caseALParPrimaryNoNewArray(ALParPrimaryNoNewArray node)
00480     {
00481     table.put(node, new AUnaryExp(
00482     new APlusUnaryOperator(),
00483     node.getExp()));
00484     node.setLPar(null);
00485     node.setExp(null);
00486     node.setRPar(null);
00487     }*/
00488 
00489     public void caseALParPrimaryNoNewArray(ALParPrimaryNoNewArray node) {
00490         table.put(node, new AParExp(node.getLPar(), node.getExp(), node.getRPar()));
00491         node.setLPar(null);
00492         node.setExp(null);
00493         node.setRPar(null);
00494     }
00495     public void caseALteqRelationalExp(ALteqRelationalExp node) {
00496         table.put(node, new ABinaryExp((PExp) table.remove(node.getRelationalExp()), new ALteqBinaryOperator(node.getLteq()), (PExp) table.remove(node.getShiftExp())));
00497         node.setRelationalExp(null);
00498         node.setLteq(null);
00499         node.setShiftExp(null);
00500     }
00501     public void caseALtRelationalExp(ALtRelationalExp node) {
00502         table.put(node, new ABinaryExp((PExp) table.remove(node.getRelationalExp()), new ALtBinaryOperator(node.getLt()), (PExp) table.remove(node.getShiftExp())));
00503         node.setRelationalExp(null);
00504         node.setLt(null);
00505         node.setShiftExp(null);
00506     }
00507     public void caseAMethodDeclarationClassMemberDeclaration(AMethodDeclarationClassMemberDeclaration node) {
00508         table.put(node, new AMethodClassBodyDeclaration(node.getMethodDeclaration()));
00509         node.setMethodDeclaration(null);
00510     }
00511     public void caseAMethodInvocationPrimaryNoNewArray(AMethodInvocationPrimaryNoNewArray node) {
00512         table.put(node, (PExp) table.remove(node.getMethodInvocation()));
00513         node.setMethodInvocation(null);
00514     }
00515     public void caseAMethodInvocationStmtExp(AMethodInvocationStmtExp node) {
00516         table.put(node, (PExp) table.remove(node.getMethodInvocation()));
00517         node.setMethodInvocation(null);
00518     }
00519     public void caseAMinusAdditiveExp(AMinusAdditiveExp node) {
00520         table.put(node, new ABinaryExp((PExp) table.remove(node.getAdditiveExp()), new AMinusBinaryOperator(node.getMinus()), (PExp) table.remove(node.getMultiplicativeExp())));
00521         node.setAdditiveExp(null);
00522         node.setMinus(null);
00523         node.setMultiplicativeExp(null);
00524     }
00525     public void caseAMinusUnaryExp(AMinusUnaryExp node) {
00526         table.put(node, new AUnaryExp(new AMinusUnaryOperator(node.getMinus()), (PExp) table.remove(node.getUnaryExp())));
00527         node.setUnaryExp(null);
00528         node.setMinus(null);
00529     }
00530     public void caseAModMultiplicativeExp(AModMultiplicativeExp node) {
00531         table.put(node, new ABinaryExp((PExp) table.remove(node.getMultiplicativeExp()), new AModBinaryOperator(node.getMod()), (PExp) table.remove(node.getUnaryExp())));
00532         node.setMultiplicativeExp(null);
00533         node.setMod(null);
00534         node.setUnaryExp(null);
00535     }
00536     public void caseAMultiplicativeExpAdditiveExp(AMultiplicativeExpAdditiveExp node) {
00537         table.put(node, (PExp) table.remove(node.getMultiplicativeExp()));
00538         node.setMultiplicativeExp(null);
00539     }
00540     public void caseANameMethodInvocation(ANameMethodInvocation node) {
00541         if (node.getArgumentList() != null)
00542             table.put(node, new ANameMethodInvocationExp(node.getName(), node.getLPar(), (LinkedList) table.remove(node.getArgumentList()), node.getRPar()));
00543         else
00544             table.put(node, new ANameMethodInvocationExp(node.getName(), node.getLPar(), new LinkedList(), node.getRPar()));
00545     }
00546     public void caseANamePostfixExp(ANamePostfixExp node) {
00547         table.put(node, new ANameExp(node.getName()));
00548         node.setName(null);
00549     }
00550     public void caseANeqEqualityExp(ANeqEqualityExp node) {
00551         table.put(node, new ABinaryExp((PExp) table.remove(node.getEqualityExp()), new ANeqBinaryOperator(node.getNeq()), (PExp) table.remove(node.getRelationalExp())));
00552         node.setEqualityExp(null);
00553         node.setNeq(null);
00554         node.setRelationalExp(null);
00555     }
00556     public void caseANotPlusMinusUnaryExp(ANotPlusMinusUnaryExp node) {
00557         table.put(node, (PExp) table.remove(node.getUnaryExpNotPlusMinus()));
00558         node.setUnaryExpNotPlusMinus(null);
00559     }
00560     public void caseANumericTypePrimitiveType(ANumericTypePrimitiveType node) {
00561         result = (PPrimitiveType) table.remove(node.getNumericType());
00562     }
00563     public void caseAOldAbstractMethodDeclarationInterfaceMemberDeclaration(AOldAbstractMethodDeclarationInterfaceMemberDeclaration node) {
00564         result = (PInterfaceMemberDeclaration) table.remove(node.getAbstractMethodDeclaration());
00565         node.setAbstractMethodDeclaration(null);
00566     }
00567     public void caseAOldArrayInitializer(AOldArrayInitializer node) {
00568         if (node.getVariableInitializers() != null)
00569             result = new AArrayInitializer(node.getLBrace(), (LinkedList) table.remove(node.getVariableInitializers()), new TComma(), node.getRBrace());
00570         else
00571             result = new AArrayInitializer(node.getLBrace(), new LinkedList(), new TComma(), node.getRBrace());
00572     }
00573     public void caseAOldCaseSwitchLabel(AOldCaseSwitchLabel node) {
00574         result = new ACaseSwitchLabel(node.getCase(), (PExp) table.remove(node.getConstantExp()), node.getColon());
00575     }
00576     public void caseAOldCompilationUnit(AOldCompilationUnit node) {
00577         if (node.getPackageDeclaration() != null)
00578             result = new ACompilationUnit((new TPackage()), ((PName) table.remove(node.getPackageDeclaration())), (new TSemicolon()), node.getImportDeclaration(), node.getTypeDeclaration());
00579         else
00580             result = new ACompilationUnit(null, null, null, node.getImportDeclaration(), node.getTypeDeclaration());
00581     }
00582     public void caseAOldConstantDeclarationInterfaceMemberDeclaration(AOldConstantDeclarationInterfaceMemberDeclaration node) {
00583         result = (PInterfaceMemberDeclaration) table.remove(node.getConstantDeclaration());
00584         node.setConstantDeclaration(null);
00585     }
00586     public void caseAOldConstructorDeclarator(AOldConstructorDeclarator node) {
00587         if (node.getFormalParameterList() != null)
00588             result = new AConstructorDeclarator(node.getId(), new TLPar(), (LinkedList) table.remove(node.getFormalParameterList()), new TRPar());
00589         else
00590             result = new AConstructorDeclarator(node.getId(), (new TLPar()), new LinkedList(), new TRPar());
00591     }
00592     public void caseAOldExp(AOldExp node) {
00593         result = (PExp) table.remove(node.getAssignmentExp());
00594     }
00595     public void caseAOldExpCastExp(AOldExpCastExp node) {
00596         table.put(node, new AExpCastExp(node.getLPar(), node.getExp(), node.getRPar(), (PExp) table.remove(node.getUnaryExpNotPlusMinus())));
00597         node.setLPar(null);
00598         node.setExp(null);
00599         node.setRPar(null);
00600         node.setUnaryExpNotPlusMinus(null);
00601     }
00602     public void caseAOldFieldDeclaration(AOldFieldDeclaration node) {
00603         result = new AFieldDeclaration(node.getModifier(), node.getType(), (LinkedList) table.remove(node.getVariableDeclarators()), (new TSemicolon()));
00604     }
00605     public void caseAOldInterfaceDeclaration(AOldInterfaceDeclaration node) {
00606         if (node.getExtendsInterfaces() != null)
00607             result = new AInterfaceDeclaration(node.getModifier(), node.getInterface(), node.getId(), new TExtends(), (LinkedList) table.remove(node.getExtendsInterfaces()), node.getInterfaceBody());
00608         else
00609             result = new AInterfaceDeclaration(node.getModifier(), node.getInterface(), node.getId(), null, new LinkedList(), node.getInterfaceBody());
00610     }
00611     public void caseAOldInterfaces(AOldInterfaces node) {
00612         result = new AInterfaces((new TImplements()), (LinkedList) table.remove(node.getInterfaceTypeList()));
00613     }
00614     public void caseAOldLocalVariableDeclaration(AOldLocalVariableDeclaration node) {
00615         result = new ALocalVariableDeclaration(node.getModifier(), node.getType(), (LinkedList) table.remove(node.getVariableDeclarators()));
00616         node.setModifier((new LinkedList()));
00617         node.setType(null);
00618         node.setVariableDeclarators(null);
00619     }
00620     public void caseAOldMethodDeclarator(AOldMethodDeclarator node) {
00621         if (node.getFormalParameterList() != null)
00622             result = new AMethodDeclarator(node.getId(), new TLPar(), (LinkedList) table.remove(node.getFormalParameterList()), new TRPar(), node.getDim());
00623         else
00624             result = new AMethodDeclarator(node.getId(), new TLPar(), new LinkedList(), new TRPar(), node.getDim());
00625     }
00626     public void caseAOldNameCastExp(AOldNameCastExp node) {
00627         table.put(node, new ANameCastExp(node.getLPar(), node.getName(), node.getDim(), node.getRPar(), (PExp) table.remove(node.getUnaryExpNotPlusMinus())));
00628         node.setLPar(null);
00629         node.setName(null);
00630         node.setDim(new LinkedList());
00631         node.setRPar(null);
00632         node.setUnaryExpNotPlusMinus(null);
00633     }
00634     public void caseAOldNamedTypePrimaryNoNewArray(AOldNamedTypePrimaryNoNewArray node) {
00635         table.put(node, new ANamedTypeExp(node.getName(), node.getDim(), node.getDot(), node.getTClass()));
00636         node.setName(null);
00637         node.setDim(new LinkedList());
00638         node.setDot(null);
00639         node.setTClass(null);
00640     }
00641     public void caseAOldPrimaryFieldAccess(AOldPrimaryFieldAccess node) {
00642         result = new APrimaryFieldAccess((PExp) table.remove(node.getPrimary()), node.getDot(), node.getId());
00643     }
00644     public void caseAOldPrimaryNoNewArrayArrayAccess(AOldPrimaryNoNewArrayArrayAccess node) {
00645         result = new APrimaryNoNewArrayArrayAccess((PExp) table.remove(node.getPrimaryNoNewArray()), node.getLBracket(), node.getExp(), node.getRBracket());
00646     }
00647     public void caseAOldPrimitiveTypeCastExp(AOldPrimitiveTypeCastExp node) {
00648         table.put(node, new APrimitiveTypeCastExp(node.getLPar(), node.getPrimitiveType(), node.getDim(), node.getRPar(), (PExp) table.remove(node.getUnaryExp())));
00649         node.setLPar(null);
00650         node.setPrimitiveType(null);
00651         node.setDim(new LinkedList());
00652         node.setRPar(null);
00653         node.setUnaryExp(null);
00654     }
00655     public void caseAOldPrimitiveTypePrimaryNoNewArray(AOldPrimitiveTypePrimaryNoNewArray node) {
00656         table.put(node, new APrimitiveTypePrimaryExp(node.getPrimitiveType(), node.getDim(), node.getDot(), node.getTClass()));
00657         node.setPrimitiveType(null);
00658         node.setDim(new LinkedList());
00659         node.setDot(null);
00660         node.setTClass(null);
00661     }
00662     public void caseAOldQualifiedClassInstanceCreationExp(AOldQualifiedClassInstanceCreationExp node) {
00663         if (node.getArgumentList() != null)
00664             table.put(node, new AQualifiedClassInstanceCreationExp((PExp) table.remove(node.getPrimary()), node.getDot(), node.getNew(), node.getId(), node.getLPar(), (LinkedList) table.remove(node.getArgumentList()), node.getRPar(), node.getClassBody()));
00665         else
00666             table.put(node, new AQualifiedClassInstanceCreationExp((PExp) table.remove(node.getPrimary()), node.getDot(), node.getNew(), node.getId(), node.getLPar(), new LinkedList(), node.getRPar(), node.getClassBody()));
00667         node.setPrimary(null);
00668         node.setDot(null);
00669         node.setNew(null);
00670         node.setId(null);
00671         node.setLPar(null);
00672         node.setArgumentList(null);
00673         node.setRPar(null);
00674         node.setClassBody(null);
00675     }
00676     public void caseAOldQualifiedConstructorInvocation(AOldQualifiedConstructorInvocation node) {
00677         if (node.getArgumentList() != null)
00678             result = new AQualifiedConstructorInvocation((PExp) table.remove(node.getPrimary()), node.getDot(), node.getSuper(), new TLPar(), (LinkedList) table.remove(node.getArgumentList()), new TRPar(), node.getSemicolon());
00679         else
00680             result = new AQualifiedConstructorInvocation((PExp) table.remove(node.getPrimary()), node.getDot(), node.getSuper(), new TLPar(), new LinkedList(), new TRPar(), node.getSemicolon());
00681     }
00682     public void caseAOldSimpleClassInstanceCreationExp(AOldSimpleClassInstanceCreationExp node) {
00683         if (node.getArgumentList() != null)
00684             table.put(node, new ASimpleClassInstanceCreationExp(node.getNew(), node.getName(), node.getLPar(), (LinkedList) table.remove(node.getArgumentList()), node.getRPar(), node.getClassBody()));
00685         else
00686             table.put(node, new ASimpleClassInstanceCreationExp(node.getNew(), node.getName(), node.getLPar(), new LinkedList(), node.getRPar(), node.getClassBody()));
00687         node.setNew(null);
00688         node.setName(null);
00689         node.setLPar(null);
00690         node.setArgumentList(null);
00691         node.setRPar(null);
00692         node.setClassBody(null);
00693     }
00694     public void caseAOldStaticInitializerClassBodyDeclaration(AOldStaticInitializerClassBodyDeclaration node) {
00695         result = (PClassBodyDeclaration) table.remove(node.getStaticInitializer());
00696     }
00697     public void caseAOldSuper(AOldSuper node) {
00698         result = new ASuper((new TExtends()), (PName) table.remove(node.getClassType()));
00699     }
00700     public void caseAOldSuperConstructorInvocation(AOldSuperConstructorInvocation node) {
00701         if (node.getArgumentList() != null) {
00702             result = new ASuperConstructorInvocation(node.getSuper(), node.getLPar(), (LinkedList) table.remove(node.getArgumentList()), node.getRPar(), node.getSemicolon());
00703         } else {
00704             result = new ASuperConstructorInvocation(node.getSuper(), node.getLPar(), new LinkedList(), node.getRPar(), node.getSemicolon());
00705         }
00706     }
00707     public void caseAOldThisConstructorInvocation(AOldThisConstructorInvocation node) {
00708         if (node.getArgumentList() != null)
00709             result = new AThisConstructorInvocation((TThis) node.getThis(), node.getLPar(), (LinkedList) table.remove(node.getArgumentList()), node.getRPar(), node.getSemicolon());
00710         else
00711             result = new AThisConstructorInvocation((TThis) node.getThis(), node.getLPar(), new LinkedList(), node.getRPar(), node.getSemicolon());
00712     }
00713     public void caseAOldThrows(AOldThrows node) {
00714         result = new AThrows((new TThrows()), (LinkedList) table.remove(node.getClassTypeList()));
00715     }
00716     public void caseAOneBreakStmt(AOneBreakStmt node) {
00717         table.put(node, new ABreakStmt(node.getBreak(), node.getId(), node.getSemicolon()));
00718         node.setBreak(null);
00719         node.setId(null);
00720         node.setSemicolon(null);
00721     }
00722     public void caseAOneContinueStmt(AOneContinueStmt node) {
00723         table.put(node, new AContinueStmt(node.getContinue(), node.getId(), node.getSemicolon()));
00724         node.setContinue(null);
00725         node.setId(null);
00726         node.setSemicolon(null);
00727     }
00728     public void caseAOneDoStmt(AOneDoStmt node) {
00729         // list of PBlockedStmt (i.e. AStmtBlockedStmt)
00730         LinkedList list = new LinkedList();
00731         list.add(new AStmtBlockedStmt(node.getStmt()));
00732         table.put(node, new ADoStmt(node.getDo(), new ABlock(new TLBrace(), list, new TRBrace()), node.getWhile(), node.getLPar(), node.getExp(), node.getRPar(), node.getSemicolon()));
00733     }
00734     public void caseAOneForStmt(AOneForStmt node) {
00735         // list of PBlockedStmt (i.e. AStmtBlockedStmt)
00736         LinkedList list = new LinkedList();
00737         list.add(new AStmtBlockedStmt(node.getStmt()));
00738         if (node.getForUpdate() == null)
00739             table.put(node, new AForStmt(node.getFor(), node.getLPar(), node.getForInit(), node.getSemicolon1(), node.getExp(), node.getSemicolon2(), new LinkedList(), node.getRPar(), new ABlock(new TLBrace(), list, new TRBrace())));
00740         else
00741             table.put(node, new AForStmt(node.getFor(), node.getLPar(), node.getForInit(), node.getSemicolon1(), node.getExp(), node.getSemicolon2(), (LinkedList) table.remove(node.getForUpdate()), node.getRPar(), new ABlock(new TLBrace(), list, new TRBrace())));
00742         node.setFor(null);
00743         node.setLPar(null);
00744         node.setForInit(null);
00745         node.setSemicolon1(null);
00746         node.setExp(null);
00747         node.setSemicolon2(null);
00748         node.setForUpdate(null);
00749         node.setRPar(null);
00750         node.setStmt(null);
00751     }
00752     public void caseAOneQualifiedName(AOneQualifiedName node) {
00753         table.put(node, new AQualifiedName(node.getName(), node.getDot(), node.getId()));
00754         node.setName(null);
00755         node.setDot(null);
00756         node.setId(null);
00757     }
00758     public void caseAOneReturnStmt(AOneReturnStmt node) {
00759         table.put(node, new AReturnStmt(node.getReturn(), node.getExp(), node.getSemicolon()));
00760         node.setReturn(null);
00761         node.setExp(null);
00762         node.setSemicolon(null);
00763     }
00764     public void caseAOneSimpleName(AOneSimpleName node) {
00765         table.put(node, new ASimpleName(node.getId()));
00766         node.setId(null);
00767     }
00768     public void caseAOneSingleTypeImportDeclaration(AOneSingleTypeImportDeclaration node) {
00769         table.put(node, new ASingleTypeImportDeclaration(node.getImport(), node.getName(), node.getSemicolon()));
00770         node.setImport(null);
00771         node.setName(null);
00772         node.setSemicolon(null);
00773     }
00774     public void caseAOneSwitchStmt(AOneSwitchStmt node) {
00775         table.put(node, new ASwitchStmt(node.getSwitch(), node.getLPar(), node.getExp(), node.getRPar(), node.getLBrace(), node.getSwitchBlockStmtGroup(), node.getSwitchLabel(), node.getRBrace()));
00776         node.setSwitch(null);
00777         node.setLPar(null);
00778         node.setExp(null);
00779         node.setRPar(null);
00780         node.setLBrace(null);
00781         node.setSwitchBlockStmtGroup(new LinkedList());
00782         node.setSwitchLabel(new LinkedList());
00783         node.setRBrace(null);
00784     }
00785     public void caseAOneSynchronizedStmt(AOneSynchronizedStmt node) {
00786         table.put(node, new ASynchronizedStmt(node.getSynchronized(), node.getLPar(), node.getExp(), node.getRPar(), node.getBlock()));
00787         node.setSynchronized(null);
00788         node.setLPar(null);
00789         node.setExp(null);
00790         node.setRPar(null);
00791         node.setBlock(null);
00792     }
00793     public void caseAOneThrowStmt(AOneThrowStmt node) {
00794         table.put(node, new AThrowStmt(node.getThrow(), node.getExp(), node.getSemicolon()));
00795         node.setThrow(null);
00796         node.setExp(null);
00797         node.setSemicolon(null);
00798     }
00799     public void caseAOneTypeImportOnDemandDeclaration(AOneTypeImportOnDemandDeclaration node) {
00800         table.put(node, new ATypeOnDemandImportDeclaration(node.getImport(), node.getName(), node.getDot(), node.getStar(), node.getSemicolon()));
00801         node.setImport(null);
00802         node.setName(null);
00803         node.setDot(null);
00804         node.setStar(null);
00805         node.setSemicolon(null);
00806     }
00807     public void caseAOneWhileStmt(AOneWhileStmt node) {
00808         // list of PBlockedStmt (i.e. AStmtBlockedStmt)
00809         LinkedList list = new LinkedList();
00810         list.add(new AStmtBlockedStmt(node.getStmt()));
00811         table.put(node, new AWhileStmt(node.getWhile(), node.getLPar(), node.getExp(), node.getRPar(), new ABlock(new TLBrace(), list, new TRBrace())));
00812         node.setWhile(null);
00813         node.setLPar(null);
00814         node.setExp(null);
00815         node.setRPar(null);
00816         node.setStmt(null);
00817     }
00818     public void caseAOriginalExpStmt(AOriginalExpStmt node) {
00819         table.put(node, (PExp) table.remove(node.getStmtExp()));
00820         node.setStmtExp(null);
00821     }
00822     public void caseAPackageDeclaration(APackageDeclaration node) {
00823         table.put(node, node.getName());
00824         node.setPackage(null);
00825         node.setName(null);
00826         node.setSemicolon(null);
00827     }
00828     public void caseAPlusAdditiveExp(APlusAdditiveExp node) {
00829         table.put(node, new ABinaryExp((PExp) table.remove(node.getAdditiveExp()), new APlusBinaryOperator(node.getPlus()), (PExp) table.remove(node.getMultiplicativeExp())));
00830         node.setAdditiveExp(null);
00831         node.setPlus(null);
00832         node.setMultiplicativeExp(null);
00833     }
00834     public void caseAPlusUnaryExp(APlusUnaryExp node) {
00835         table.put(node, new AUnaryExp(new APlusUnaryOperator(node.getPlus()), (PExp) table.remove(node.getUnaryExp())));
00836         node.setUnaryExp(null);
00837         node.setPlus(null);
00838     }
00839     public void caseAPostDecrementExpPostfixExp(APostDecrementExpPostfixExp node) {
00840         table.put(node, (PExp) table.remove(node.getPostDecrementExpr()));
00841         node.setPostDecrementExpr(null);
00842     }
00843     public void caseAPostDecrementExpr(APostDecrementExpr node) {
00844         table.put(node, new APostDecrementExp((PExp) table.remove(node.getPostfixExp()), node.getMinusMinus()));
00845         node.setPostfixExp(null);
00846         node.setMinusMinus(null);
00847     }
00848     public void caseAPostDecrementExpStmtExp(APostDecrementExpStmtExp node) {
00849         table.put(node, (PExp) table.remove(node.getPostDecrementExpr()));
00850         node.setPostDecrementExpr(null);
00851     }
00852     public void caseAPostfixExpUnaryExpNotPlusMinus(APostfixExpUnaryExpNotPlusMinus node) {
00853         table.put(node, (PExp) table.remove(node.getPostfixExp()));
00854         node.setPostfixExp(null);
00855     }
00856     public void caseAPostIncrementExpPostfixExp(APostIncrementExpPostfixExp node) {
00857         table.put(node, (PExp) table.remove(node.getPostIncrementExpr()));
00858         node.setPostIncrementExpr(null);
00859     }
00860     public void caseAPostIncrementExpr(APostIncrementExpr node) {
00861         table.put(node, new APostIncrementExp((PExp) table.remove(node.getPostfixExp()), node.getPlusPlus()));
00862         node.setPostfixExp(null);
00863         node.setPlusPlus(null);
00864     }
00865     public void caseAPostIncrementExpStmtExp(APostIncrementExpStmtExp node) {
00866         table.put(node, (PExp) table.remove(node.getPostIncrementExpr()));
00867         node.setPostIncrementExpr(null);
00868     }
00869     public void caseAPreDecrementExp(APreDecrementExp node) {
00870         table.put(node, new AUnaryExp(new ADecrementUnaryOperator(node.getMinusMinus()), (PExp) table.remove(node.getUnaryExp())));
00871         node.setMinusMinus(null);
00872         node.setUnaryExp(null);
00873     }
00874     public void caseAPreDecrementExpStmtExp(APreDecrementExpStmtExp node) {
00875         table.put(node, (PExp) table.remove(node.getPreDecrementExp()));
00876         node.setPreDecrementExp(null);
00877     }
00878     public void caseAPreDecrementExpUnaryExp(APreDecrementExpUnaryExp node) {
00879         table.put(node, (PExp) table.remove(node.getPreDecrementExp()));
00880         node.setPreDecrementExp(null);
00881     }
00882     public void caseAPreIncrementExp(APreIncrementExp node) {
00883         table.put(node, new AUnaryExp(new AIncrementUnaryOperator(node.getPlusPlus()), (PExp) table.remove(node.getUnaryExp())));
00884         node.setPlusPlus(null);
00885         node.setUnaryExp(null);
00886     }
00887     public void caseAPreIncrementExpStmtExp(APreIncrementExpStmtExp node) {
00888         table.put(node, (PExp) table.remove(node.getPreIncrementExp()));
00889         node.setPreIncrementExp(null);
00890     }
00891     public void caseAPreIncrementExpUnaryExp(APreIncrementExpUnaryExp node) {
00892         table.put(node, (PExp) table.remove(node.getPreIncrementExp()));
00893         node.setPreIncrementExp(null);
00894     }
00895     public void caseAPrimaryMethodInvocation(APrimaryMethodInvocation node) {
00896         if (node.getArgumentList() != null)
00897             table.put(node, new APrimaryMethodInvocationExp((PExp) table.remove(node.getPrimary()), node.getDot(), node.getId(), node.getLPar(), (LinkedList) table.remove(node.getArgumentList()), node.getRPar()));
00898         else
00899             table.put(node, new APrimaryMethodInvocationExp((PExp) table.remove(node.getPrimary()), node.getDot(), node.getId(), node.getLPar(), new LinkedList(), node.getRPar()));
00900     }
00901     public void caseAPrimaryNoNewArrayPrimary(APrimaryNoNewArrayPrimary node) {
00902         table.put(node, (PExp) table.remove(node.getPrimaryNoNewArray()));
00903         node.setPrimaryNoNewArray(null);
00904     }
00905     public void caseAPrimaryPostfixExp(APrimaryPostfixExp node) {
00906         table.put(node, (PExp) table.remove(node.getPrimary()));
00907         node.setPrimary(null);
00908     }
00909     public void caseAPrimitiveTypeArrayCreationExp(APrimitiveTypeArrayCreationExp node) {
00910         table.put(node, new APrimitiveTypeArrayExp(node.getNew(), node.getPrimitiveType(), node.getDimExp(), node.getDim()));
00911         node.setNew(null);
00912         node.setPrimitiveType(null);
00913         node.setDimExp(new LinkedList());
00914         node.setDim(new LinkedList());
00915     }
00916     public void caseAQualifiedNameName(AQualifiedNameName node) {
00917         result = (PName) table.remove(node.getOneQualifiedName());
00918     }
00919     public void caseAQualifiedThisPrimaryNoNewArray(AQualifiedThisPrimaryNoNewArray node) {
00920         table.put(node, new AQualifiedThisExp(node.getName(), node.getDot(), node.getThis()));
00921         node.setName(null);
00922         node.setDot(null);
00923         node.setThis(null);
00924     }
00925     public void caseAQuestionConditionalExp(AQuestionConditionalExp node) {
00926         table.put(node, new AQuestionExp((PExp) table.remove(node.getConditionalOrExp()), node.getQuestion(), node.getExp(), node.getColon(), (PExp) table.remove(node.getConditionalExp())));
00927         node.setConditionalOrExp(null);
00928         node.setQuestion(null);
00929         node.setExp(null);
00930         node.setColon(null);
00931         node.setConditionalExp(null);
00932     }
00933     public void caseARelationalExpEqualityExp(ARelationalExpEqualityExp node) {
00934         table.put(node, (PExp) table.remove(node.getRelationalExp()));
00935         node.setRelationalExp(null);
00936     }
00937     public void caseAReturnStmtStmtWithoutTrailingSubstmt(AReturnStmtStmtWithoutTrailingSubstmt node) {
00938         table.put(node, (PStmt) table.remove(node.getOneReturnStmt()));
00939         node.setOneReturnStmt(null);
00940     }
00941     public void caseASemicolonStmt(ASemicolonStmt node) {
00942         table.put(node, new AEmptyStmt(node.getSemicolon()));
00943         node.setSemicolon(null);
00944     }
00945     public void caseAShiftExpRelationalExp(AShiftExpRelationalExp node) {
00946         table.put(node, (PExp) table.remove(node.getShiftExp()));
00947         node.setShiftExp(null);
00948     }
00949     public void caseAShiftLeftShiftExp(AShiftLeftShiftExp node) {
00950         table.put(node, new ABinaryExp((PExp) table.remove(node.getShiftExp()), new AShiftLeftBinaryOperator(node.getShiftLeft()), (PExp) table.remove(node.getAdditiveExp())));
00951         node.setShiftExp(null);
00952         node.setShiftLeft(null);
00953         node.setAdditiveExp(null);
00954     }
00955     public void caseAShortIntegralType(AShortIntegralType node) {
00956         table.put(node, new AShortPrimitiveType(node.getShort()));
00957         node.setShort(null);
00958     }
00959     public void caseASignedShiftRightShiftExp(ASignedShiftRightShiftExp node) {
00960         table.put(node, new ABinaryExp((PExp) table.remove(node.getShiftExp()), new ASignedShiftRightBinaryOperator(node.getSignedShiftRight()), (PExp) table.remove(node.getAdditiveExp())));
00961         node.setShiftExp(null);
00962         node.setSignedShiftRight(null);
00963         node.setAdditiveExp(null);
00964     }
00965     public void caseASimpleNameName(ASimpleNameName node) {
00966         result = (PName) table.remove(node.getOneSimpleName());
00967     }
00968     public void caseASingleTypeImportDeclarationImportDeclaration(ASingleTypeImportDeclarationImportDeclaration node) {
00969         result = (PImportDeclaration) table.remove(node.getOneSingleTypeImportDeclaration());
00970     }
00971     public void caseAStarMultiplicativeExp(AStarMultiplicativeExp node) {
00972         table.put(node, new ABinaryExp((PExp) table.remove(node.getMultiplicativeExp()), new AStarBinaryOperator(node.getStar()), (PExp) table.remove(node.getUnaryExp())));
00973         node.setMultiplicativeExp(null);
00974         node.setStar(null);
00975         node.setUnaryExp(null);
00976     }
00977     public void caseAStaticInitializer(AStaticInitializer node) {
00978         table.put(node, new AStaticInitializerClassBodyDeclaration(node.getStatic(), node.getBlock()));
00979         node.setStatic(null);
00980         node.setBlock(null);
00981     }
00982     public void caseAStmtExpListForInit(AStmtExpListForInit node) {
00983         result = new AExpListForInit((LinkedList) table.remove(node.getStmtExpList()));
00984     }
00985     public void caseAStmtExpListStmtExpList(AStmtExpListStmtExpList node) {
00986         LinkedList list = (LinkedList) table.remove(node.getStmtExpList());
00987         list.add((PExp) table.remove(node.getStmtExp()));
00988         table.put(node, list);
00989         node.setStmtExpList(null);
00990         node.setComma(null);
00991         node.setStmtExp(null);
00992     }
00993     public void caseAStmtExpStmtExpList(AStmtExpStmtExpList node) {
00994         LinkedList list = new LinkedList();
00995         list.add((PExp) table.remove(node.getStmtExp()));
00996         table.put(node, list);
00997         node.setStmtExp(null);
00998     }
00999     public void caseAStmtWithoutTrailingSubstmtStmt(AStmtWithoutTrailingSubstmtStmt node) {
01000         result = (PStmt) table.remove(node.getStmtWithoutTrailingSubstmt());
01001     }
01002     public void caseAStmtWithoutTrailingSubstmtStmtNoShortIf(AStmtWithoutTrailingSubstmtStmtNoShortIf node) {
01003         table.put(node, (PStmt) table.remove(node.getStmtWithoutTrailingSubstmt()));
01004         node.setStmtWithoutTrailingSubstmt(null);
01005     }
01006     public void caseASuperMethodInvocation(ASuperMethodInvocation node) {
01007         if (node.getArgumentList() != null)
01008             table.put(node, new ASuperMethodInvocationExp(node.getSuper(), node.getDot(), node.getId(), node.getLPar(), (LinkedList) table.remove(node.getArgumentList()), node.getRPar()));
01009         else
01010             table.put(node, new ASuperMethodInvocationExp(node.getSuper(), node.getDot(), node.getId(), node.getLPar(), new LinkedList(), node.getRPar()));
01011     }
01012     public void caseASwitchStmtStmtWithoutTrailingSubstmt(ASwitchStmtStmtWithoutTrailingSubstmt node) {
01013         table.put(node, (PStmt) table.remove(node.getOneSwitchStmt()));
01014         node.setOneSwitchStmt(null);
01015     }
01016     public void caseASynchronizedStmtStmtWithoutTrailingSubstmt(ASynchronizedStmtStmtWithoutTrailingSubstmt node) {
01017         table.put(node, (PStmt) table.remove(node.getOneSynchronizedStmt()));
01018         node.setOneSynchronizedStmt(null);
01019     }
01020     public void caseAThisPrimaryNoNewArray(AThisPrimaryNoNewArray node) {
01021         table.put(node, new AThisExp(node.getThis()));
01022         node.setThis(null);
01023     }
01024     public void caseAThrowStmtStmtWithoutTrailingSubstmt(AThrowStmtStmtWithoutTrailingSubstmt node) {
01025         table.put(node, (PStmt) table.remove(node.getOneThrowStmt()));
01026         node.setOneThrowStmt(null);
01027     }
01028     public void caseATryOneTryStmt(ATryOneTryStmt node) {
01029         table.put(node, new ATryStmt(node.getTry(), node.getBlock(), node.getCatchClause()));
01030         node.setTry(null);
01031         node.setBlock(null);
01032         node.setCatchClause((new LinkedList()));
01033     }
01034     public void caseATryStmtStmtWithoutTrailingSubstmt(ATryStmtStmtWithoutTrailingSubstmt node) {
01035         table.put(node, (PStmt) table.remove(node.getOneTryStmt()));
01036         node.setOneTryStmt(null);
01037     }
01038     public void caseATypeImportOnDemandDeclarationImportDeclaration(ATypeImportOnDemandDeclarationImportDeclaration node) {
01039         result = (PImportDeclaration) table.remove(node.getOneTypeImportOnDemandDeclaration());
01040     }
01041     public void caseAUnaryExpMultiplicativeExp(AUnaryExpMultiplicativeExp node) {
01042         table.put(node, (PExp) table.remove(node.getUnaryExp()));
01043         node.setUnaryExp(null);
01044     }
01045     public void caseAUnsignedShiftRightShiftExp(AUnsignedShiftRightShiftExp node) {
01046         table.put(node, new ABinaryExp((PExp) table.remove(node.getShiftExp()), new AUnsignedShiftRightBinaryOperator(node.getUnsignedShiftRight()), (PExp) table.remove(node.getAdditiveExp())));
01047         node.setShiftExp(null);
01048         node.setUnsignedShiftRight(null);
01049         node.setAdditiveExp(null);
01050     }
01051     public void caseAVariableDeclaratorsVariableDeclarators(AVariableDeclaratorsVariableDeclarators node) {
01052         LinkedList list = (LinkedList) table.remove(node.getVariableDeclarators());
01053         list.add(node.getVariableDeclarator());
01054         table.put(node, list);
01055         node.setVariableDeclarators(null);
01056         node.setComma(null);
01057         node.setVariableDeclarator(null);
01058     }
01059     public void caseAVariableDeclaratorVariableDeclarators(AVariableDeclaratorVariableDeclarators node) {
01060         LinkedList list = new LinkedList();
01061         list.add(node.getVariableDeclarator());
01062         table.put(node, list);
01063         node.setVariableDeclarator(null);
01064     }
01065     public void caseAVariableInitializersVariableInitializers(AVariableInitializersVariableInitializers node) {
01066         LinkedList list = (LinkedList) table.remove(node.getVariableInitializers());
01067         list.add(node.getVariableInitializer());
01068         table.put(node, list);
01069         node.setVariableInitializers(null);
01070         node.setComma(null);
01071         node.setVariableInitializer(null);
01072     }
01073     public void caseAVariableInitializerVariableInitializers(AVariableInitializerVariableInitializers node) {
01074         LinkedList list = new LinkedList();
01075         list.add(node.getVariableInitializer());
01076         table.put(node, list);
01077         node.setVariableInitializer(null);
01078     }
01079     public void caseAVoidPrimaryNoNewArray(AVoidPrimaryNoNewArray node) {
01080         table.put(node, new AVoidExp(node.getVoid(), node.getDot(), node.getTClass()));
01081         node.setVoid(null);
01082         node.setDot(null);
01083         node.setTClass(null);
01084     }
01085     public void caseAWhileStmtNoShortIf(AWhileStmtNoShortIf node) {
01086         // list of PBlockedStmt (i.e. AStmtBlockedStmt)
01087         LinkedList list = new LinkedList();
01088         list.add(new AStmtBlockedStmt((PStmt) table.remove(node.getStmtNoShortIf())));
01089         table.put(node, new AWhileStmt(node.getWhile(), node.getLPar(), node.getExp(), node.getRPar(), new ABlock(new TLBrace(), list, new TRBrace())));
01090         node.setWhile(null);
01091         node.setLPar(null);
01092         node.setExp(null);
01093         node.setRPar(null);
01094         node.setStmtNoShortIf(null);
01095     }
01096     public void caseAWhileStmtNoShortIfStmtNoShortIf(AWhileStmtNoShortIfStmtNoShortIf node) {
01097         table.put(node, (PStmt) table.remove(node.getWhileStmtNoShortIf()));
01098         node.setWhileStmtNoShortIf(null);
01099     }
01100     public void caseAWhileStmtStmt(AWhileStmtStmt node) {
01101         result = (PStmt) table.remove(node.getOneWhileStmt());
01102     }
01103     Node fix(Node node) {
01104         result = null;
01105         node.apply(this);
01106         return (result == null) ? node : result;
01107     }
01108 }

Generated at Thu Feb 7 06:39:54 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001