com.ibm.wala.cast.java.translator.polyglot
Class PolyglotJava2CAstTranslator

java.lang.Object
  extended by com.ibm.wala.cast.java.translator.polyglot.PolyglotJava2CAstTranslator
All Implemented Interfaces:
TranslatorToCAst

public class PolyglotJava2CAstTranslator
extends java.lang.Object
implements TranslatorToCAst


Nested Class Summary
 class PolyglotJava2CAstTranslator.ClassContext
           
protected  class PolyglotJava2CAstTranslator.ClassEntity
           
 class PolyglotJava2CAstTranslator.CodeBodyContext
           
protected static class PolyglotJava2CAstTranslator.CodeBodyEntity
           
protected static class PolyglotJava2CAstTranslator.CompilationUnitEntity
           
protected static class PolyglotJava2CAstTranslator.DelegatingContext
           
protected  class PolyglotJava2CAstTranslator.FieldEntity
           
static interface PolyglotJava2CAstTranslator.IdentityMapper<T,M,F>
           
protected  class PolyglotJava2CAstTranslator.JavaTranslatingVisitorImpl
           
 class PolyglotJava2CAstTranslator.MethodContext
           
 class PolyglotJava2CAstTranslator.PolyglotJavaType
           
protected  class PolyglotJava2CAstTranslator.ProcedureEntity
           
protected static class PolyglotJava2CAstTranslator.RootContext
           
static interface PolyglotJava2CAstTranslator.WalkContext
           
 
Field Summary
protected  boolean DEBUG
           
protected  polyglot.types.Type fCCEType
           
protected  ClassLoaderReference fClassLoaderRef
           
protected  CAst fFactory
           
protected  PolyglotIdentityMapper fIdentityMapper
           
protected  polyglot.ast.NodeFactory fNodeFactory
           
protected  polyglot.types.Type fNPEType
           
protected  polyglot.types.Type fREType
           
protected  polyglot.types.TypeSystem fTypeSystem
           
 
Constructor Summary
PolyglotJava2CAstTranslator(ClassLoaderReference clr, polyglot.ast.NodeFactory nf, polyglot.types.TypeSystem ts, PolyglotIdentityMapper identityMapper)
           
 
Method Summary
protected  void addConstructorsToAnonymousClass(polyglot.ast.New n, polyglot.types.ParsedClassType anonType, PolyglotJava2CAstTranslator.ClassContext classContext, java.util.List<CAstEntity> memberEntities)
           
protected  TranslatingVisitor createTranslator()
           
protected  PolyglotTypeDictionary createTypeDict()
           
protected  TranslatingVisitor getTranslator()
           
protected  CAstTypeDictionary getTypeDict()
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, CAst Ast, polyglot.ast.Node n, int kind)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, CAst Ast, polyglot.ast.Node n, int kind, CAstNode c)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, CAst Ast, polyglot.ast.Node n, int kind, CAstNode[] c)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, CAst Ast, polyglot.ast.Node n, int kind, CAstNode c1, CAstNode c2)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, CAst Ast, polyglot.ast.Node n, int kind, CAstNode c1, CAstNode c2, CAstNode c3)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, CAst Ast, polyglot.ast.Node n, int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, int kind, polyglot.util.Position p)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, polyglot.ast.Node n, int kind)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, polyglot.ast.Node n, int kind, CAstNode c)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, polyglot.ast.Node n, int kind, CAstNode[] c)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, polyglot.ast.Node n, int kind, CAstNode c1, CAstNode c2)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, polyglot.ast.Node n, int kind, CAstNode c1, CAstNode c2, CAstNode c3)
           
protected  CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc, polyglot.ast.Node n, int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4)
           
protected  CAstSourcePositionMap.Position makePosition(polyglot.util.Position p)
           
protected static CAstOperator mapBinaryOpcode(polyglot.ast.Binary.Operator operator)
           
protected static java.util.Collection mapFlagsToQualifiers(polyglot.types.Flags flags)
           
protected static CAstOperator mapUnaryOpcode(polyglot.ast.Unary.Operator operator)
           
protected  void processClassMembers(polyglot.ast.Node n, polyglot.types.ClassType classType, java.util.List<polyglot.ast.ClassMember> members, PolyglotJava2CAstTranslator.DelegatingContext classContext, java.util.List<CAstEntity> memberEntities)
           
 CAstEntity translate(java.lang.Object ast, java.lang.String fileName)
           
protected  CAstNode translateConstant(java.lang.Object constant)
           
protected  CAstEntity walkEntity(polyglot.ast.Node rootNode, PolyglotJava2CAstTranslator.WalkContext context)
           
protected  CAstNode walkNodes(polyglot.ast.Node n, PolyglotJava2CAstTranslator.WalkContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fFactory

protected final CAst fFactory

fNodeFactory

protected final polyglot.ast.NodeFactory fNodeFactory

fTypeSystem

protected final polyglot.types.TypeSystem fTypeSystem

fNPEType

protected polyglot.types.Type fNPEType

fCCEType

protected polyglot.types.Type fCCEType

fREType

protected polyglot.types.Type fREType

fClassLoaderRef

protected final ClassLoaderReference fClassLoaderRef

fIdentityMapper

protected PolyglotIdentityMapper fIdentityMapper

DEBUG

protected final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

PolyglotJava2CAstTranslator

public PolyglotJava2CAstTranslator(ClassLoaderReference clr,
                                   polyglot.ast.NodeFactory nf,
                                   polyglot.types.TypeSystem ts,
                                   PolyglotIdentityMapper identityMapper)
Method Detail

getTranslator

protected final TranslatingVisitor getTranslator()

createTranslator

protected TranslatingVisitor createTranslator()

getTypeDict

protected CAstTypeDictionary getTypeDict()

createTypeDict

protected PolyglotTypeDictionary createTypeDict()

mapUnaryOpcode

protected static CAstOperator mapUnaryOpcode(polyglot.ast.Unary.Operator operator)

mapBinaryOpcode

protected static CAstOperator mapBinaryOpcode(polyglot.ast.Binary.Operator operator)

translateConstant

protected CAstNode translateConstant(java.lang.Object constant)

makePosition

protected CAstSourcePositionMap.Position makePosition(polyglot.util.Position p)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            CAst Ast,
                            polyglot.ast.Node n,
                            int kind)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            CAst Ast,
                            polyglot.ast.Node n,
                            int kind,
                            CAstNode[] c)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            CAst Ast,
                            polyglot.ast.Node n,
                            int kind,
                            CAstNode c)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            CAst Ast,
                            polyglot.ast.Node n,
                            int kind,
                            CAstNode c1,
                            CAstNode c2)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            CAst Ast,
                            polyglot.ast.Node n,
                            int kind,
                            CAstNode c1,
                            CAstNode c2,
                            CAstNode c3)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            CAst Ast,
                            polyglot.ast.Node n,
                            int kind,
                            CAstNode c1,
                            CAstNode c2,
                            CAstNode c3,
                            CAstNode c4)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            polyglot.ast.Node n,
                            int kind)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            polyglot.ast.Node n,
                            int kind,
                            CAstNode[] c)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            polyglot.ast.Node n,
                            int kind,
                            CAstNode c)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            polyglot.ast.Node n,
                            int kind,
                            CAstNode c1,
                            CAstNode c2)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            polyglot.ast.Node n,
                            int kind,
                            CAstNode c1,
                            CAstNode c2,
                            CAstNode c3)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            polyglot.ast.Node n,
                            int kind,
                            CAstNode c1,
                            CAstNode c2,
                            CAstNode c3,
                            CAstNode c4)

makeNode

protected CAstNode makeNode(PolyglotJava2CAstTranslator.WalkContext wc,
                            int kind,
                            polyglot.util.Position p)

translate

public CAstEntity translate(java.lang.Object ast,
                            java.lang.String fileName)
Specified by:
translate in interface TranslatorToCAst

mapFlagsToQualifiers

protected static java.util.Collection mapFlagsToQualifiers(polyglot.types.Flags flags)

processClassMembers

protected void processClassMembers(polyglot.ast.Node n,
                                   polyglot.types.ClassType classType,
                                   java.util.List<polyglot.ast.ClassMember> members,
                                   PolyglotJava2CAstTranslator.DelegatingContext classContext,
                                   java.util.List<CAstEntity> memberEntities)

addConstructorsToAnonymousClass

protected void addConstructorsToAnonymousClass(polyglot.ast.New n,
                                               polyglot.types.ParsedClassType anonType,
                                               PolyglotJava2CAstTranslator.ClassContext classContext,
                                               java.util.List<CAstEntity> memberEntities)

walkEntity

protected CAstEntity walkEntity(polyglot.ast.Node rootNode,
                                PolyglotJava2CAstTranslator.WalkContext context)

walkNodes

protected CAstNode walkNodes(polyglot.ast.Node n,
                             PolyglotJava2CAstTranslator.WalkContext context)