at.dms.kjc
Class Kopi2SIR

java.lang.Object
  extended by at.dms.util.Utils
      extended by at.dms.kjc.Kopi2SIR
All Implemented Interfaces:
AttributeVisitor, DeepCloneable, Serializable, Cloneable

public class Kopi2SIR
extends Utils
implements AttributeVisitor, Cloneable

See Also:
Serialized Form

Field Summary
static String[] DO_NOT_CLONE_THESE_FIELDS
          The clone generator looks at this array to see which fields it shouldn't clone.
 
Fields inherited from class at.dms.util.Utils
EMPTY_LIST, getForLoopCallers
 
Constructor Summary
Kopi2SIR()
           
Kopi2SIR(JCompilationUnit[] app)
           
 
Method Summary
 Object deepClone()
          Returns a deep clone of this object.
protected  void deepCloneInto(Kopi2SIR other)
          Clones all fields of this into
 SIRGlobal getGlobal()
          Returns the global structure
 SIRHelper[] getHelpers()
          Returns a vector of all the SIRHelper that appeared in the program
 JInterfaceDeclaration[] getInterfaces()
          Returns a vector of all the JInterfaceDeclarations for the toplevel stream
 SIRInterfaceTable[] getInterfaceTables()
          Returns a vector of all the SIRInterfaceTables that were constructed in traversing the toplevel stream
 SIRStructure[] getStructures()
          Returns a vector of all the SIRStructures that appeared in the program
 boolean isToplevelStream(String name)
          Returns whether or not the given name represents a toplevel (void->void) stream that can be executed by itself.
 SIROperator searchForOp(String className)
          Searches for
 Object visitArrayAccessExpression(JArrayAccessExpression self, JExpression prefix, JExpression accessor)
          visits an array length expression
 Object visitArrayInitializer(JArrayInitializer self, JExpression[] elems)
          visits an array initializer expression
 Object visitArrayLengthExpression(JArrayLengthExpression self, JExpression prefix)
          visits an array length expression
 Object visitAssignmentExpression(JAssignmentExpression self, JExpression left, JExpression right)
          visits an assignment expression
 Object visitBinaryExpression(JBinaryExpression self, String oper, JExpression left, JExpression right)
          visits an array allocator expression
 Object visitBitwiseComplementExpression(JUnaryExpression self, JExpression expr)
          visits a bitwise complement expression
 Object visitBitwiseExpression(JBitwiseExpression self, int oper, JExpression left, JExpression right)
          visits a compound assignment expression
 Object visitBlockStatement(JBlock self, JavaStyleComment[] comments)
          visits an expression statement
 Object visitBooleanLiteral(JBooleanLiteral self, boolean value)
          visits a boolean literal
 Object visitBreakStatement(JBreakStatement self, String label)
          visits a break statement
 Object visitByteLiteral(JByteLiteral self, byte value)
          visits a byte literal
 Object visitCastExpression(JCastExpression self, JExpression expr, CType type)
          visits a cast expression
 Object visitCatchClause(JCatchClause self, JFormalParameter exception, JBlock body)
          visits an array length expression
 Object visitCharLiteral(JCharLiteral self, char value)
          visits a character literal
 Object visitClassBody(JTypeDeclaration[] decls, JFieldDeclaration[] fields, JMethodDeclaration[] methods, JPhylum[] body)
          visits a class body
 Object visitClassDeclaration(JClassDeclaration self, int modifiers, String ident, String superName, CClassType[] interfaces, JPhylum[] body, JFieldDeclaration[] fields, JMethodDeclaration[] methods, JTypeDeclaration[] decls)
          visits a class declaration
 Object visitClassExpression(JClassExpression self, CType type)
          visits a class expression
 Object visitClassImport(String name)
          visits a class import declaration
 Object visitComment(JavaStyleComment comment)
          visits an array length expression
 Object visitComments(JavaStyleComment[] comments)
          visits an array length expression
 Object visitCompilationUnit(JCompilationUnit self, JPackageName packageName, JPackageImport[] importedPackages, JClassImport[] importedClasses, JTypeDeclaration[] typeDeclarations)
          visits a compilation unit
 Object visitCompoundAssignmentExpression(JCompoundAssignmentExpression self, int oper, JExpression left, JExpression right)
          visits a compound expression
 Object visitCompoundStatement(JCompoundStatement self, JStatement[] body)
          visits a compound statement
 Object visitConditionalExpression(JConditionalExpression self, JExpression cond, JExpression left, JExpression right)
          visits a conditional expression
 Object visitConstructorCall(JConstructorCall self, boolean functorIsThis, JExpression[] params)
          visits an array length expression
 Object visitConstructorDeclaration(JConstructorDeclaration self, int modifiers, String ident, JFormalParameter[] parameters, CClassType[] exceptions, JConstructorBlock body)
          visits a method declaration
 Object visitContinueStatement(JContinueStatement self, String label)
          visits a continue statement
 Object visitDoStatement(JDoStatement self, JExpression cond, JStatement body)
          visits a do statement
 Object visitDoubleLiteral(JDoubleLiteral self, double value)
          visits a double literal
 Object visitEmittedTextExpression(JEmittedTextExpression self, Object[] parts)
          Visit text to be emitted unchanged in a compiler backend.
 Object visitEmptyStatement(JEmptyStatement self)
          visits a empty statement
 Object visitEqualityExpression(JEqualityExpression self, boolean equal, JExpression left, JExpression right)
          visits an equality expression
 Object visitExpressionListStatement(JExpressionListStatement self, JExpression[] expr)
          visits an expression list statement
 Object visitExpressionStatement(JExpressionStatement self, JExpression expr)
          visits an expression statement
 Object visitFieldDeclaration(JFieldDeclaration self, int modifiers, CType type, String ident, JExpression expr)
          visits a field declaration
 Object visitFieldExpression(JFieldAccessExpression self, JExpression left, String ident)
          visits a field expression
 Object visitFloatLiteral(JFloatLiteral self, float value)
          visits a float literal
 Object visitFormalParameters(JFormalParameter self, boolean isFinal, CType type, String ident)
          visits an array length expression
 Object visitForStatement(JForStatement self, JStatement init, JExpression cond, JStatement incr, JStatement body)
          visits a for statement
 Object visitIfStatement(JIfStatement self, JExpression cond, JStatement thenClause, JStatement elseClause)
          visits a if statement
 Object visitInnerClassDeclaration(JClassDeclaration self, int modifiers, String ident, String superName, CClassType[] interfaces, JTypeDeclaration[] decls, JPhylum[] body, JFieldDeclaration[] fields, JMethodDeclaration[] methods)
          visits a class declaration
 Object visitInstanceofExpression(JInstanceofExpression self, JExpression expr, CType dest)
          visits an instanceof expression
 Object visitInterfaceDeclaration(JInterfaceDeclaration self, int modifiers, String ident, CClassType[] interfaces, JPhylum[] body, JMethodDeclaration[] methods)
          visits an interface declaration
 Object visitIntLiteral(JIntLiteral self, int value)
          visits a int literal
 Object visitJavadoc(JavadocComment comment)
          visits an array length expression
 Object visitLabeledStatement(JLabeledStatement self, String label, JStatement stmt)
          visits a labeled statement
 Object visitLocalVariableExpression(JLocalVariableExpression self, String ident)
          visits a local variable expression
 Object visitLogicalComplementExpression(JUnaryExpression self, JExpression expr)
          visits a logical complement expression
 Object visitLongLiteral(JLongLiteral self, long value)
          visits a long literal
 Object visitMethodCallExpression(JMethodCallExpression self, JExpression prefix, String ident, JExpression[] args)
          visits a method call expression
 Object visitMethodDeclaration(JMethodDeclaration self, int modifiers, CType returnType, String ident, JFormalParameter[] parameters, CClassType[] exceptions, JBlock body)
          visits a method declaration
 Object visitNameExpression(JNameExpression self, JExpression prefix, String ident)
          visits a name expression
 Object visitNewArrayExpression(JNewArrayExpression self, CType type, JExpression[] dims, JArrayInitializer init)
          visits an array allocator expression.
 Object visitNullLiteral(JNullLiteral self)
          visits a null literal
 Object visitPackageImport(String name)
          visits a package import declaration
 Object visitPackageName(String name)
          visits a package name declaration
 Object visitParenthesedExpression(JParenthesedExpression self, JExpression expr)
          visits a parenthesed expression
 Object visitPostfixExpression(JPostfixExpression self, int oper, JExpression expr)
          visits a postfix expression
 Object visitPrefixExpression(JPrefixExpression self, int oper, JExpression expr)
          visits a prefix expression
 Object visitQualifiedAnonymousCreation(JQualifiedAnonymousCreation self, JExpression prefix, String ident, JExpression[] params, JClassDeclaration decl)
          Visits an unqualified anonymous class instance creation expression.
 Object visitQualifiedInstanceCreation(JQualifiedInstanceCreation self, JExpression prefix, String ident, JExpression[] params)
          Visits an unqualified instance creation expression.
 Object visitRelationalExpression(JRelationalExpression self, int oper, JExpression left, JExpression right)
          visits a shift expressiona
 Object visitReturnStatement(JReturnStatement self, JExpression expr)
          visits a return statement
 Object visitShiftExpression(JShiftExpression self, int oper, JExpression left, JExpression right)
          visits a shift expression
 Object visitShortLiteral(JShortLiteral self, short value)
          visits a short literal
 Object visitStringLiteral(JStringLiteral self, String value)
          visits a string literal
 Object visitSuperExpression(JSuperExpression self)
          visits a super expression
 Object visitSwitchGroup(JSwitchGroup self, JSwitchLabel[] labels, JStatement[] stmts)
          visits an array length expression
 Object visitSwitchLabel(JSwitchLabel self, JExpression expr)
          visits an array length expression
 Object visitSwitchStatement(JSwitchStatement self, JExpression expr, JSwitchGroup[] body)
          visits a switch statement
 Object visitSynchronizedStatement(JSynchronizedStatement self, JExpression cond, JStatement body)
          visits a synchronized statement
 Object visitThisExpression(JThisExpression self, JExpression prefix)
          visits a this expression
 Object visitThrowStatement(JThrowStatement self, JExpression expr)
          visits a throw statement
 Object visitTryCatchStatement(JTryCatchStatement self, JBlock tryClause, JCatchClause[] catchClauses)
          visits a try-catch statement
 Object visitTryFinallyStatement(JTryFinallyStatement self, JBlock tryClause, JBlock finallyClause)
          visits a try-finally statement
 Object visitTypeDeclarationStatement(JTypeDeclarationStatement self, JTypeDeclaration decl)
          visits a type declaration statement
 Object visitTypeNameExpression(JTypeNameExpression self, CType type)
          visits a type name expression
 Object visitUnaryMinusExpression(JUnaryExpression self, JExpression expr)
          visits an unary minus expression
 Object visitUnaryPlusExpression(JUnaryExpression self, JExpression expr)
          visits an unary plus expression
 Object visitUnaryPromoteExpression(JUnaryPromote self, JExpression expr, CType type)
          visits a cast expression
 Object visitUnqualifiedAnonymousCreation(JUnqualifiedAnonymousCreation self, CClassType type, JExpression[] params, JClassDeclaration decl)
          Visits an unqualified anonymous class instance creation expression.
 Object visitUnqualifiedInstanceCreation(JUnqualifiedInstanceCreation self, CClassType type, JExpression[] params)
          Visits an unqualified instance creation expression.
 Object visitVariableDeclarationStatement(JVariableDeclarationStatement self, JVariableDefinition[] vars)
          visits a variable declaration statement
 Object visitVariableDefinition(JVariableDefinition self, int modifiers, CType type, String ident, JExpression expr)
          visits a variable declaration statement.
 Object visitWhileStatement(JWhileStatement self, JExpression cond, JStatement body)
          visits a while statement
 
Methods inherited from class at.dms.util.Utils
asPercent, cellMathEquivalent, cMathEquivalent, cppMathEquivalent, deepCloneInto, equalArrays, fail, getEnvironmentVariable, getExpression, hasPeeks, initArray, initArray, initLiteralArray, intArrayToList, isMathMethod, isUniform, kopi_assert, kopi_assert, makeCountdownForLoop, makeDotFileName, makeForLoop, makeForLoop, makeForLoop, makeForLoopFieldIndex, makeForLoopLocalIndex, nextPow2, passThruParens, peelMarkers, popBeforePeek, readFile, removeUnusedPops, replaceAll, setupDotFileName, simplifyMathMethod, splitQualifiedName, splitQualifiedName, toArray, toIntArray, toVector, voidToInt, writeFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DO_NOT_CLONE_THESE_FIELDS

public static final String[] DO_NOT_CLONE_THESE_FIELDS
The clone generator looks at this array to see which fields it shouldn't clone.

Constructor Detail

Kopi2SIR

public Kopi2SIR()

Kopi2SIR

public Kopi2SIR(JCompilationUnit[] app)
Method Detail

isToplevelStream

public boolean isToplevelStream(String name)
Returns whether or not the given name represents a toplevel (void->void) stream that can be executed by itself.


searchForOp

public SIROperator searchForOp(String className)
Searches for
className
and returns associated op. Does not worry about anything recursive--should call getVisitedOp in the general case.


visitClassDeclaration

public Object visitClassDeclaration(JClassDeclaration self,
                                    int modifiers,
                                    String ident,
                                    String superName,
                                    CClassType[] interfaces,
                                    JPhylum[] body,
                                    JFieldDeclaration[] fields,
                                    JMethodDeclaration[] methods,
                                    JTypeDeclaration[] decls)
Description copied from interface: AttributeVisitor
visits a class declaration

Specified by:
visitClassDeclaration in interface AttributeVisitor

visitCompilationUnit

public Object visitCompilationUnit(JCompilationUnit self,
                                   JPackageName packageName,
                                   JPackageImport[] importedPackages,
                                   JClassImport[] importedClasses,
                                   JTypeDeclaration[] typeDeclarations)
Description copied from interface: AttributeVisitor
visits a compilation unit

Specified by:
visitCompilationUnit in interface AttributeVisitor

visitClassBody

public Object visitClassBody(JTypeDeclaration[] decls,
                             JFieldDeclaration[] fields,
                             JMethodDeclaration[] methods,
                             JPhylum[] body)
Description copied from interface: AttributeVisitor
visits a class body

Specified by:
visitClassBody in interface AttributeVisitor

visitInnerClassDeclaration

public Object visitInnerClassDeclaration(JClassDeclaration self,
                                         int modifiers,
                                         String ident,
                                         String superName,
                                         CClassType[] interfaces,
                                         JTypeDeclaration[] decls,
                                         JPhylum[] body,
                                         JFieldDeclaration[] fields,
                                         JMethodDeclaration[] methods)
visits a class declaration

Specified by:
visitInnerClassDeclaration in interface AttributeVisitor

visitFieldDeclaration

public Object visitFieldDeclaration(JFieldDeclaration self,
                                    int modifiers,
                                    CType type,
                                    String ident,
                                    JExpression expr)
visits a field declaration

Specified by:
visitFieldDeclaration in interface AttributeVisitor

visitMethodDeclaration

public Object visitMethodDeclaration(JMethodDeclaration self,
                                     int modifiers,
                                     CType returnType,
                                     String ident,
                                     JFormalParameter[] parameters,
                                     CClassType[] exceptions,
                                     JBlock body)
visits a method declaration

Specified by:
visitMethodDeclaration in interface AttributeVisitor

visitConstructorDeclaration

public Object visitConstructorDeclaration(JConstructorDeclaration self,
                                          int modifiers,
                                          String ident,
                                          JFormalParameter[] parameters,
                                          CClassType[] exceptions,
                                          JConstructorBlock body)
visits a method declaration

Specified by:
visitConstructorDeclaration in interface AttributeVisitor

visitWhileStatement

public Object visitWhileStatement(JWhileStatement self,
                                  JExpression cond,
                                  JStatement body)
visits a while statement

Specified by:
visitWhileStatement in interface AttributeVisitor

visitVariableDeclarationStatement

public Object visitVariableDeclarationStatement(JVariableDeclarationStatement self,
                                                JVariableDefinition[] vars)
visits a variable declaration statement

Specified by:
visitVariableDeclarationStatement in interface AttributeVisitor

visitVariableDefinition

public Object visitVariableDefinition(JVariableDefinition self,
                                      int modifiers,
                                      CType type,
                                      String ident,
                                      JExpression expr)
visits a variable declaration statement. Instead of creating a new variable definition, we mutate the old one and return it so that all of the local variable references that have been resolved to this variable def. will still hold.

Specified by:
visitVariableDefinition in interface AttributeVisitor

visitSwitchStatement

public Object visitSwitchStatement(JSwitchStatement self,
                                   JExpression expr,
                                   JSwitchGroup[] body)
visits a switch statement

Specified by:
visitSwitchStatement in interface AttributeVisitor

visitReturnStatement

public Object visitReturnStatement(JReturnStatement self,
                                   JExpression expr)
visits a return statement

Specified by:
visitReturnStatement in interface AttributeVisitor

visitLabeledStatement

public Object visitLabeledStatement(JLabeledStatement self,
                                    String label,
                                    JStatement stmt)
visits a labeled statement

Specified by:
visitLabeledStatement in interface AttributeVisitor

visitIfStatement

public Object visitIfStatement(JIfStatement self,
                               JExpression cond,
                               JStatement thenClause,
                               JStatement elseClause)
visits a if statement

Specified by:
visitIfStatement in interface AttributeVisitor

visitForStatement

public Object visitForStatement(JForStatement self,
                                JStatement init,
                                JExpression cond,
                                JStatement incr,
                                JStatement body)
visits a for statement

Specified by:
visitForStatement in interface AttributeVisitor

visitCompoundStatement

public Object visitCompoundStatement(JCompoundStatement self,
                                     JStatement[] body)
visits a compound statement

Specified by:
visitCompoundStatement in interface AttributeVisitor

visitExpressionStatement

public Object visitExpressionStatement(JExpressionStatement self,
                                       JExpression expr)
visits an expression statement

Specified by:
visitExpressionStatement in interface AttributeVisitor

visitExpressionListStatement

public Object visitExpressionListStatement(JExpressionListStatement self,
                                           JExpression[] expr)
visits an expression list statement

Specified by:
visitExpressionListStatement in interface AttributeVisitor

visitEmptyStatement

public Object visitEmptyStatement(JEmptyStatement self)
visits a empty statement

Specified by:
visitEmptyStatement in interface AttributeVisitor

visitDoStatement

public Object visitDoStatement(JDoStatement self,
                               JExpression cond,
                               JStatement body)
visits a do statement

Specified by:
visitDoStatement in interface AttributeVisitor

visitContinueStatement

public Object visitContinueStatement(JContinueStatement self,
                                     String label)
visits a continue statement

Specified by:
visitContinueStatement in interface AttributeVisitor

visitBreakStatement

public Object visitBreakStatement(JBreakStatement self,
                                  String label)
visits a break statement

Specified by:
visitBreakStatement in interface AttributeVisitor

visitBlockStatement

public Object visitBlockStatement(JBlock self,
                                  JavaStyleComment[] comments)
visits an expression statement

Specified by:
visitBlockStatement in interface AttributeVisitor

visitTypeDeclarationStatement

public Object visitTypeDeclarationStatement(JTypeDeclarationStatement self,
                                            JTypeDeclaration decl)
visits a type declaration statement

Specified by:
visitTypeDeclarationStatement in interface AttributeVisitor

visitUnaryPlusExpression

public Object visitUnaryPlusExpression(JUnaryExpression self,
                                       JExpression expr)
visits an unary plus expression

Specified by:
visitUnaryPlusExpression in interface AttributeVisitor

visitUnaryMinusExpression

public Object visitUnaryMinusExpression(JUnaryExpression self,
                                        JExpression expr)
visits an unary minus expression

Specified by:
visitUnaryMinusExpression in interface AttributeVisitor

visitBitwiseComplementExpression

public Object visitBitwiseComplementExpression(JUnaryExpression self,
                                               JExpression expr)
visits a bitwise complement expression

Specified by:
visitBitwiseComplementExpression in interface AttributeVisitor

visitLogicalComplementExpression

public Object visitLogicalComplementExpression(JUnaryExpression self,
                                               JExpression expr)
visits a logical complement expression

Specified by:
visitLogicalComplementExpression in interface AttributeVisitor

visitTypeNameExpression

public Object visitTypeNameExpression(JTypeNameExpression self,
                                      CType type)
visits a type name expression

Specified by:
visitTypeNameExpression in interface AttributeVisitor

visitThisExpression

public Object visitThisExpression(JThisExpression self,
                                  JExpression prefix)
visits a this expression

Specified by:
visitThisExpression in interface AttributeVisitor

visitSuperExpression

public Object visitSuperExpression(JSuperExpression self)
visits a super expression

Specified by:
visitSuperExpression in interface AttributeVisitor

visitShiftExpression

public Object visitShiftExpression(JShiftExpression self,
                                   int oper,
                                   JExpression left,
                                   JExpression right)
visits a shift expression

Specified by:
visitShiftExpression in interface AttributeVisitor

visitRelationalExpression

public Object visitRelationalExpression(JRelationalExpression self,
                                        int oper,
                                        JExpression left,
                                        JExpression right)
visits a shift expressiona

Specified by:
visitRelationalExpression in interface AttributeVisitor

visitPrefixExpression

public Object visitPrefixExpression(JPrefixExpression self,
                                    int oper,
                                    JExpression expr)
visits a prefix expression

Specified by:
visitPrefixExpression in interface AttributeVisitor

visitPostfixExpression

public Object visitPostfixExpression(JPostfixExpression self,
                                     int oper,
                                     JExpression expr)
visits a postfix expression

Specified by:
visitPostfixExpression in interface AttributeVisitor

visitParenthesedExpression

public Object visitParenthesedExpression(JParenthesedExpression self,
                                         JExpression expr)
visits a parenthesed expression

Specified by:
visitParenthesedExpression in interface AttributeVisitor

visitQualifiedAnonymousCreation

public Object visitQualifiedAnonymousCreation(JQualifiedAnonymousCreation self,
                                              JExpression prefix,
                                              String ident,
                                              JExpression[] params,
                                              JClassDeclaration decl)
Visits an unqualified anonymous class instance creation expression.

Specified by:
visitQualifiedAnonymousCreation in interface AttributeVisitor

visitQualifiedInstanceCreation

public Object visitQualifiedInstanceCreation(JQualifiedInstanceCreation self,
                                             JExpression prefix,
                                             String ident,
                                             JExpression[] params)
Visits an unqualified instance creation expression.

Specified by:
visitQualifiedInstanceCreation in interface AttributeVisitor

visitUnqualifiedAnonymousCreation

public Object visitUnqualifiedAnonymousCreation(JUnqualifiedAnonymousCreation self,
                                                CClassType type,
                                                JExpression[] params,
                                                JClassDeclaration decl)
Visits an unqualified anonymous class instance creation expression.

Specified by:
visitUnqualifiedAnonymousCreation in interface AttributeVisitor

visitUnqualifiedInstanceCreation

public Object visitUnqualifiedInstanceCreation(JUnqualifiedInstanceCreation self,
                                               CClassType type,
                                               JExpression[] params)
Visits an unqualified instance creation expression.

Specified by:
visitUnqualifiedInstanceCreation in interface AttributeVisitor

visitNewArrayExpression

public Object visitNewArrayExpression(JNewArrayExpression self,
                                      CType type,
                                      JExpression[] dims,
                                      JArrayInitializer init)
visits an array allocator expression.

Specified by:
visitNewArrayExpression in interface AttributeVisitor

visitNameExpression

public Object visitNameExpression(JNameExpression self,
                                  JExpression prefix,
                                  String ident)
visits a name expression

Specified by:
visitNameExpression in interface AttributeVisitor

visitBinaryExpression

public Object visitBinaryExpression(JBinaryExpression self,
                                    String oper,
                                    JExpression left,
                                    JExpression right)
visits an array allocator expression

Specified by:
visitBinaryExpression in interface AttributeVisitor

visitMethodCallExpression

public Object visitMethodCallExpression(JMethodCallExpression self,
                                        JExpression prefix,
                                        String ident,
                                        JExpression[] args)
visits a method call expression

Specified by:
visitMethodCallExpression in interface AttributeVisitor

visitLocalVariableExpression

public Object visitLocalVariableExpression(JLocalVariableExpression self,
                                           String ident)
visits a local variable expression

Specified by:
visitLocalVariableExpression in interface AttributeVisitor

visitEqualityExpression

public Object visitEqualityExpression(JEqualityExpression self,
                                      boolean equal,
                                      JExpression left,
                                      JExpression right)
visits an equality expression

Specified by:
visitEqualityExpression in interface AttributeVisitor

visitConditionalExpression

public Object visitConditionalExpression(JConditionalExpression self,
                                         JExpression cond,
                                         JExpression left,
                                         JExpression right)
visits a conditional expression

Specified by:
visitConditionalExpression in interface AttributeVisitor

visitCompoundAssignmentExpression

public Object visitCompoundAssignmentExpression(JCompoundAssignmentExpression self,
                                                int oper,
                                                JExpression left,
                                                JExpression right)
visits a compound expression

Specified by:
visitCompoundAssignmentExpression in interface AttributeVisitor

visitFieldExpression

public Object visitFieldExpression(JFieldAccessExpression self,
                                   JExpression left,
                                   String ident)
visits a field expression

Specified by:
visitFieldExpression in interface AttributeVisitor

visitClassExpression

public Object visitClassExpression(JClassExpression self,
                                   CType type)
visits a class expression

Specified by:
visitClassExpression in interface AttributeVisitor

visitCastExpression

public Object visitCastExpression(JCastExpression self,
                                  JExpression expr,
                                  CType type)
visits a cast expression

Specified by:
visitCastExpression in interface AttributeVisitor

visitUnaryPromoteExpression

public Object visitUnaryPromoteExpression(JUnaryPromote self,
                                          JExpression expr,
                                          CType type)
visits a cast expression

Specified by:
visitUnaryPromoteExpression in interface AttributeVisitor

visitBitwiseExpression

public Object visitBitwiseExpression(JBitwiseExpression self,
                                     int oper,
                                     JExpression left,
                                     JExpression right)
visits a compound assignment expression

Specified by:
visitBitwiseExpression in interface AttributeVisitor

visitAssignmentExpression

public Object visitAssignmentExpression(JAssignmentExpression self,
                                        JExpression left,
                                        JExpression right)
visits an assignment expression

Specified by:
visitAssignmentExpression in interface AttributeVisitor

visitArrayLengthExpression

public Object visitArrayLengthExpression(JArrayLengthExpression self,
                                         JExpression prefix)
visits an array length expression

Specified by:
visitArrayLengthExpression in interface AttributeVisitor

visitArrayAccessExpression

public Object visitArrayAccessExpression(JArrayAccessExpression self,
                                         JExpression prefix,
                                         JExpression accessor)
visits an array length expression

Specified by:
visitArrayAccessExpression in interface AttributeVisitor

visitSwitchLabel

public Object visitSwitchLabel(JSwitchLabel self,
                               JExpression expr)
visits an array length expression

Specified by:
visitSwitchLabel in interface AttributeVisitor

visitSwitchGroup

public Object visitSwitchGroup(JSwitchGroup self,
                               JSwitchLabel[] labels,
                               JStatement[] stmts)
visits an array length expression

Specified by:
visitSwitchGroup in interface AttributeVisitor

visitFormalParameters

public Object visitFormalParameters(JFormalParameter self,
                                    boolean isFinal,
                                    CType type,
                                    String ident)
visits an array length expression

Specified by:
visitFormalParameters in interface AttributeVisitor

visitConstructorCall

public Object visitConstructorCall(JConstructorCall self,
                                   boolean functorIsThis,
                                   JExpression[] params)
visits an array length expression

Specified by:
visitConstructorCall in interface AttributeVisitor

visitArrayInitializer

public Object visitArrayInitializer(JArrayInitializer self,
                                    JExpression[] elems)
visits an array initializer expression

Specified by:
visitArrayInitializer in interface AttributeVisitor

visitBooleanLiteral

public Object visitBooleanLiteral(JBooleanLiteral self,
                                  boolean value)
visits a boolean literal

Specified by:
visitBooleanLiteral in interface AttributeVisitor

visitByteLiteral

public Object visitByteLiteral(JByteLiteral self,
                               byte value)
visits a byte literal

Specified by:
visitByteLiteral in interface AttributeVisitor

visitCharLiteral

public Object visitCharLiteral(JCharLiteral self,
                               char value)
visits a character literal

Specified by:
visitCharLiteral in interface AttributeVisitor

visitDoubleLiteral

public Object visitDoubleLiteral(JDoubleLiteral self,
                                 double value)
visits a double literal

Specified by:
visitDoubleLiteral in interface AttributeVisitor

visitFloatLiteral

public Object visitFloatLiteral(JFloatLiteral self,
                                float value)
visits a float literal

Specified by:
visitFloatLiteral in interface AttributeVisitor

visitIntLiteral

public Object visitIntLiteral(JIntLiteral self,
                              int value)
visits a int literal

Specified by:
visitIntLiteral in interface AttributeVisitor

visitLongLiteral

public Object visitLongLiteral(JLongLiteral self,
                               long value)
visits a long literal

Specified by:
visitLongLiteral in interface AttributeVisitor

visitShortLiteral

public Object visitShortLiteral(JShortLiteral self,
                                short value)
visits a short literal

Specified by:
visitShortLiteral in interface AttributeVisitor

visitStringLiteral

public Object visitStringLiteral(JStringLiteral self,
                                 String value)
visits a string literal

Specified by:
visitStringLiteral in interface AttributeVisitor

visitNullLiteral

public Object visitNullLiteral(JNullLiteral self)
visits a null literal

Specified by:
visitNullLiteral in interface AttributeVisitor

visitPackageName

public Object visitPackageName(String name)
visits a package name declaration

Specified by:
visitPackageName in interface AttributeVisitor

visitPackageImport

public Object visitPackageImport(String name)
visits a package import declaration

Specified by:
visitPackageImport in interface AttributeVisitor

visitClassImport

public Object visitClassImport(String name)
visits a class import declaration

Specified by:
visitClassImport in interface AttributeVisitor

getInterfaces

public JInterfaceDeclaration[] getInterfaces()
Returns a vector of all the JInterfaceDeclarations for the toplevel stream


getInterfaceTables

public SIRInterfaceTable[] getInterfaceTables()
Returns a vector of all the SIRInterfaceTables that were constructed in traversing the toplevel stream


getStructures

public SIRStructure[] getStructures()
Returns a vector of all the SIRStructures that appeared in the program


getHelpers

public SIRHelper[] getHelpers()
Returns a vector of all the SIRHelper that appeared in the program


getGlobal

public SIRGlobal getGlobal()
Returns the global structure


visitInterfaceDeclaration

public Object visitInterfaceDeclaration(JInterfaceDeclaration self,
                                        int modifiers,
                                        String ident,
                                        CClassType[] interfaces,
                                        JPhylum[] body,
                                        JMethodDeclaration[] methods)
visits an interface declaration

Specified by:
visitInterfaceDeclaration in interface AttributeVisitor

visitTryCatchStatement

public Object visitTryCatchStatement(JTryCatchStatement self,
                                     JBlock tryClause,
                                     JCatchClause[] catchClauses)
visits a try-catch statement

Specified by:
visitTryCatchStatement in interface AttributeVisitor

visitTryFinallyStatement

public Object visitTryFinallyStatement(JTryFinallyStatement self,
                                       JBlock tryClause,
                                       JBlock finallyClause)
visits a try-finally statement

Specified by:
visitTryFinallyStatement in interface AttributeVisitor

visitThrowStatement

public Object visitThrowStatement(JThrowStatement self,
                                  JExpression expr)
visits a throw statement

Specified by:
visitThrowStatement in interface AttributeVisitor

visitSynchronizedStatement

public Object visitSynchronizedStatement(JSynchronizedStatement self,
                                         JExpression cond,
                                         JStatement body)
visits a synchronized statement

Specified by:
visitSynchronizedStatement in interface AttributeVisitor

visitInstanceofExpression

public Object visitInstanceofExpression(JInstanceofExpression self,
                                        JExpression expr,
                                        CType dest)
visits an instanceof expression

Specified by:
visitInstanceofExpression in interface AttributeVisitor

visitEmittedTextExpression

public Object visitEmittedTextExpression(JEmittedTextExpression self,
                                         Object[] parts)
Description copied from interface: AttributeVisitor
Visit text to be emitted unchanged in a compiler backend.

Specified by:
visitEmittedTextExpression in interface AttributeVisitor
parts - a list of embedded objects which might include JExpressions.

visitComments

public Object visitComments(JavaStyleComment[] comments)
visits an array length expression

Specified by:
visitComments in interface AttributeVisitor

visitComment

public Object visitComment(JavaStyleComment comment)
visits an array length expression

Specified by:
visitComment in interface AttributeVisitor

visitJavadoc

public Object visitJavadoc(JavadocComment comment)
visits an array length expression

Specified by:
visitJavadoc in interface AttributeVisitor

visitCatchClause

public Object visitCatchClause(JCatchClause self,
                               JFormalParameter exception,
                               JBlock body)
visits an array length expression

Specified by:
visitCatchClause in interface AttributeVisitor

deepClone

public Object deepClone()
Returns a deep clone of this object.

Specified by:
deepClone in interface DeepCloneable
Overrides:
deepClone in class Utils

deepCloneInto

protected void deepCloneInto(Kopi2SIR other)
Clones all fields of this into
other