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 voidAdd a name declaration to this context.default voidaddScopedEntity(CAstNode newNode, CAstEntity visit) associate a child entity with a given CAstNode, e.g.default CAstControlFlowRecordercfg()for recording control-flow relationships among the CAst nodesdefault TgetBreakFor(String label) for a 'break' style goto, return the control flow targetdefault CAstNodedefault CAstNodedefault TgetContinueFor(String label) for a 'continue' style goto, return the control flow targetdefault CAstNodeTypeMapRecorderfor recording types of nodesdefault Map<CAstNode, Collection<CAstEntity>> get a mapping from CAstNodes to the scoped entities (e.g.default CAstSourcePositionRecorderpos()for recording source positionsdefault Ttop()
-
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 mapsnullto 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
-