Class Handler<S,T,L extends LanguageFrontend>
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.frontends.Handler<S,T,L>
-
- Type Parameters:
S- the result node or a collection of nodesT- the raw ast node specific to the parserL- the language frontend
- Direct Known Subclasses:
DeclarationHandler,DeclarationHandler,ExpressionHandler,InitializerHandler,ParameterDeclarationHandler,StatementAnalyzer
public abstract class Handler<S,T,L extends LanguageFrontend> extends java.lang.ObjectAHandleris an abstract base class for a class that translates AST nodes from a raw ast type, usually supplied by a language parser into our generic CPG nodes.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Shandle(T ctx)Searches for a handler matching the most specific superclass ofHandler.
-
-
-
Field Detail
-
log
protected static final org.slf4j.Logger log
-
map
protected final java.util.HashMap<java.lang.Class<? extends T>,HandlerInterface<S,T>> map
-
lang
protected L extends LanguageFrontend lang
-
-
Method Detail
-
handle
public S handle(T ctx)
Searches for a handler matching the most specific superclass ofHandler. The created map should thus contain a handler for every semantically different AST node and can reuse handler code as long as the handled AST nodes have a common ancestor.- Parameters:
ctx- The AST node, whose handler is matched with respect to the AST node class.- Returns:
- most specific handler.
-
-