Interface TranslatorToCAst.WalkContext<C extends TranslatorToCAst.WalkContext<C,T>,T>
- All Known Subinterfaces:
JavaScriptTranslatorToCAst.WalkContext<C,
,T> JDTJava2CAstTranslator.WalkContext
- All Known Implementing Classes:
JavaScriptTranslatorToCAst.FunctionContext
,JavaScriptTranslatorToCAst.MemberDestructuringContext
,JavaScriptTranslatorToCAst.RootContext
,JavaScriptTranslatorToCAst.ScriptContext
,JDTJava2CAstTranslator.DelegatingContext
,JDTJava2CAstTranslator.MethodContext
,JDTJava2CAstTranslator.RootContext
,TranslatorToCAst.BreakContext
,TranslatorToCAst.DelegatingContext
,TranslatorToCAst.FunctionContext
,TranslatorToCAst.LoopContext
,TranslatorToCAst.RootContext
,TranslatorToCAst.TryCatchContext
- Enclosing interface:
TranslatorToCAst
public static interface TranslatorToCAst.WalkContext<C extends TranslatorToCAst.WalkContext<C,T>,T>
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Add a name declaration to this context.default void
addScopedEntity
(CAstNode newNode, CAstEntity visit) associate a child entity with a given CAstNode, e.g.default CAstControlFlowRecorder
cfg()
for recording control-flow relationships among the CAst nodesdefault T
getBreakFor
(String label) for a 'break' style goto, return the control flow targetdefault CAstNode
default CAstNode
default T
getContinueFor
(String label) for a 'continue' style goto, return the control flow targetdefault CAstNodeTypeMapRecorder
for recording types of nodesdefault Map
<CAstNode, Collection<CAstEntity>> get a mapping from CAstNodes to the scoped entities (e.g.default CAstSourcePositionRecorder
pos()
for recording source positionsdefault T
top()
-
Method Details
-
getParent
TranslatorToCAst.WalkContext<C,T> getParent() -
addNameDecl
Add a name declaration to this context. For variables or constants, n should be aCAstNode.DECL_STMT
, and the initialization of the variable (if any) may occur in a separate assignment. For functions, n should be aCAstNode.FUNCTION_STMT
, including the function body. -
getNameDecls
-
getScopedEntities
get a mapping from CAstNodes to the scoped entities (e.g. functions or local classes) introduced by those nodes. Also mapsnull
to those entities not corresponding to any node (e.g nested classes) -
getCatchTarget
-
getCatchTarget
-
top
-
addScopedEntity
associate a child entity with a given CAstNode, e.g. for a function declaration -
cfg
for recording control-flow relationships among the CAst nodes -
pos
for recording source positions -
getNodeTypeMap
for recording types of nodes -
getContinueFor
-
getBreakFor
-