AstCreator

io.joern.rubysrc2cpg.astcreation.AstCreator
class AstCreator(filename: String, global: Global) extends AstCreatorBase

Attributes

Graph
Supertypes
class AstCreatorBase
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Classlikes

object Defines

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Defines.type

Value members

Concrete methods

def astForAdditiveExpressionContext(ctx: AdditiveExpressionContext): Ast
def astForAliasStatementContext(ctx: AliasStatementContext): Ast
def astForArrayConstructorPrimaryContext(ctx: ArrayConstructorPrimaryContext): Ast
def astForAssignmentLikeMethodIdentifierContext(ctx: AssignmentLikeMethodIdentifierContext): Ast
def astForBeginExpressionPrimaryContext(ctx: BeginExpressionPrimaryContext): Ast
def astForBeginStatementContext(ctx: BeginStatementContext): Ast
def astForBinaryExpression(lhs: ExpressionContext, rhs: ExpressionContext, operatorToken: Token): Ast
def astForBitwiseAndExpressionContext(ctx: BitwiseAndExpressionContext): Ast
def astForBitwiseOrExpressionContext(ctx: BitwiseOrExpressionContext): Ast
def astForBitwiseShiftExpressionContext(ctx: BitwiseShiftExpressionContext): Ast
def astForBodyStatementContext(ctx: BodyStatementContext): Ast
def astForCaseExpressionPrimaryContext(ctx: CaseExpressionPrimaryContext): Ast
def astForChainedInvocationPrimaryContext(ctx: ChainedInvocationPrimaryContext): Ast
def astForChainedInvocationWithoutArgumentsPrimaryContext(ctx: ChainedInvocationWithoutArgumentsPrimaryContext): Ast
def astForChainedScopedConstantReferencePrimaryContext(ctx: ChainedScopedConstantReferencePrimaryContext): Ast
def astForClassDefinitionContext(ctx: ClassOrModuleReferenceContext): Ast
def astForClassDefinitionPrimaryContext(ctx: ClassDefinitionPrimaryContext): Ast
def astForConditionalOperatorExpressionContext(ctx: ConditionalOperatorExpressionContext): Ast
def astForDefinedMethodNameContext(ctx: DefinedMethodNameContext): Ast
def astForDefinedMethodNameOrSymbolContext(ctx: DefinedMethodNameOrSymbolContext): Ast
def astForEndStatementContext(ctx: EndStatementContext): Ast
def astForEqualityExpressionContext(ctx: EqualityExpressionContext): Ast
def astForExpressionContext(ctx: ExpressionContext): Ast
def astForExpressionOrCommandContext(ctx: ExpressionOrCommandContext): Ast
def astForExpressionOrCommandsContext(ctx: ExpressionOrCommandsContext): Ast
def astForForExpressionPrimaryContext(ctx: ForExpressionPrimaryContext): Ast
def astForGroupingExpressionPrimaryContext(ctx: GroupingExpressionPrimaryContext): Ast
def astForHashConstructorPrimaryContext(ctx: HashConstructorPrimaryContext): Ast
def astForIfExpressionPrimaryContext(ctx: IfExpressionPrimaryContext): Ast
def astForIndexingExpressionPrimaryContext(ctx: IndexingExpressionPrimaryContext): Ast
def astForInvocationExpressionOrCommandContext(ctx: InvocationExpressionOrCommandContext): Ast
def astForInvocationWithBlockOnlyPrimaryContext(ctx: InvocationWithBlockOnlyPrimaryContext): Ast
def astForInvocationWithParenthesesPrimaryContext(ctx: InvocationWithParenthesesPrimaryContext): Ast
def astForIsDefinedExpressionContext(ctx: IsDefinedExpressionContext): Ast
def astForIsDefinedPrimaryContext(ctx: IsDefinedPrimaryContext): Ast
def astForJumpExpressionPrimaryContext(ctx: JumpExpressionPrimaryContext): Ast
def astForLiteralPrimaryContext(ctx: LiteralPrimaryContext): Ast
def astForMethodDefinitionContext(ctx: MethodDefinitionContext): Ast
def astForMethodIdentifierContext(ctx: MethodIdentifierContext): Ast
def astForMethodNameContext(ctx: MethodNameContext): Ast
def astForMethodNamePartContext(ctx: MethodNamePartContext): Ast
def astForMethodOnlyIdentifier(ctx: MethodOnlyIdentifierContext): Ast
def astForMethodOnlyIdentifierPrimaryContext(ctx: MethodOnlyIdentifierPrimaryContext): Ast
def astForMethodParameterPartContext(ctx: MethodParameterPartContext): Ast
def astForModifierStatementContext(ctx: ModifierStatementContext): Ast
def astForModuleDefinitionPrimaryContext(ctx: ModuleDefinitionPrimaryContext): Ast
def astForMultipleAssignmentExpressionContext(ctx: MultipleAssignmentExpressionContext): Ast
def astForMultipleRightHandSideContext(ctx: MultipleRightHandSideContext): (Ast, String)
def astForMultiplicativeExpressionContext(ctx: MultiplicativeExpressionContext): Ast
def astForNotExpressionOrCommandContext(ctx: NotExpressionOrCommandContext): Ast
def astForOperatorAndExpressionContext(ctx: OperatorAndExpressionContext): Ast
def astForOperatorOrExpressionContext(ctx: OperatorOrExpressionContext): Ast
def astForOrAndExpressionOrCommandContext(ctx: OrAndExpressionOrCommandContext): Ast
def astForPowerExpressionContext(ctx: PowerExpressionContext): Ast
def astForPrimaryContext(ctx: PrimaryContext): Ast
def astForPseudoVariableIdentifierContext(ctx: PseudoVariableIdentifierContext): Ast
def astForRangeExpressionContext(ctx: RangeExpressionContext): Ast
def astForRelationalExpressionContext(ctx: RelationalExpressionContext): Ast
def astForSimpleMethodNamePartContext(ctx: SimpleMethodNamePartContext): Ast
def astForSimpleScopedConstantReferencePrimaryContext(ctx: SimpleScopedConstantReferencePrimaryContext): Ast
def astForSingleAssignmentExpressionContext(ctx: SingleAssignmentExpressionContext): Ast
def astForSingleLeftHandSideContext(ctx: SingleLeftHandSideContext, rhsRetType: String): Ast
def astForSingletonMethodNamePartContext(ctx: SingletonMethodNamePartContext): Ast
def astForSingletonObjextContext(ctx: SingletonObjectContext): Ast
def astForSplattingArgumentContext(ctx: SplattingArgumentContext): Ast
def astForStatementContext(ctx: StatementContext): Ast
def astForStatementsContext(ctx: StatementsContext): Ast
def astForSuperExpressionPrimaryContext(ctx: SuperExpressionPrimaryContext): Ast
def astForSymbolContext(ctx: SymbolContext): Ast
def astForUnaryExpressionContext(ctx: UnaryExpressionContext): Ast
def astForUnaryMinusExpressionContext(ctx: UnaryMinusExpressionContext): Ast
def astForUndefStatementContext(ctx: UndefStatementContext): Ast
def astForUnlessExpressionPrimaryContext(ctx: UnlessExpressionPrimaryContext): Ast
def astForUntilExpressionPrimaryContext(ctx: UntilExpressionPrimaryContext): Ast
def astForVariableIdentifierContext(ctx: VariableIdentifierContext, varType: String): Ast
def astForVariableRefenceContext(ctx: VariableReferenceContext): Ast
def astForVariableReferencePrimaryContext(ctx: VariableReferencePrimaryContext): Ast
def astForWhileExpressionPrimaryContext(ctx: WhileExpressionPrimaryContext): Ast
def astForYieldWithOptionalArgumentPrimaryContext(ctx: YieldWithOptionalArgumentPrimaryContext): Ast
override def createAst(): DiffGraphBuilder

Attributes

Definition Classes
AstCreatorBase

Inherited methods

def absolutePath(filename: String): String

Absolute path for the given file name

Absolute path for the given file name

Attributes

Inherited from:
AstCreatorBase
def annotationAssignmentAst(assignmentValueName: String, code: String, assignmentAst: Ast): Ast

Creates an AST that represents an annotation assignment with a name for the assigned value, its overall code, and the respective assignment AST.

Creates an AST that represents an annotation assignment with a name for the assigned value, its overall code, and the respective assignment AST.

Attributes

Inherited from:
AstCreatorBase
def annotationAst(annotation: NewAnnotation, children: Seq[Ast]): Ast

Creates an AST that represents an annotation, including its content (annotation parameter assignments).

Creates an AST that represents an annotation, including its content (annotation parameter assignments).

Attributes

Inherited from:
AstCreatorBase
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

Inherited from:
AstCreatorBase
def callAst(callNode: NewCall, arguments: Seq[Ast], base: Option[Ast], receiver: Option[Ast]): Ast

Create an abstract syntax tree for a call, including CPG-specific edges required for arguments and the receiver.

Create an abstract syntax tree for a call, including CPG-specific edges required for arguments and the receiver.

Our call representation is inspired by ECMAScript, that is, in addition to arguments, a call has a base and a receiver. For languages other than Javascript, leave receiver empty for now.

Attributes

arguments

arguments (without the base argument (instance))

base

the value to use as this in the method call.

callNode

the node that represents the entire call

receiver

the object in which the property lookup is performed

Inherited from:
AstCreatorBase
def controlStructureAst(controlStructureNode: NewControlStructure, condition: Option[Ast], children: Seq[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

Inherited from:
AstCreatorBase
def doWhileAst(condition: Option[Ast], body: Seq[Ast], code: Option[String], lineNumber: Option[Integer], columnNumber: Option[Integer]): Ast

Attributes

Inherited from:
AstCreatorBase
def forAst(forNode: NewControlStructure, locals: Seq[Ast], initAsts: Seq[Ast], conditionAsts: Seq[Ast], updateAsts: Seq[Ast], bodyAsts: Seq[Ast]): Ast

Attributes

Inherited from:
AstCreatorBase
def forAst(forNode: NewControlStructure, locals: Seq[Ast], initAsts: Seq[Ast], conditionAsts: Seq[Ast], updateAsts: Seq[Ast], bodyAst: Ast): Ast

Attributes

Inherited from:
AstCreatorBase
def globalNamespaceBlock(): NewNamespaceBlock

Create a global namespace block for the given filename

Create a global namespace block for the given filename

Attributes

Inherited from:
AstCreatorBase
def methodAst(method: NewMethod, parameters: Seq[Ast], 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

Inherited from:
AstCreatorBase
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

Inherited from:
AstCreatorBase
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

Inherited from:
AstCreatorBase
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

Inherited from:
AstCreatorBase
def setArgumentIndices(arguments: Seq[Ast]): Unit

Attributes

Inherited from:
AstCreatorBase
def staticInitMethodAst(initAsts: List[Ast], fullName: String, signature: Option[String], returnType: String): Ast

Attributes

Inherited from:
AstCreatorBase
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

Inherited from:
AstCreatorBase
def whileAst(condition: Option[Ast], body: Seq[Ast], code: Option[String], lineNumber: Option[Integer], columnNumber: Option[Integer]): Ast

Attributes

Inherited from:
AstCreatorBase
def withArgumentIndex[T <: ExpressionNew](node: T, argIdxOpt: Option[Int]): T

Attributes

Inherited from:
AstCreatorBase
def withArgumentName[T <: ExpressionNew](node: T, argNameOpt: Option[String]): T

Attributes

Inherited from:
AstCreatorBase
def withIndex[T, X](nodes: Array[T])(f: (T, Int) => X): Seq[X]

Attributes

Inherited from:
AstCreatorBase
def withIndex[T, X](nodes: Seq[T])(f: (T, Int) => X): Seq[X]

Attributes

Inherited from:
AstCreatorBase
def wrapMultipleInBlock(asts: Seq[Ast], lineNumber: Option[Integer]): Ast

Attributes

Inherited from:
AstCreatorBase

Inherited fields

val diffGraph: DiffGraphBuilder

Attributes

Inherited from:
AstCreatorBase