Class CXXLanguageFrontend
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.frontends.LanguageFrontend
-
- de.fraunhofer.aisec.cpg.frontends.cpp.CXXLanguageFrontend
-
public class CXXLanguageFrontend extends LanguageFrontend
The language frontend for translating CXX languages into the graph. It uses Eclipse CDT to parse the actual source code into an AST.Frontend for ONE CXX File
-
-
Field Summary
-
Fields inherited from class de.fraunhofer.aisec.cpg.frontends.LanguageFrontend
config, log, objectListeners, predicateListeners, processedMapping, scopeManager
-
-
Constructor Summary
Constructors Constructor Description CXXLanguageFrontend(TranslationConfiguration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeclarationcacheDeclaration(org.eclipse.cdt.core.dom.ast.IBinding binding, Declaration declaration)voidcleanup()voidexpressionRefersToDeclaration(Expression expression, org.eclipse.cdt.core.dom.ast.IASTExpression iastExpression)DeclarationgetCachedDeclaration(org.eclipse.cdt.core.dom.ast.IBinding binding)<T> java.lang.StringgetCodeFromRawNode(T astNode)Returns the raw code of the ast node, generic for java or c++ ast nodes.DeclarationHandlergetDeclarationHandler()de.fraunhofer.aisec.cpg.frontends.cpp.DeclarationListHandlergetDeclarationListHandler()de.fraunhofer.aisec.cpg.frontends.cpp.DeclaratorHandlergetDeclaratorHandler()de.fraunhofer.aisec.cpg.frontends.cpp.ExpressionHandlergetExpressionHandler()InitializerHandlergetInitializerHandler()ParameterDeclarationHandlergetParameterDeclarationHandler()<T> @NonNull RegiongetRegionFromRawNode(T astNode)Returns the Region of the code with line and column, index starting at 1, generic for java or c++ ast nodes.de.fraunhofer.aisec.cpg.frontends.cpp.StatementHandlergetStatementHandler()TranslationUnitDeclarationparse(java.io.File file)<S,T>
voidsetComment(S s, T ctx)-
Methods inherited from class de.fraunhofer.aisec.cpg.frontends.LanguageFrontend
addRecord, clearProcessed, getCodeOfSubregion, getNamespaceDelimiter, getNewLineType, getRecords, getScopeManager, mergeRegions, parseAll, process, registerObjectListener, registerPredicateListener, setCodeAndRegion, setScopeManager
-
-
-
-
Constructor Detail
-
CXXLanguageFrontend
public CXXLanguageFrontend(TranslationConfiguration config)
-
-
Method Detail
-
parse
public TranslationUnitDeclaration parse(java.io.File file) throws TranslationException
- Specified by:
parsein classLanguageFrontend- Throws:
TranslationException
-
getCodeFromRawNode
public <T> java.lang.String getCodeFromRawNode(T astNode)
Description copied from class:LanguageFrontendReturns the raw code of the ast node, generic for java or c++ ast nodes.- Specified by:
getCodeFromRawNodein classLanguageFrontend
-
getRegionFromRawNode
public <T> @NonNull Region getRegionFromRawNode(T astNode)
Description copied from class:LanguageFrontendReturns the Region of the code with line and column, index starting at 1, generic for java or c++ ast nodes.- Specified by:
getRegionFromRawNodein classLanguageFrontend
-
expressionRefersToDeclaration
public void expressionRefersToDeclaration(Expression expression, org.eclipse.cdt.core.dom.ast.IASTExpression iastExpression)
-
cacheDeclaration
public Declaration cacheDeclaration(org.eclipse.cdt.core.dom.ast.IBinding binding, Declaration declaration)
-
getCachedDeclaration
public Declaration getCachedDeclaration(org.eclipse.cdt.core.dom.ast.IBinding binding)
-
cleanup
public void cleanup()
- Overrides:
cleanupin classLanguageFrontend
-
setComment
public <S,T> void setComment(S s, T ctx)- Specified by:
setCommentin classLanguageFrontend
-
getDeclarationHandler
public DeclarationHandler getDeclarationHandler()
-
getDeclarationListHandler
public de.fraunhofer.aisec.cpg.frontends.cpp.DeclarationListHandler getDeclarationListHandler()
-
getDeclaratorHandler
public de.fraunhofer.aisec.cpg.frontends.cpp.DeclaratorHandler getDeclaratorHandler()
-
getExpressionHandler
public de.fraunhofer.aisec.cpg.frontends.cpp.ExpressionHandler getExpressionHandler()
-
getInitializerHandler
public InitializerHandler getInitializerHandler()
-
getParameterDeclarationHandler
public ParameterDeclarationHandler getParameterDeclarationHandler()
-
getStatementHandler
public de.fraunhofer.aisec.cpg.frontends.cpp.StatementHandler getStatementHandler()
-
-