AstCreatorBase

io.joern.x2cpg.AstCreatorBase
abstract class AstCreatorBase(filename: String)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Abstract methods

def createAst(): DiffGraphBuilder

Concrete methods

def absolutePath(filename: String): String

Absolute path for the given file name

Absolute path for the given file name

Attributes

def blockAst(blockNode: NewBlock, statements: List[Ast]): Ast

For a given block node and statement ASTs, create an AST that represents the block. The main purpose of this method is to increase the readability of the code which creates block asts.

For a given block node and statement ASTs, create an AST that represents the block. The main purpose of this method is to increase the readability of the code which creates block asts.

Attributes

def callAst(callNode: NewCall, arguments: Seq[Ast], receiver: Option[Ast], withRecvArgEdge: Boolean): Ast

For a given call node, arguments, and optionally, a receiver, create an AST that represents the call site. The main purpose of this method is to automatically assign the correct argument indices.

For a given call node, arguments, and optionally, a receiver, create an AST that represents the call site. The main purpose of this method is to automatically assign the correct argument indices.

Attributes

def controlStructureAst(controlStructureNode: NewControlStructure, condition: Option[Ast], children: List[Ast], placeConditionLast: Boolean): Ast

For a given node, condition AST and children ASTs, create an AST that represents the control structure. The main purpose of this method is to automatically assign the correct condition edges.

For a given node, condition AST and children ASTs, create an AST that represents the control structure. The main purpose of this method is to automatically assign the correct condition edges.

Attributes

def forAst(forNode: NewControlStructure, locals: Seq[Ast], initAsts: Seq[Ast], conditionAsts: Seq[Ast], updateAsts: Seq[Ast], bodyAst: Ast): Ast
def globalNamespaceBlock(): NewNamespaceBlock

Create a global namespace block for the given filename

Create a global namespace block for the given filename

Attributes

def methodAst(method: NewMethod, parameters: Seq[NewMethodParameterIn], body: Ast, methodReturn: NewMethodReturn, modifiers: Seq[NewModifier]): Ast

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

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

Attributes

def methodAstWithAnnotations(method: NewMethod, parameters: Seq[Ast], body: Ast, methodReturn: NewMethodReturn, modifiers: Seq[NewModifier], annotations: Seq[Ast]): Ast

Creates an AST that represents an entire method, including its content and with support for both method and parameter annotations.

Creates an AST that represents an entire method, including its content and with support for both method and parameter annotations.

Attributes

def methodReturnNode(tfn: String, dtfn: Option[String], line: Option[Integer], column: Option[Integer]): NewMethodReturn

Create a method return node

Create a method return node

Attributes

def methodStubAst(method: NewMethod, parameters: Seq[NewMethodParameterIn], methodReturn: NewMethodReturn, modifiers: Seq[NewModifier]): 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.

Attributes

def returnAst(returnNode: NewReturn, arguments: Seq[Ast]): Ast

For a given return node and arguments, create an AST that represents the return instruction. The main purpose of this method is to automatically assign the correct argument indices.

For a given return node and arguments, create an AST that represents the return instruction. The main purpose of this method is to automatically assign the correct argument indices.

Attributes

def setArgumentIndices(arguments: Seq[Ast]): Unit
def staticInitMethodAst(initAsts: List[Ast], fullName: String, signature: Option[String], returnType: String): Ast
def tryCatchAst(tryNode: NewControlStructure, tryBodyAst: Ast, catchAsts: Seq[Ast], finallyAst: Option[Ast]): Ast

For the given try body, catch ASTs and finally AST, create a try-catch-finally AST with orders set correctly for the ossdataflow engine.

For the given try body, catch ASTs and finally AST, create a try-catch-finally AST with orders set correctly for the ossdataflow engine.

Attributes

def withArgumentIndex[T <: ExpressionNew](node: T, argIdxOpt: Option[Int]): T
def withArgumentName[T <: ExpressionNew](node: T, argNameOpt: Option[String]): T
def withIndex[T, X](nodes: Seq[T])(f: (T, Int) => X): Seq[X]
def withIndex[T, X](nodes: Array[T])(f: (T, Int) => X): Seq[X]
def wrapMultipleInBlock(asts: Seq[Ast], lineNumber: Option[Integer]): Ast

Concrete fields

val diffGraph: DiffGraphBuilder