|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.ptree.util.ParseTreeTranslator
The class ParseTreeTranslator
can be inherited by
subclasses to make traditonal translation.
UNDER CONSTRUCTION
Object
Constructor Summary | |
ParseTreeTranslator()
|
Method Summary | |
static boolean |
isAllocationExpression(ParseTree p)
Tests if the ptree object is an instance of allocation expression classes. |
static boolean |
isGuardingStatement(ParseTree p)
Tests if the ptree object is an instance of guarding statement classes. |
static boolean |
isIterationStatement(ParseTree p)
Tests if the ptree object is an instance of iteration statement classes. |
static boolean |
isJumpStatement(ParseTree p)
Tests if the ptree object is an instance of jump statement classes. |
static boolean |
isSelectionStatement(ParseTree p)
Tests if the ptree object is an instance of selection statement classes. |
void |
translate(OJClass clazz)
Main method to be called. |
protected Expression |
translateAllocationExpression(AllocationExpression construct)
Translates the construct expression node. |
protected Expression |
translateAllocationExpression(Expression alloc)
Translates the allocation expression node. |
protected Expression |
translateArrayAccess(ArrayAccess arrayaccess)
Translates the array access node. |
protected Expression |
translateArrayAllocationExpression(ArrayAllocationExpression arrayalloc)
Translates the array allocation expression node. |
protected ArrayInitializer |
translateArrayInitializer(ArrayInitializer arrayinit)
Translates the array initializer node |
protected Expression |
translateAssignmentExpression(AssignmentExpression assignment)
Translates assignment expression node |
protected Expression |
translateBinaryExpression(BinaryExpression binary)
Translates the binary expression. |
protected Statement |
translateBlock(Block block)
Translates block node |
protected Statement |
translateBreakStatement(BreakStatement breakstate)
Translates break statement node. |
protected CaseGroup |
translateCaseGroup(CaseGroup cg)
Translates statements after case node |
protected CaseGroupList |
translateCaseGroupList(CaseGroupList cglist)
Translates switch statement node |
protected Expression |
translateCastExpression(CastExpression castexpr)
Translates the cast expression node. |
protected CatchBlock |
translateCatchBlock(CatchBlock katch)
Translates the catch block node. |
protected CatchList |
translateCatchList(CatchList catchlist)
Translates catch list |
protected ClassDeclaration |
translateClassDeclaration(ClassDeclaration classdecl)
Translates class declaration |
protected openjava.ptree.util.ClassType |
translateClassType(openjava.ptree.util.ClassType ctypename)
Translates class type node |
protected openjava.ptree.util.ClassTypeList |
translateClassTypeList(openjava.ptree.util.ClassTypeList ctypelist)
Translates class type list |
protected Expression |
translateConditionalExpression(ConditionalExpression condexpr)
Translates the conditional expression. |
protected MemberDeclaration |
translateConstructorDeclaration(ConstructorDeclaration constdecl)
Translates constructor declaration node |
protected Statement |
translateContinueStatement(ContinueStatement continuestate)
Translates the continue statement node. |
protected openjava.ptree.util.DimExprList |
translateDimExprList(openjava.ptree.util.DimExprList delist)
Translates the array dimension expr list. |
protected Statement |
translateDoWhileStatement(DoWhileStatement dostate)
Translates the do-while statement node. |
protected Statement |
translateEmptyStatement(EmptyStatement emptystate)
Translates empty statement |
protected Expression |
translateExpression(Expression expr)
Translates the expression node. |
protected ExpressionList |
translateExpressionList(ExpressionList exprlist)
Translates the expression list. |
protected Statement |
translateExpressionStatement(ExpressionStatement expstate)
Translates expression statement node. |
protected Expression |
translateFieldAccess(FieldAccess fieldaccess)
Translates the field access node. |
protected MemberDeclaration |
translateFieldDeclaration(FieldDeclaration fielddecl)
Translates field variable declaration node |
protected Statement |
translateForStatement(ForStatement forstate)
Translates the for statement node. |
protected Statement |
translateGuardingStatement(Statement guardstate)
Translates the guarding statement node. |
protected openjava.ptree.util.Identifier |
translateIdentifier(openjava.ptree.util.Identifier id)
Translates the identifier node. |
protected Statement |
translateIfStatement(IfStatement ifstate)
Translates if statement node |
protected Expression |
translateInstanceofExpression(InstanceofExpression insof)
Translates the instanceof expression. |
protected Statement |
translateIterationStatement(Statement iterstate)
Translates iteration node |
protected Statement |
translateJumpStatement(Statement jumpstate)
Translates jump statement node |
protected Statement |
translateLabeldStatement(LabeledStatement labelstate)
Translates labeled statement node |
protected Expression |
translateLiteral(Literal lit)
Translates the literal. |
protected MemberDeclaration |
translateMemberDeclaration(MemberDeclaration mem)
Translates member declaration list node |
protected MemberDeclarationList |
translateMemberDeclarationList(MemberDeclarationList memlist)
Translates field declaration list |
protected MemberDeclaration |
translateMemberInitializer(MemberInitializer minit)
Translates static initializer node |
protected Expression |
translateMethodCall(MethodCall methodcall)
Translates the mehtod call node. |
protected MemberDeclaration |
translateMethodDeclaration(MethodDeclaration methoddecl)
Translates method declaration node |
protected openjava.ptree.util.Modifier |
translateModifier(openjava.ptree.util.Modifier modifier)
Translates modfier node |
protected ModifierList |
translateModifierList(ModifierList modiflist)
Translates modifier list |
protected Parameter |
translateParameter(Parameter param)
Translates parameter |
protected ParameterList |
translateParameterList(ParameterList paramlist)
Translates parameter list |
protected openjava.ptree.util.PrimitiveType |
translatePrimitiveType(openjava.ptree.util.PrimitiveType ptype)
Translates primitive type node |
protected openjava.ptree.util.QualifiedName |
translateQualifiedName(openjava.ptree.util.QualifiedName qname)
Translates qualified name |
protected Statement |
translateReturnStatement(ReturnStatement returnstate)
Translates return statement node |
protected Statement |
translateSelectionStatement(Statement selectstate)
Translates selection statement node |
protected Expression |
translateSpecialName(openjava.ptree.util.SpecialName special)
Translates the special name node. |
protected Statement |
translateStatement(Statement stmt)
Translates statement node |
protected StatementList |
translateStatementList(StatementList stmtlist)
Translates statement list |
protected Statement |
translateSwitchStatement(SwitchStatement switchstate)
Translates switch statement node |
protected Statement |
translateSynchronizedStatement(SynchronizedStatement syncstate)
Translates synchronized statement node. |
protected Statement |
translateThrowStatement(ThrowStatement throwstate)
Translates throw statement node |
protected Statement |
translateTryStatement(TryStatement trystate)
Translates the try statement node. |
protected TypeName |
translateTypeName(TypeName typename)
Translates type name node |
protected openjava.ptree.util.TypeSpecifier |
translateTypeSpecifier(openjava.ptree.util.TypeSpecifier typespec)
Translates type specifier node |
protected Expression |
translateUnaryExpression(UnaryExpression unary)
Translates the unary expression. |
protected Statement |
translateVariableDeclaration(VariableDeclaration vardecl)
Translates local variable declaration statement node. |
protected VariableDeclarator |
translateVariableDeclarator(VariableDeclarator vardecl)
Translates variable declarator node |
protected VariableInitializer |
translateVariableInitializer(VariableInitializer varinit)
Translates the variable initializer node |
protected Statement |
translateWhileStatement(WhileStatement whilestate)
Translates while statement node |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ParseTreeTranslator()
Method Detail |
public final void translate(OJClass clazz) throws MOPException
public static final boolean isIterationStatement(ParseTree p)
DoWhileStatement ForStatement WhileStatement
p
- ptree-node object to testpublic static final boolean isSelectionStatement(ParseTree p)
IfStatement SwitchStatement
p
- ptree-node object to testpublic static final boolean isJumpStatement(ParseTree p)
BreakStatement ContinueStatement ReturnStatement ThrowStatement
p
- ptree-node object to testpublic static final boolean isGuardingStatement(ParseTree p)
SynchronizedStatement TryStatement
p
- ptree-node object to testpublic static final boolean isAllocationExpression(ParseTree p)
AllocationExpression ArrayAllocationExpression
p
- ptree-node object to testprotected ClassDeclaration translateClassDeclaration(ClassDeclaration classdecl) throws ParseTreeException
classdecl
- translating nodeprotected MemberDeclarationList translateMemberDeclarationList(MemberDeclarationList memlist) throws ParseTreeException
fieldlist
- translating listprotected MemberDeclaration translateMemberDeclaration(MemberDeclaration mem) throws ParseTreeException
mem
- translating nodeprotected MemberDeclaration translateFieldDeclaration(FieldDeclaration fielddecl) throws ParseTreeException
fieldvardecl
- translating nodeprotected MemberDeclaration translateMethodDeclaration(MethodDeclaration methoddecl) throws ParseTreeException
methoddecl
- translating nodeprotected MemberDeclaration translateConstructorDeclaration(ConstructorDeclaration constdecl) throws ParseTreeException
constdecl
- translating nodeprotected MemberDeclaration translateMemberInitializer(MemberInitializer minit) throws ParseTreeException
staticinit
- translating nodeprotected VariableDeclarator translateVariableDeclarator(VariableDeclarator vardecl) throws ParseTreeException
vardecl
- translating nodeprotected VariableInitializer translateVariableInitializer(VariableInitializer varinit) throws ParseTreeException
varinit
- translating nodeprotected ArrayInitializer translateArrayInitializer(ArrayInitializer arrayinit) throws ParseTreeException
arrayinit
- translating nodeprotected ParameterList translateParameterList(ParameterList paramlist) throws ParseTreeException
paramlist
- translating nodeprotected Parameter translateParameter(Parameter param) throws ParseTreeException
param
- translating nodeprotected openjava.ptree.util.TypeSpecifier translateTypeSpecifier(openjava.ptree.util.TypeSpecifier typespec) throws ParseTreeException
typespec
- translating nodeprotected openjava.ptree.util.ClassTypeList translateClassTypeList(openjava.ptree.util.ClassTypeList ctypelist) throws ParseTreeException
ctypelist
- translating nodeprotected TypeName translateTypeName(TypeName typename) throws ParseTreeException
typename
- translating nodeprotected openjava.ptree.util.PrimitiveType translatePrimitiveType(openjava.ptree.util.PrimitiveType ptype) throws ParseTreeException
typename
- translating nodeprotected openjava.ptree.util.ClassType translateClassType(openjava.ptree.util.ClassType ctypename) throws ParseTreeException
typename
- translating nodeprotected openjava.ptree.util.QualifiedName translateQualifiedName(openjava.ptree.util.QualifiedName qname) throws ParseTreeException
qname
- translating listprotected ModifierList translateModifierList(ModifierList modiflist) throws ParseTreeException
modiflist
- translating listprotected openjava.ptree.util.Modifier translateModifier(openjava.ptree.util.Modifier modifier) throws ParseTreeException
modfier
- translating nodeprotected Statement translateBlock(Block block) throws ParseTreeException
block
- translating nodeprotected Statement translateVariableDeclaration(VariableDeclaration vardecl) throws ParseTreeException
vardeclstate
- translating nodeprotected StatementList translateStatementList(StatementList stmtlist) throws ParseTreeException
paramlist
- translating nodeprotected Statement translateStatement(Statement stmt) throws ParseTreeException
statement
- translating nodeprotected Statement translateEmptyStatement(EmptyStatement emptystate) throws ParseTreeException
emptystate
- translating nodeprotected Statement translateLabeldStatement(LabeledStatement labelstate) throws ParseTreeException
labelstate
- translating node.protected Statement translateExpressionStatement(ExpressionStatement expstate) throws ParseTreeException
expstate
- translating node.protected Statement translateSelectionStatement(Statement selectstate) throws ParseTreeException
selectstate
- translating ndoeprotected Statement translateIfStatement(IfStatement ifstate) throws ParseTreeException
ifstate
- translating ndoeprotected Statement translateSwitchStatement(SwitchStatement switchstate) throws ParseTreeException
switchstate
- translating ndoeprotected CaseGroupList translateCaseGroupList(CaseGroupList cglist) throws ParseTreeException
switchstate
- translating ndoeprotected CaseGroup translateCaseGroup(CaseGroup cg) throws ParseTreeException
switchstate
- translating ndoeprotected Statement translateIterationStatement(Statement iterstate) throws ParseTreeException
iterstate
- translating nodeprotected Statement translateWhileStatement(WhileStatement whilestate) throws ParseTreeException
whilestate
- translating nodeprotected Statement translateDoWhileStatement(DoWhileStatement dostate) throws ParseTreeException
dostate
- translating nodeprotected Statement translateForStatement(ForStatement forstate) throws ParseTreeException
forstate
- translating nodeprotected Statement translateJumpStatement(Statement jumpstate) throws ParseTreeException
jumpstate
- translating nodeprotected Statement translateBreakStatement(BreakStatement breakstate) throws ParseTreeException
breakstate
- the translating node.protected Statement translateContinueStatement(ContinueStatement continuestate) throws ParseTreeException
continuestate
- the translating node.protected Statement translateReturnStatement(ReturnStatement returnstate) throws ParseTreeException
returnstate
- translating nodeprotected Statement translateThrowStatement(ThrowStatement throwstate) throws ParseTreeException
throwstate
- translating nodeprotected Statement translateGuardingStatement(Statement guardstate) throws ParseTreeException
guardstate
- the translating node.protected Statement translateSynchronizedStatement(SynchronizedStatement syncstate) throws ParseTreeException
synctate
- the translating node.protected Statement translateTryStatement(TryStatement trystate) throws ParseTreeException
trystate
- the translating node.protected CatchList translateCatchList(CatchList catchlist) throws ParseTreeException
catchlist
- translating nodeprotected CatchBlock translateCatchBlock(CatchBlock katch) throws ParseTreeException
katch
- the translating node.protected ExpressionList translateExpressionList(ExpressionList exprlist) throws ParseTreeException
exprlist
- the translating node.protected Expression translateExpression(Expression expr) throws ParseTreeException
expr
- the translating node.protected Expression translateLiteral(Literal lit) throws ParseTreeException
lit
- the translating node.protected Expression translateUnaryExpression(UnaryExpression unary) throws ParseTreeException
unary
- the translating node.protected Expression translateBinaryExpression(BinaryExpression binary) throws ParseTreeException
binary
- the translating node.protected Expression translateInstanceofExpression(InstanceofExpression insof) throws ParseTreeException
insof
- the translating node.protected Expression translateConditionalExpression(ConditionalExpression condexpr) throws ParseTreeException
condexpr
- the translationg node.protected Expression translateAssignmentExpression(AssignmentExpression assignment) throws ParseTreeException
assignment
- translationg nodeprotected Expression translateCastExpression(CastExpression castexpr) throws ParseTreeException
cast
- the translating node.protected Expression translateAllocationExpression(Expression alloc) throws ParseTreeException
alloc
- the translating node.protected Expression translateAllocationExpression(AllocationExpression construct) throws ParseTreeException
construct
- the translating node.protected Expression translateArrayAllocationExpression(ArrayAllocationExpression arrayalloc) throws ParseTreeException
arrayalloc
- the translating node.protected openjava.ptree.util.DimExprList translateDimExprList(openjava.ptree.util.DimExprList delist) throws ParseTreeException
construct
- translating nodeprotected Expression translateArrayAccess(ArrayAccess arrayaccess) throws ParseTreeException
arrayaccess
- the translating node.protected Expression translateFieldAccess(FieldAccess fieldaccess) throws ParseTreeException
fieldaccess
- the translating node.protected Expression translateMethodCall(MethodCall methodcall) throws ParseTreeException
methodcall
- the translating node.protected Expression translateSpecialName(openjava.ptree.util.SpecialName special) throws ParseTreeException
special
- the translating node.protected openjava.ptree.util.Identifier translateIdentifier(openjava.ptree.util.Identifier id) throws ParseTreeException
id
- the translating node.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |