AstCreator

class AstCreator(val filename: String, val config: Config, val global: CGlobal, val cdtAst: IASTTranslationUnit) extends AstCreatorBase with AstForTypesCreator with AstForFunctionsCreator with AstForPrimitivesCreator with AstForStatementsCreator with AstForExpressionsCreator with AstNodeBuilder with AstCreatorHelper with MacroHandler

Translates the Eclipse CDT AST into a CPG AST.

class AstCreatorBase
class Object
trait Matchable
class Any

Value members

Concrete methods

def createAst(): DiffGraphBuilder

Inherited methods

def absolutePath(filename: String): String

Absolute path for the given file name

Absolute path for the given file name

Inherited from:
AstCreatorBase
def asChildOfMacroCall(node: IASTNode, ast: Ast, order: Int): Ast

For the given node, determine if it is expanded from a macro, and if so, create a Call node to represent the macro invocation and attach ast as its child.

For the given node, determine if it is expanded from a macro, and if so, create a Call node to represent the macro invocation and attach ast as its child.

Inherited from:
MacroHandler
protected def astForASMDeclaration(asm: IASTASMDeclaration, order: Int): Ast
Inherited from:
AstForTypesCreator
protected def astForAliasDeclaration(aliasDeclaration: ICPPASTAliasDeclaration, order: Int): Ast
Inherited from:
AstForTypesCreator
protected def astForBlockStatement(blockStmt: IASTCompoundStatement, order: Int): Ast
protected def astForComment(comment: IASTComment): Ast
protected def astForDeclarator(declaration: IASTSimpleDeclaration, declarator: IASTDeclarator, order: Int): Ast
Inherited from:
AstForTypesCreator
protected def astForExpression(expression: IASTExpression, order: Int): Ast
protected def astForFieldReference(fieldRef: IASTFieldReference, order: Int): Ast
protected def astForFunctionDeclarator(funcDecl: IASTFunctionDeclarator, order: Int): Ast
Inherited from:
AstForFunctionsCreator
protected def astForFunctionDefinition(funcDef: IASTFunctionDefinition, order: Int): Ast
Inherited from:
AstForFunctionsCreator
protected def astForIdentifier(ident: IASTNode, order: Int): Ast
protected def astForInitializer(declarator: IASTDeclarator, init: IASTInitializer, order: Int): Ast
Inherited from:
AstForTypesCreator
protected def astForInitializerList(l: IASTInitializerList, order: Int): Ast
protected def astForLiteral(lit: IASTLiteralExpression, order: Int): Ast
protected def astForMethodRefForLambda(lambdaExpression: ICPPASTLambdaExpression): Ast
Inherited from:
AstForFunctionsCreator
protected def astForNamespaceAlias(namespaceAlias: ICPPASTNamespaceAlias, order: Int): Ast
Inherited from:
AstForTypesCreator
protected def astForQualifiedName(qualId: CPPASTQualifiedName, order: Int): Ast
protected def astForStaticAssert(a: ICPPASTStaticAssertDeclaration, order: Int): Ast
protected def astsForDeclaration(decl: IASTDeclaration, order: Int): Seq[Ast]
Inherited from:
AstForTypesCreator
protected def astsForStatement(statement: IASTStatement, order: Int): Seq[Ast]
def expandedFromMacro(node: IASTNode): Option[IASTMacroExpansionLocation]
Inherited from:
MacroHandler
def globalNamespaceBlock(): NewNamespaceBlock

Create a global namespace block for the given filename

Create a global namespace block for the given filename

Inherited from:
AstCreatorBase
protected def handleUsingDeclaration(usingDecl: ICPPASTUsingDeclaration): Seq[Ast]
Inherited from:
AstForTypesCreator
def isExpandedFromMacro(node: IASTNode): Boolean
Inherited from:
MacroHandler
def methodAst(method: NewMethod, parameters: Seq[NewMethodParameterIn], body: Ast, methodReturn: NewMethodReturn): Ast

Creates an AST that represents an entire method, including its content.

Creates an AST that represents an entire method, including its content.

Inherited from:
AstCreatorBase
def methodReturnNode(line: Option[Integer], column: Option[Integer], order: Int, tpe: String): NewMethodReturn

Create a method return node

Create a method return node

Inherited from:
AstCreatorBase
def methodStubAst(method: NewMethod, parameters: Seq[NewMethodParameterIn], methodReturn: NewMethodReturn): Ast

Creates an AST that represents a method stub, containing information about the method, its parameters, and the return type.

Creates an AST that represents a method stub, containing information about the method, its parameters, and the return type.

Inherited from:
AstCreatorBase
protected def newCallNode(node: IASTNode, name: String, fullname: String, dispatchType: String, order: Int): NewCall
Inherited from:
AstNodeBuilder
protected def newControlStructureNode(node: IASTNode, controlStructureType: String, code: String, order: Int): NewControlStructure
Inherited from:
AstNodeBuilder
protected def newJumpTarget(node: IASTNode, order: Int): NewJumpTarget
Inherited from:
AstNodeBuilder
protected def newMethodRefNode(code: String, methodFullName: String, typeFullName: String, node: IASTNode): NewMethodRef
Inherited from:
AstNodeBuilder
protected def newTypeDecl(name: String, fullname: String, filename: String, code: String, astParentType: String, astParentFullName: String, order: Int, inherits: Seq[String], alias: Option[String], line: Option[Integer], column: Option[Integer]): NewTypeDecl
Inherited from:
AstNodeBuilder
protected def newUnknown(node: IASTNode, order: Int): NewUnknown
Inherited from:
AstNodeBuilder
@nowarn
def nodeSignature(node: IASTNode): String

The CDT utility method is unfortunately in a class that is marked as deprecated, however, this is because the CDT team would like to discourage its use but at the same time does not plan to remove this code.

The CDT utility method is unfortunately in a class that is marked as deprecated, however, this is because the CDT team would like to discourage its use but at the same time does not plan to remove this code.

Inherited from:
MacroHandler
protected def templateParameters(e: IASTNode): Option[String]
Inherited from:
AstForTypesCreator

Concrete fields

val cdtAst: IASTTranslationUnit
val filename: String
protected val logger: Logger
protected val methodAstParentStack: ListBuffer[NewNode]
protected val scope: Scope[String, (NewNode, String), NewNode]
protected val usingDeclarationMappings: Map[String, String]

Inherited fields

val diffGraph: DiffGraphBuilder
Inherited from:
AstCreatorBase