CXXLanguageFrontend

class CXXLanguageFrontend(language: Language<CXXLanguageFrontend>, ctx: TranslationContext) : LanguageFrontend

The language frontend for translating C/C++ languages into the graph. It uses Eclipse CDT to parse the actual source code into an AST.

Based on the file ending (.c or .cpp) different dialects of Eclipse CDT are used (GCCLanguage ad GPPLanguage). This enables us (to some degree) to deal with the finer difference between C and C++ code.

Constructors

Link copied to clipboard
constructor(language: Language<CXXLanguageFrontend>, ctx: TranslationContext)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun build(init: LanguageFrontend.() -> TranslationResult): TranslationResult
Link copied to clipboard
open fun cleanup()
Link copied to clipboard
Link copied to clipboard
open override fun <T> getCodeFromRawNode(astNode: T): String?
Link copied to clipboard
fun getCodeOfSubregion(node: Node, nodeRegion: Region, subRegion: Region): String
Link copied to clipboard
open override fun <T> getLocationFromRawNode(astNode: T): PhysicalLocation?
Link copied to clipboard
fun getNewLineType(node: Node): String
Link copied to clipboard
fun mergeRegions(regionOne: Region, regionTwo: Region): Region
Link copied to clipboard
open override fun parse(file: File): TranslationUnitDeclaration
Link copied to clipboard
fun parseAll(): List<TranslationUnitDeclaration>
Link copied to clipboard
open fun process(from: Any, to: Node)
Link copied to clipboard
fun processAttributes(node: Node, owner: IASTNode)

Processes C++ attributes into Annotation nodes.

Link copied to clipboard
open fun registerObjectListener(from: Any, biConsumer: BiConsumer<Any, Node>)
Link copied to clipboard
open fun registerPredicateListener(predicate: BiPredicate<Any, Node>, biConsumer: BiConsumer<Any, Node>)
Link copied to clipboard
open override fun <N, S> setCodeAndLocation(cpgNode: N, astNode: S?)
Link copied to clipboard
open override fun <S, T> setComment(s: S, ctx: T)
Link copied to clipboard
fun typeOf(id: IASTTypeId): Type

Returns the Type that is represented by an IASTTypeId.

fun typeOf(declarator: IASTDeclarator, specifier: IASTDeclSpecifier, hint: Declaration? = null): Type

Returns te Type that is represented by the declarator and specifier. This tries to resolve as much information about the type on its own using by analyzing the AST of the supplied declarator and specifier. Finally, TypeParser.createFrom is invoked on the innermost type, but all other type adjustments, such as creating a PointerType is done within this method.

Properties

Link copied to clipboard
val config: TranslationConfiguration
Link copied to clipboard
override var ctx: TranslationContext
Link copied to clipboard
var currentTU: TranslationUnitDeclaration?
Link copied to clipboard
Link copied to clipboard
var dialect: AbstractCLikeLanguage?

The dialect used by this language frontend, either GCCLanguage for C or GPPLanguage for C++.

Link copied to clipboard
Link copied to clipboard
open override val language: Language<out LanguageFrontend>
Link copied to clipboard
open override val namespace: Name?
Link copied to clipboard
open override val scope: Scope?
Link copied to clipboard
val scopeManager: ScopeManager
Link copied to clipboard
Link copied to clipboard
val typeManager: TypeManager