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

Grimp.java

00001 package ca.mcgill.sable.soot.grimp;
00002 
00003 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00004  * Grimp, an aggregated-expression Java(TM) bytecode representation. *
00005  * Copyright (C) 1998 Patrick Lam (plam@sable.mcgill.ca)             *
00006  * All rights reserved.                                              *
00007  *                                                                   *
00008  * Modifications by Raja Vallee-Rai (plam@sable.mcgill.ca) are           *
00009  * Copyright (C) 1999 Raja Vallee-Rai.  All rights reserved.             *
00010  *                                                                   *
00011  * This work was done as a project of the Sable Research Group,      *
00012  * School of Computer Science, McGill University, Canada             *
00013  * (http://www.sable.mcgill.ca/).  It is understood that any         *
00014  * modification not identified as such is not covered by the         *
00015  * preceding statement.                                              *
00016  *                                                                   *
00017  * This work is free software; you can redistribute it and/or        *
00018  * modify it under the terms of the GNU Library General Public       *
00019  * License as published by the Free Software Foundation; either      *
00020  * version 2 of the License, or (at your option) any later version.  *
00021  *                                                                   *
00022  * This work is distributed in the hope that it will be useful,      *
00023  * but WITHOUT ANY WARRANTY; without even the implied warranty of    *
00024  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *
00025  * Library General Public License for more details.                  *
00026  *                                                                   *
00027  * You should have received a copy of the GNU Library General Public *
00028  * License along with this library; if not, write to the             *
00029  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,      *
00030  * Boston, MA  02111-1307, USA.                                      *
00031  *                                                                   *
00032  * Java is a trademark of Sun Microsystems, Inc.                     *
00033  *                                                                   *
00034  * To submit a bug report, send a comment, or get the latest news on *
00035  * this project and other Sable Research Group projects, please      *
00036  * visit the web site: http://www.sable.mcgill.ca/                   *
00037  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00038 
00039 /*
00040  Reference Version
00041  -----------------
00042  This is the latest official version on which this file is based.
00043  The reference version is: $SootVersion: 1.beta.4 $
00044 
00045  Change History
00046  --------------
00047  A) Notes:
00048 
00049  Please use the following template.  Most recent changes should
00050  appear at the top of the list.
00051 
00052  - Modified on [date (March 1, 1900)] by [name]. [(*) if appropriate]
00053    [description of modification].
00054 
00055  Any Modification flagged with "(*)" was done as a project of the
00056  Sable Research Group, School of Computer Science,
00057  McGill University, Canada (http://www.sable.mcgill.ca/).
00058 
00059  You should add your copyright, using the following template, at
00060  the top of this file, along with other copyrights.
00061 
00062  *                                                                   *
00063  * Modifications by [name] are                                       *
00064  * Copyright (C) [year(s)] [your name (or company)].  All rights     *
00065  * reserved.                                                         *
00066  *                                                                   *
00067 
00068  B) Changes:
00069 
00070  - Modified on March 1, 1999 by Raja Vallee-Rai (rvalleerai@sable.mcgill.ca) (*)
00071    Renamed ConstructExpr to NewInvokeExpr.
00072 
00073  - Modified on February 3, 1999 by Patrick Lam (plam@sable.mcgill.ca). (*)
00074    First release of Grimp.
00075 */
00076 
00077 import ca.mcgill.sable.soot.*;
00078 import ca.mcgill.sable.soot.jimple.*;
00079 import ca.mcgill.sable.util.*;
00080 import java.io.*;
00081 
00082 /**
00083     The Grimp class contains all the constructors for the components of the Grimp
00084     grammar for the Grimp body. <br><br>
00085 
00086     Immediate -> Local | Constant <br>
00087     RValue -> Local | Constant | ConcreteRef | Expr<br>
00088     Variable -> Local | ArrayRef | InstanceFieldRef | StaticFieldRef <br>
00089  */
00090 
00091 
00092 public class Grimp implements JimpleRepresentation
00093 {
00094     private static Grimp grimpRepresentation = new Grimp();
00095 
00096     protected Grimp()
00097     {
00098     }
00099     public Body buildBodyOfFrom(SootMethod m, Body b, int buildBodyOptions)
00100     {
00101         return new GrimpBody(m, b, buildBodyOptions);
00102     }
00103     /**
00104         Constructs a AddExpr(Expr, Expr) grammar chunk.
00105      */
00106 
00107     public AddExpr newAddExpr(Value op1, Value op2)
00108     {
00109         return new GAddExpr(op1, op2);
00110     }
00111     /**
00112         Constructs a AndExpr(Expr, Expr) grammar chunk.
00113      */
00114 
00115     public AndExpr newAndExpr(Value op1, Value op2)
00116     {
00117         return new GAndExpr(op1, op2);
00118     }
00119     public ValueBox newArgBox(Value value)
00120     {
00121     return new ExprBox(value);
00122     }
00123     /**
00124         Constructs a ArrayRef(Local, Expr) grammar chunk.
00125      */
00126 
00127     public ArrayRef newArrayRef(Value base, Value index)
00128     {
00129         return new GArrayRef(base, index);
00130     }
00131     public AssignStmt newAssignStmt(AssignStmt s)
00132     {
00133     return new GAssignStmt(s.getLeftOp(), s.getRightOp());
00134     }
00135     /**
00136         Constructs a AssignStmt(Variable, RValue) grammar chunk.
00137      */
00138 
00139     public AssignStmt newAssignStmt(Value variable, Value rvalue)
00140     {
00141         return new GAssignStmt(variable, rvalue);
00142     }
00143     /**
00144         Constructs an empty GrimpBody for the given method.
00145      */
00146      
00147     public Body newBody(SootMethod m)
00148     {
00149         return new GrimpBody(m);
00150     }
00151     /**
00152         Constructs a BreakpointStmt() grammar chunk.
00153      */
00154 
00155     public BreakpointStmt newBreakpointStmt()
00156     {
00157         return Jimple.v().newBreakpointStmt();
00158     }
00159     public BreakpointStmt newBreakpointStmt(BreakpointStmt s)
00160     {
00161     return Jimple.v().newBreakpointStmt();
00162     }
00163     /**
00164         Constructs a CastExpr(Expr, Type) grammar chunk.
00165      */
00166 
00167     public CastExpr newCastExpr(Value op1, Type t)
00168     {
00169         return new GCastExpr(op1, t);
00170     }
00171     /**
00172         Constructs a CaughtExceptionRef() grammar chunk.
00173      */
00174 
00175     public CaughtExceptionRef newCaughtExceptionRef(JimpleBody b)
00176     {
00177         return Jimple.v().newCaughtExceptionRef(b);
00178     }
00179     /**
00180         Constructs a CmpExpr(Expr, Expr) grammar chunk.
00181      */
00182 
00183     public CmpExpr newCmpExpr(Value op1, Value op2)
00184     {
00185         return new GCmpExpr(op1, op2);
00186     }
00187     /**
00188         Constructs a CmpgExpr(Expr, Expr) grammar chunk.
00189      */
00190 
00191     public CmpgExpr newCmpgExpr(Value op1, Value op2)
00192     {
00193         return new GCmpgExpr(op1, op2);
00194     }
00195     /**
00196         Constructs a CmplExpr(Expr, Expr) grammar chunk.
00197      */
00198 
00199     public CmplExpr newCmplExpr(Value op1, Value op2)
00200     {
00201         return new GCmplExpr(op1, op2);
00202     }
00203     public ValueBox newConditionExprBox(Value value)
00204     {
00205         return Jimple.v().newConditionExprBox(value);
00206     }
00207     /**
00208         Constructs a DivExpr(Expr, Expr) grammar chunk.
00209      */
00210 
00211     public DivExpr newDivExpr(Value op1, Value op2)
00212     {
00213         return new GDivExpr(op1, op2);
00214     }
00215     public EnterMonitorStmt newEnterMonitorStmt(EnterMonitorStmt s)
00216     {
00217     return new GEnterMonitorStmt(s.getOp());
00218     }
00219     /**
00220         Constructs a EnterMonitorStmt(Expr) grammar chunk.
00221      */
00222 
00223     public EnterMonitorStmt newEnterMonitorStmt(Value op)
00224     {
00225         return new GEnterMonitorStmt(op);
00226     }
00227     /**
00228         Constructs a EqExpr(Expr, Expr) grammar chunk.
00229      */
00230 
00231     public EqExpr newEqExpr(Value op1, Value op2)
00232     {
00233         return new GEqExpr(op1, op2);
00234     }
00235     public ExitMonitorStmt newExitMonitorStmt(ExitMonitorStmt s)
00236     {
00237     return new GExitMonitorStmt(s.getOp());
00238     }
00239     /**
00240         Constructs a ExitMonitorStmt(Expr) grammar chunk
00241      */
00242 
00243     public ExitMonitorStmt newExitMonitorStmt(Value op)
00244     {
00245         return new GExitMonitorStmt(op);
00246     }
00247     /** Carries out the mapping from other Value's to Grimp Value's */
00248     public Value newExpr(Value value)
00249     {
00250     if (value instanceof Expr)
00251         {
00252         final ExprBox returnedExpr = new ExprBox(IntConstant.v(0));
00253         ((Expr)value).apply(new AbstractExprSwitch()
00254         {
00255             public void caseAddExpr(AddExpr v)
00256             {
00257             returnedExpr.setValue
00258                 (newAddExpr(newExpr(v.getOp1()),
00259                     newExpr(v.getOp2())));
00260             }
00261 
00262             public void caseAndExpr(AndExpr v)
00263             {
00264             returnedExpr.setValue
00265                 (newAndExpr(newExpr(v.getOp1()),
00266                     newExpr(v.getOp2())));
00267             }
00268 
00269             public void caseCmpExpr(CmpExpr v)
00270             {
00271             returnedExpr.setValue
00272                 (newCmpExpr(newExpr(v.getOp1()),
00273                     newExpr(v.getOp2())));
00274             }
00275 
00276             public void caseCmpgExpr(CmpgExpr v)
00277             {
00278             returnedExpr.setValue
00279                 (newCmpgExpr(newExpr(v.getOp1()),
00280                     newExpr(v.getOp2())));
00281             }
00282 
00283             public void caseCmplExpr(CmplExpr v)
00284             {
00285             returnedExpr.setValue
00286                 (newCmplExpr(newExpr(v.getOp1()),
00287                     newExpr(v.getOp2())));
00288             }
00289 
00290             public void caseDivExpr(DivExpr v)
00291             {
00292             returnedExpr.setValue
00293                 (newDivExpr(newExpr(v.getOp1()),
00294                     newExpr(v.getOp2())));
00295             }
00296 
00297             public void caseEqExpr(EqExpr v)
00298             {
00299             returnedExpr.setValue
00300                 (newEqExpr(newExpr(v.getOp1()),
00301                     newExpr(v.getOp2())));
00302             }
00303 
00304             public void caseNeExpr(NeExpr v)
00305             {
00306             returnedExpr.setValue
00307                 (newNeExpr(newExpr(v.getOp1()),
00308                     newExpr(v.getOp2())));
00309             }
00310 
00311             public void caseGeExpr(GeExpr v)
00312             {
00313             returnedExpr.setValue
00314                 (newGeExpr(newExpr(v.getOp1()),
00315                     newExpr(v.getOp2())));
00316             }
00317 
00318             public void caseGtExpr(GtExpr v)
00319             {
00320             returnedExpr.setValue
00321                 (newGtExpr(newExpr(v.getOp1()),
00322                     newExpr(v.getOp2())));
00323             }
00324 
00325             public void caseLeExpr(LeExpr v)
00326             {
00327             returnedExpr.setValue
00328                 (newLeExpr(newExpr(v.getOp1()),
00329                     newExpr(v.getOp2())));
00330             }
00331 
00332             public void caseLtExpr(LtExpr v)
00333             {
00334             returnedExpr.setValue
00335                 (newLtExpr(newExpr(v.getOp1()),
00336                     newExpr(v.getOp2())));
00337             }
00338 
00339             public void caseMulExpr(MulExpr v)
00340             {
00341             returnedExpr.setValue
00342                 (newMulExpr(newExpr(v.getOp1()),
00343                     newExpr(v.getOp2())));
00344             }
00345 
00346             public void caseOrExpr(OrExpr v)
00347             {
00348             returnedExpr.setValue
00349                 (newOrExpr(newExpr(v.getOp1()),
00350                     newExpr(v.getOp2())));
00351             }
00352 
00353             public void caseRemExpr(RemExpr v)
00354             {
00355             returnedExpr.setValue
00356                 (newRemExpr(newExpr(v.getOp1()),
00357                     newExpr(v.getOp2())));
00358             }
00359 
00360             public void caseShlExpr(ShlExpr v)
00361             {
00362             returnedExpr.setValue
00363                 (newShlExpr(newExpr(v.getOp1()),
00364                     newExpr(v.getOp2())));
00365             }
00366 
00367             public void caseShrExpr(ShrExpr v)
00368             {
00369             returnedExpr.setValue
00370                 (newShrExpr(newExpr(v.getOp1()),
00371                     newExpr(v.getOp2())));
00372             }
00373 
00374             public void caseUshrExpr(UshrExpr v)
00375             {
00376             returnedExpr.setValue
00377                 (newUshrExpr(newExpr(v.getOp1()),
00378                     newExpr(v.getOp2())));
00379             }
00380 
00381             public void caseSubExpr(SubExpr v)
00382             {
00383             returnedExpr.setValue
00384                 (newSubExpr(newExpr(v.getOp1()),
00385                     newExpr(v.getOp2())));
00386             }
00387 
00388             public void caseXorExpr(XorExpr v)
00389             {
00390             returnedExpr.setValue
00391                 (newXorExpr(newExpr(v.getOp1()),
00392                     newExpr(v.getOp2())));
00393             }
00394 
00395             public void caseInterfaceInvokeExpr(InterfaceInvokeExpr v)
00396             {
00397             ArrayList newArgList = new ArrayList();
00398             for (int i = 0; i < v.getArgCount(); i++)
00399                 newArgList.add(newExpr(v.getArg(i)));
00400             returnedExpr.setValue
00401                 (newInterfaceInvokeExpr((Local)(v.getBase()),
00402                             v.getMethod(),
00403                             newArgList));
00404             }
00405 
00406             public void caseSpecialInvokeExpr(SpecialInvokeExpr v)
00407             {
00408             ArrayList newArgList = new ArrayList();
00409             for (int i = 0; i < v.getArgCount(); i++)
00410                 newArgList.add(newExpr(v.getArg(i)));
00411             returnedExpr.setValue
00412                 (newSpecialInvokeExpr((Local)(v.getBase()),
00413                             v.getMethod(),
00414                             newArgList));
00415             }
00416 
00417             public void caseStaticInvokeExpr(StaticInvokeExpr v)
00418             {
00419             ArrayList newArgList = new ArrayList();
00420             for (int i = 0; i < v.getArgCount(); i++)
00421                 newArgList.add(newExpr(v.getArg(i)));
00422             returnedExpr.setValue
00423                 (newStaticInvokeExpr(v.getMethod(),
00424                          newArgList));
00425             }
00426 
00427             public void caseVirtualInvokeExpr(VirtualInvokeExpr v)
00428             {
00429             ArrayList newArgList = new ArrayList();
00430             for (int i = 0; i < v.getArgCount(); i++)
00431                 newArgList.add(newExpr(v.getArg(i)));
00432             returnedExpr.setValue
00433                 (newVirtualInvokeExpr((Local)(v.getBase()),
00434                           v.getMethod(),
00435                           newArgList));
00436             }
00437 
00438             public void caseCastExpr(CastExpr v)
00439             {
00440             returnedExpr.setValue(newCastExpr(newExpr(v.getOp()),
00441                               v.getType()));
00442             }
00443 
00444             public void caseInstanceOfExpr(InstanceOfExpr v)
00445             {
00446             returnedExpr.setValue(newInstanceOfExpr
00447                           (newExpr(v.getOp()),
00448                            v.getCheckType()));
00449             }
00450 
00451             public void caseNewArrayExpr(NewArrayExpr v)
00452             {
00453             returnedExpr.setValue(newNewArrayExpr(v.getBaseType(),
00454                           v.getSize()));
00455             }
00456 
00457             public void caseNewMultiArrayExpr(NewMultiArrayExpr v)
00458             {
00459             returnedExpr.setValue(newNewMultiArrayExpr
00460                           (v.getBaseType(),
00461                           v.getSizes()));
00462             }
00463 
00464             public void caseNewExpr(NewExpr v)
00465             {
00466             returnedExpr.setValue(newNewExpr(v.getBaseType()));
00467             }
00468 
00469             public void caseLengthExpr(LengthExpr v)
00470             {
00471             returnedExpr.setValue(newLengthExpr
00472                           (newExpr(v.getOp())));
00473             }
00474 
00475             public void caseNegExpr(NegExpr v)
00476             {
00477             returnedExpr.setValue(newNegExpr(newExpr(v.getOp())));
00478             }
00479 
00480             public void defaultCase(Object v)
00481             {
00482             returnedExpr.setValue((Expr)v);
00483             }           
00484         });
00485         return returnedExpr.getValue();
00486         }
00487     else 
00488         {
00489         if (value instanceof ArrayRef)
00490             return newArrayRef(((ArrayRef)value).getBase(), 
00491                        newExpr(((ArrayRef)value).getIndex()));
00492         if (value instanceof InstanceFieldRef)
00493             return newInstanceFieldRef
00494             (newExpr((((InstanceFieldRef)value).getBase())),
00495              ((InstanceFieldRef)value).getField());
00496         /* have Ref/Value, which is fine -- not Jimple-specific. */
00497         return value;
00498         }
00499     }
00500     public ValueBox newExprBox(Value value)
00501     {
00502         return new ExprBox(value);
00503     }
00504     /**
00505         Constructs a GeExpr(Expr, Expr) grammar chunk.
00506      */
00507 
00508     public GeExpr newGeExpr(Value op1, Value op2)
00509     {
00510         return new GGeExpr(op1, op2);
00511     }
00512     public GotoStmt newGotoStmt(GotoStmt s)
00513     {
00514     return Jimple.v().newGotoStmt(s.getTarget());
00515     }
00516     /**
00517         Constructs a GotoStmt(Stmt) grammar chunk.
00518      */
00519 
00520     public GotoStmt newGotoStmt(Unit target)
00521     {
00522         return Jimple.v().newGotoStmt(target);
00523     }
00524     /**
00525         Constructs a GtExpr(Expr, Expr) grammar chunk.
00526      */
00527 
00528     public GtExpr newGtExpr(Value op1, Value op2)
00529     {
00530         return new GGtExpr(op1, op2);
00531     }
00532     public ValueBox newIdentityRefBox(Value value)
00533     {
00534         return Jimple.v().newIdentityRefBox(value);
00535     }
00536     public IdentityStmt newIdentityStmt(IdentityStmt s)
00537     {
00538     return new GIdentityStmt(s.getLeftOp(), s.getRightOp());
00539     }
00540     /**
00541         Constructs a IdentityStmt(Local, IdentityRef) grammar chunk.
00542      */
00543 
00544     public IdentityStmt newIdentityStmt(Value local, Value identityRef)
00545     {
00546         return new GIdentityStmt(local, identityRef);
00547     }
00548     public IfStmt newIfStmt(IfStmt s)
00549     {
00550     return new GIfStmt(s.getCondition(), s.getTarget());
00551     }
00552     /**
00553         Constructs a IfStmt(Condition, Stmt) grammar chunk.
00554      */
00555 
00556     public IfStmt newIfStmt(Value condition, Unit target)
00557     {
00558         return new GIfStmt(condition, target);
00559     }
00560     public ValueBox newImmediateBox(Value value)
00561     {
00562         return Jimple.v().newImmediateBox(value);
00563     }
00564     /**
00565         Constructs a NextNextStmtRef() grammar chunk.
00566      */
00567 
00568 /*
00569     public NextNextStmtRef newNextNextStmtRef()
00570     {
00571         return Jimple.v().newNextNextStmtRef();
00572     }
00573 */
00574 
00575 
00576     /**
00577         Constructs a InstanceFieldRef(Value, SootField) grammar chunk.
00578      */
00579 
00580     public InstanceFieldRef newInstanceFieldRef(Value base, SootField f)
00581     {
00582         return new GInstanceFieldRef(base, f);
00583     }
00584     /**
00585         Constructs a InstanceOfExpr(Expr, Type)
00586         grammar chunk.
00587      */
00588 
00589     public InstanceOfExpr newInstanceOfExpr(Value op1, Type t)
00590     {
00591         return new GInstanceOfExpr(op1, t);
00592     }
00593     /**
00594         Constructs a InterfaceInvokeExpr(Local base, SootMethod method, List of Expr) grammar chunk.
00595      */
00596 
00597     public InterfaceInvokeExpr newInterfaceInvokeExpr(Local base, SootMethod method, List args)
00598     {
00599         return new GInterfaceInvokeExpr(base, method, args);
00600     }
00601     public ValueBox newInvokeExprBox(Value value)
00602     {
00603         return Jimple.v().newInvokeExprBox(value);
00604     }
00605     public InvokeStmt newInvokeStmt(InvokeStmt s)
00606     {
00607     return new GInvokeStmt(s.getInvokeExpr());
00608     }
00609     /**
00610         Constructs a InvokeStmt(InvokeExpr) grammar chunk.
00611      */
00612 
00613     public InvokeStmt newInvokeStmt(Value op)
00614     {
00615         return new GInvokeStmt(op);
00616     }
00617     /**
00618         Constructs a LeExpr(Expr, Expr) grammar chunk.
00619      */
00620 
00621     public LeExpr newLeExpr(Value op1, Value op2)
00622     {
00623         return new GLeExpr(op1, op2);
00624     }
00625     /**
00626         Constructs a LengthExpr(Expr) grammar chunk.
00627      */
00628 
00629     public LengthExpr newLengthExpr(Value op)
00630     {
00631         return new GLengthExpr(op);
00632     }
00633     /**
00634         Constructs a Local with the given name and type.
00635     */
00636 
00637     public Local newLocal(String name, Type t)
00638     {
00639         return Jimple.v().newLocal(name, t);
00640     }
00641     public ValueBox newLocalBox(Value value)
00642     {
00643         return Jimple.v().newLocalBox(value);
00644     }
00645     public LookupSwitchStmt newLookupSwitchStmt(LookupSwitchStmt s)
00646     {
00647     return new GLookupSwitchStmt(s.getKey(), s.getLookupValues(),
00648                      s.getTargets(), s.getDefaultTarget());
00649     }
00650     /**
00651         Constructs a LookupSwitchStmt(Expr, List of Expr, List of Unit, Stmt) grammar chunk.
00652      */
00653 
00654     public LookupSwitchStmt newLookupSwitchStmt(Value key, List lookupValues, List targets, Unit defaultTarget)
00655     {
00656         return new GLookupSwitchStmt(key, lookupValues, targets, defaultTarget);
00657     }
00658     /**
00659         Constructs a LtExpr(Expr, Expr) grammar chunk.
00660      */
00661 
00662     public LtExpr newLtExpr(Value op1, Value op2)
00663     {
00664         return new GLtExpr(op1, op2);
00665     }
00666     /**
00667         Constructs a MulExpr(Expr, Expr) grammar chunk.
00668      */
00669 
00670     public MulExpr newMulExpr(Value op1, Value op2)
00671     {
00672         return new GMulExpr(op1, op2);
00673     }
00674     /**
00675         Constructs a NeExpr(Expr, Expr) grammar chunk.
00676      */
00677 
00678     public NeExpr newNeExpr(Value op1, Value op2)
00679     {
00680         return new GNeExpr(op1, op2);
00681     }
00682     /**
00683         Constructs a NegExpr(Expr, Expr) grammar chunk.
00684      */
00685 
00686     public NegExpr newNegExpr(Value op)
00687     {
00688         return new GNegExpr(op);
00689     }
00690     /**
00691         Constructs a NewArrayExpr(Type, Expr) grammar chunk.
00692      */
00693 
00694     public NewArrayExpr newNewArrayExpr(Type type, Value size)
00695     {
00696         return new GNewArrayExpr(type, size);
00697     }
00698     /**
00699         Constructs a NewExpr(RefType) grammar chunk.
00700      */
00701 
00702     NewExpr newNewExpr(RefType type)
00703     {
00704     return Jimple.v().newNewExpr(type);
00705     }
00706     /**
00707         Constructs a NewInvokeExpr(Local base, List of Expr) grammar chunk.
00708      */
00709 
00710     public NewInvokeExpr newNewInvokeExpr(RefType base, SootMethod method, List args)
00711     {
00712         return new GNewInvokeExpr(base, method, args);
00713     }
00714     /**
00715         Constructs a NewMultiArrayExpr(ArrayType, List of Expr) grammar chunk.
00716      */
00717 
00718     public NewMultiArrayExpr newNewMultiArrayExpr(ArrayType type, List sizes)
00719     {
00720         return new GNewMultiArrayExpr(type, sizes);
00721     }
00722     /**
00723         Constructs a NopStmt() grammar chunk.
00724      */
00725 
00726     public NopStmt newNopStmt()
00727     {
00728         return Jimple.v().newNopStmt();
00729     }
00730     public NopStmt newNopStmt(NopStmt s)
00731     {
00732         return Jimple.v().newNopStmt();
00733     }
00734     public ValueBox newObjExprBox(Value value)
00735     {
00736         return new ObjExprBox(value);
00737     }
00738     /**
00739         Constructs a OrExpr(Expr, Expr) grammar chunk.
00740      */
00741 
00742     public OrExpr newOrExpr(Value op1, Value op2)
00743     {
00744         return new GOrExpr(op1, op2);
00745     }
00746     /**
00747         Constructs a ParameterRef(SootMethod, int) grammar chunk.
00748      */
00749 
00750     public ParameterRef newParameterRef(SootMethod m, int number)
00751     {
00752         return Jimple.v().newParameterRef(m, number);
00753     }
00754     /**
00755         Constructs a RemExpr(Expr, Expr) grammar chunk.
00756      */
00757 
00758     public RemExpr newRemExpr(Value op1, Value op2)
00759     {
00760         return new GRemExpr(op1, op2);
00761     }
00762     public RetStmt newRetStmt(RetStmt s)
00763     {
00764     return new GRetStmt(s.getStmtAddress());
00765     }
00766     /**
00767         Constructs a RetStmt(Local) grammar chunk.
00768      */
00769 
00770     public RetStmt newRetStmt(Value stmtAddress)
00771     {
00772         return new GRetStmt(stmtAddress);
00773     }
00774     public ReturnStmt newReturnStmt(ReturnStmt s)
00775     {
00776     return new GReturnStmt(s.getReturnValue());
00777     }
00778     /**
00779         Constructs a ReturnStmt(Expr) grammar chunk.
00780      */
00781 
00782     public ReturnStmt newReturnStmt(Value op)
00783     {
00784         return new GReturnStmt(op);
00785     }
00786     /**
00787         Constructs a ReturnVoidStmt() grammar chunk.
00788      */
00789 
00790     public ReturnVoidStmt newReturnVoidStmt()
00791     {
00792         return Jimple.v().newReturnVoidStmt();
00793     }
00794     public ReturnVoidStmt newReturnVoidStmt(ReturnVoidStmt s)
00795     {
00796         return Jimple.v().newReturnVoidStmt();
00797     }
00798     public ValueBox newRValueBox(Value value)
00799     {
00800         return new GRValueBox(value);
00801     }
00802     /**
00803         Constructs a ShlExpr(Expr, Expr) grammar chunk.
00804      */
00805 
00806     public ShlExpr newShlExpr(Value op1, Value op2)
00807     {
00808         return new GShlExpr(op1, op2);
00809     }
00810     /**
00811         Constructs a ShrExpr(Expr, Expr) grammar chunk.
00812      */
00813 
00814     public ShrExpr newShrExpr(Value op1, Value op2)
00815     {
00816         return new GShrExpr(op1, op2);
00817     }
00818     /**
00819         Constructs a SpecialInvokeExpr(Local base, SootMethod method, List of Expr) grammar chunk.
00820      */
00821 
00822     public SpecialInvokeExpr newSpecialInvokeExpr(Local base, SootMethod method, List args)
00823     {
00824         return new GSpecialInvokeExpr(base, method, args);
00825     }
00826     /**
00827         Constructs a StaticFieldRef(SootField) grammar chunk.
00828      */
00829 
00830     public StaticFieldRef newStaticFieldRef(SootField f)
00831     {
00832         return Jimple.v().newStaticFieldRef(f);
00833     }
00834     /**
00835         Constructs a StaticInvokeExpr(ArrayType, List of Expr) grammar chunk.
00836      */
00837 
00838     public StaticInvokeExpr newStaticInvokeExpr(SootMethod method, List args)
00839     {
00840         return new GStaticInvokeExpr(method, args);
00841     }
00842     public UnitBox newStmtBox(Unit unit)
00843     {
00844         return Jimple.v().newStmtBox((Stmt) unit);
00845     }
00846     /**
00847         Constructs a SubExpr(Expr, Expr) grammar chunk.
00848      */
00849 
00850     public SubExpr newSubExpr(Value op1, Value op2)
00851     {
00852         return new GSubExpr(op1, op2);
00853     }
00854     public TableSwitchStmt newTableSwitchStmt(TableSwitchStmt s)
00855     {
00856     return new GTableSwitchStmt(s.getKey(), s.getLowIndex(), 
00857                     s.getHighIndex(), s.getTargets(),
00858                     s.getDefaultTarget());
00859     }
00860     /**
00861         Constructs a TableSwitchStmt(Expr, int, int, List of Unit, Stmt) grammar chunk.
00862      */
00863 
00864     public TableSwitchStmt newTableSwitchStmt(Value key, int lowIndex, int highIndex, List targets, Unit defaultTarget)
00865     {
00866         return new GTableSwitchStmt(key, lowIndex, highIndex, targets, defaultTarget);
00867     }
00868     /**
00869         Constructs a ThisRef(SootClass) grammar chunk.
00870      */
00871 
00872     public ThisRef newThisRef(SootClass c)
00873     {
00874         return Jimple.v().newThisRef(c);
00875     }
00876     public ThrowStmt newThrowStmt(ThrowStmt s)
00877     {
00878     return new GThrowStmt(s.getOp());
00879     }
00880     /**
00881         Constructs a ThrowStmt(Expr) grammar chunk.
00882      */
00883 
00884     public ThrowStmt newThrowStmt(Value op)
00885     {
00886         return new GThrowStmt(op);
00887     }
00888     public Trap newTrap(Trap trap)
00889     {
00890     return new GTrap(trap.getException(), trap.getBeginUnit(),
00891              trap.getEndUnit(), trap.getHandlerUnit());
00892     }
00893     /**
00894         Constructs a new Trap for the given exception on the given Stmt range with the given Stmt handler.
00895     */
00896 
00897     public Trap newTrap(SootClass exception, Unit beginStmt, Unit endStmt, Unit handlerStmt)
00898     {
00899         return new GTrap(exception, beginStmt, endStmt, handlerStmt);
00900     }
00901     /**
00902         Constructs a UshrExpr(Expr, Expr) grammar chunk.
00903      */
00904 
00905     public UshrExpr newUshrExpr(Value op1, Value op2)
00906     {
00907         return new GUshrExpr(op1, op2);
00908     }
00909     public ValueBox newVariableBox(Value value)
00910     {
00911         return Jimple.v().newVariableBox(value);
00912     }
00913     /**
00914         Constructs a VirtualInvokeExpr(Local base, SootMethod method, List of Expr) grammar chunk.
00915      */
00916 
00917     public VirtualInvokeExpr newVirtualInvokeExpr(Local base, SootMethod method, List args)
00918     {
00919         return new GVirtualInvokeExpr(base, method, args);
00920     }
00921     /**
00922         Constructs a XorExpr(Expr, Expr) grammar chunk.
00923      */
00924 
00925     public XorExpr newXorExpr(Value op1, Value op2)
00926     {
00927         return new GXorExpr(op1, op2);
00928     }
00929     public static Grimp v()
00930     {
00931         return grimpRepresentation;
00932     }
00933 }

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