AstCreator

io.joern.rubysrc2cpg.deprecated.astcreation.AstCreator
class AstCreator(filename: String, programCtx: ProgramContext, val packageContext: PackageContext, projectRoot: Option[String])(implicit withSchemaValidation: ValidationMode) extends AstCreatorBase, AstNodeBuilder[ParserRuleContext, AstCreator], AstForPrimitivesCreator, AstForStatementsCreator, AstForFunctionsCreator, AstForExpressionsCreator, AstForDeclarationsCreator, AstForTypesCreator, AstForControlStructuresCreator, AstCreatorHelper, AstForHereDocsCreator

Attributes

Graph
Supertypes
trait AstNodeBuilder[ParserRuleContext, AstCreator]
class AstCreatorBase
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited classlikes

implicit protected class BlockContextExt(val ctx: BlockContext)

Attributes

Inherited from:
AstForStatementsCreator
Supertypes
class Object
trait Matchable
class Any
implicit class ClassDefinitionPrimaryContextExt(val ctx: ClassDefinitionPrimaryContext)

Attributes

Inherited from:
AstForTypesCreator
Supertypes
class Object
trait Matchable
class Any
implicit class ClassOrModuleReferenceContextExt(val ctx: ClassOrModuleReferenceContext)

Attributes

Inherited from:
AstForTypesCreator
Supertypes
class Object
trait Matchable
class Any
implicit class TerminalNodeExt(n: TerminalNode)

Attributes

Inherited from:
AstCreatorHelper
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def astForAssociationContext(ctx: AssociationContext): Seq[Ast]
def astForCallNode(ctx: ParserRuleContext, code: String, isYieldBlock: Boolean): Ast
def astForChainedInvocationWithoutArgumentsPrimaryContext(ctx: ChainedInvocationWithoutArgumentsPrimaryContext): Seq[Ast]
def astForExpressionContext(ctx: ExpressionContext): Seq[Ast]
def astForInvocationExpressionOrCommandContext(ctx: InvocationExpressionOrCommandContext): Seq[Ast]
def astForMethodIdentifierContext(ctx: MethodIdentifierContext, code: String): Seq[Ast]
def astForMultipleLeftHandSideContext(ctx: MultipleLeftHandSideContext): Seq[Ast]
def astForPrimaryContext(ctx: PrimaryContext): Seq[Ast]
def astForRescueClauseContext(ctx: RescueClauseContext): 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
protected def annotationNode(node: ParserRuleContext, code: String, name: String, fullName: String): NewAnnotation

Attributes

Inherited from:
AstNodeBuilder
protected def astForAdditiveExpression(ctx: AdditiveExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForAndExpression(ctx: OperatorAndExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForArgument(ctx: ArgumentContext): Seq[Ast]

Attributes

Inherited from:
AstForDeclarationsCreator
protected def astForArguments(ctx: ArgumentsContext): Seq[Ast]

Attributes

Inherited from:
AstForDeclarationsCreator
protected def astForArrayLiteral(ctx: ArrayConstructorContext): Seq[Ast]

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForAssignment(lhs: NewNode, rhs: NewNode, lineNumber: Option[Integer], colNumber: Option[Integer]): Ast

Attributes

Inherited from:
AstCreatorHelper
protected def astForBitwiseAndExpression(ctx: BitwiseAndExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForBitwiseOrExpression(ctx: BitwiseOrExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForBitwiseShiftExpression(ctx: BitwiseShiftExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForBlock(ctx: BlockContext, blockMethodName: Option[String]): Ast

Attributes

Inherited from:
AstForStatementsCreator
protected def astForBlockFunction(ctxStmt: StatementsContext, ctxParam: Option[BlockParameterContext], blockMethodName: String, lineStart: Int, lineEnd: Int, colStart: Int, colEnd: Int): Seq[Ast]

Attributes

Inherited from:
AstForFunctionsCreator
protected def astForBodyStatementContext(ctx: BodyStatementContext, isMethodBody: Boolean): Seq[Ast]

Attributes

Inherited from:
AstForStatementsCreator
protected def astForBreakArgsInvocation(ctx: BreakArgsInvocationWithoutParenthesesContext): Seq[Ast]

Attributes

Inherited from:
AstForControlStructuresCreator
protected def astForCaseExpressionPrimaryContext(ctx: CaseExpressionPrimaryContext): Seq[Ast]

Attributes

Inherited from:
AstForControlStructuresCreator
def astForClassDeclaration(ctx: ClassDefinitionPrimaryContext): Seq[Ast]

Attributes

Inherited from:
AstForTypesCreator
def astForClassExpression(ctx: ClassDefinitionPrimaryContext): Seq[Ast]

Attributes

Inherited from:
AstForTypesCreator
protected def astForCommand(ctx: CommandContext): Seq[Ast]

Attributes

Inherited from:
AstForStatementsCreator
protected def astForCompoundStatement(ctx: CompoundStatementContext, isMethodBody: Boolean, canConsiderAsLeaf: Boolean): Seq[Ast]

Attributes

Inherited from:
AstForStatementsCreator
protected def astForConcatenatedStringExpressions(ctx: ConcatenatedStringExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForControlStructure(parserTypeName: String, node: TerminalNode, controlStructureType: String, code: String): Ast

Attributes

Inherited from:
AstCreatorHelper
def astForDefinedMethodNameOrSymbolContext(ctx: DefinedMethodNameOrSymbolContext): Seq[Ast]

Attributes

Inherited from:
AstForFunctionsCreator
protected def astForDoBlock(ctx: DoBlockContext, blockMethodName: Option[String]): Ast

Attributes

Inherited from:
AstForStatementsCreator
protected def astForDoubleQuotedStringLiteral(ctx: DoubleQuotedStringLiteralContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForEncodingPseudoIdentifier(ctx: EncodingPseudoVariableIdentifierContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForEqualityExpression(ctx: EqualityExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForExpressionOrCommand(ctx: ExpressionOrCommandContext): Seq[Ast]

Attributes

Inherited from:
AstForStatementsCreator
protected def astForFalseLiteral(ctx: FalsePseudoVariableIdentifierContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForFieldAccess(ctx: ParserRuleContext, baseNode: NewNode): Ast

Attributes

Inherited from:
AstCreatorHelper
protected def astForFilePseudoIdentifier(ctx: FilePseudoVariableIdentifierContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForForExpression(ctx: ForExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForHereDocArgument(ctx: HereDocArgumentContext): Seq[Ast]

Attributes

Inherited from:
AstForHereDocsCreator
protected def astForHereDocLiteral(ctx: HereDocLiteralContext): Ast

Attributes

Inherited from:
AstForHereDocsCreator
protected def astForIfExpression(ctx: IfExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForIndexingExpressionPrimaryContext(ctx: IndexingExpressionPrimaryContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForIsDefinedExpression(ctx: IsDefinedExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForIsDefinedPrimaryExpression(ctx: IsDefinedPrimaryContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForJumpExpressionPrimaryContext(ctx: JumpExpressionPrimaryContext): Seq[Ast]

Attributes

Inherited from:
AstForControlStructuresCreator
protected def astForLinePseudoIdentifier(ctx: LinePseudoVariableIdentifierContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForLiteralPrimaryExpression(ctx: LiteralPrimaryContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForMethodDefinitionContext(ctx: MethodDefinitionContext): Seq[Ast]

Attributes

Inherited from:
AstForFunctionsCreator
protected def astForMethodNameContext(ctx: MethodNameContext): Seq[Ast]

Attributes

Inherited from:
AstForFunctionsCreator
def astForModuleDefinitionPrimaryContext(ctx: ModuleDefinitionPrimaryContext): Seq[Ast]

Attributes

Inherited from:
AstForTypesCreator
protected def astForMultipleAssignmentExpressionContext(ctx: MultipleAssignmentExpressionContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForMultipleRightHandSideContext(ctx: MultipleRightHandSideContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForMultiplicativeExpression(ctx: MultiplicativeExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForMultiplicativePercentExpression(ctx: MultiplicativeExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForMultiplicativeSlashExpression(ctx: MultiplicativeExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForMultiplicativeStarExpression(ctx: MultiplicativeExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForNextArgsInvocation(ctx: NextArgsInvocationWithoutParenthesesContext): Seq[Ast]

Attributes

Inherited from:
AstForControlStructuresCreator
protected def astForNilLiteral(ctx: NilPseudoVariableIdentifierContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForNumericLiteral(ctx: NumericLiteralContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForOrExpression(ctx: OperatorOrExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForPowerExpression(ctx: PowerExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForProcDefinitionContext(ctx: ProcDefinitionContext): Seq[Ast]

Attributes

Inherited from:
AstForFunctionsCreator
protected def astForQuotedRegexInterpolation(ctx: QuotedRegexInterpolationContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForQuotedStringExpression(ctx: QuotedStringExpressionContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
def astForRangeExpressionContext(ctx: RangeExpressionContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForRegexInterpolationPrimaryContext(ctx: RegexInterpolationContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForRegularExpressionLiteral(ctx: RegularExpressionLiteralContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForRelationalExpression(ctx: RelationalExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForRescueClause(ctx: BodyStatementContext): Ast

Attributes

Inherited from:
AstForControlStructuresCreator
protected def astForSelfPseudoIdentifier(ctx: SelfPseudoVariableIdentifierContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForSimpleString(ctx: SimpleStringContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForSingleAssignmentExpressionContext(ctx: SingleAssignmentExpressionContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForSingleLeftHandSideContext(ctx: SingleLeftHandSideContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForSingleQuotedStringLiteral(ctx: SingleQuotedStringLiteralContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForStatements(ctx: StatementsContext, isMethodBody: Boolean, canConsiderAsLeaf: Boolean): Seq[Ast]

Attributes

Inherited from:
AstForStatementsCreator
protected def astForStringExpression(ctx: StringExpressionContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
def astForStringInterpolationContext(ctx: InterpolatedStringExpressionContext): Seq[Ast]

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForSuperCall(ctx: ParserRuleContext, arguments: Seq[Ast]): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForSuperExpression(ctx: SuperExpressionPrimaryContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForSymbolLiteral(ctx: SymbolContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForTernaryConditionalOperator(ctx: ConditionalOperatorExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForTrueLiteral(ctx: TruePseudoVariableIdentifierContext): Ast

Attributes

Inherited from:
AstForPrimitivesCreator
protected def astForUnaryExpression(ctx: UnaryExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForUnaryMinusExpression(ctx: UnaryMinusExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForUnlessExpression(ctx: UnlessExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForUntilExpression(ctx: UntilExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForVariableIdentifierHelper(ctx: VariableIdentifierContext, definitelyIdentifier: Boolean): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForVariableReference(ctx: VariableReferenceContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForWhileExpression(ctx: WhileExpressionContext): Ast

Attributes

Inherited from:
AstForExpressionsCreator
protected def astForYieldCall(ctx: ParserRuleContext, argumentsCtx: Option[ArgumentsContext]): Ast

Attributes

Inherited from:
AstForExpressionsCreator
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
protected def blockNode(node: ParserRuleContext, code: String, typeFullName: String): NewBlock

Attributes

Inherited from:
AstNodeBuilder
protected def blockNode(node: ParserRuleContext): NewBlock

Attributes

Inherited from:
AstNodeBuilder
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.

Value parameters

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

Attributes

Inherited from:
AstCreatorBase
def callNode(node: ParserRuleContext, code: String, name: String, methodFullName: String, dispatchType: String, signature: Option[String], typeFullName: Option[String]): NewCall

Attributes

Inherited from:
AstNodeBuilder
def callNode(node: ParserRuleContext, code: String, name: String, methodFullName: String, dispatchType: String): NewCall

Attributes

Inherited from:
AstNodeBuilder
override def code(node: ParserRuleContext): String

Attributes

Definition Classes
Inherited from:
AstCreatorHelper
protected def column(ctx: ParserRuleContext): Option[Integer]

Attributes

Inherited from:
AstCreatorHelper
protected def columnEnd(ctx: ParserRuleContext): Option[Integer]

Attributes

Inherited from:
AstCreatorHelper
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
protected def controlStructureNode(node: ParserRuleContext, controlStructureType: String, code: String): NewControlStructure

Attributes

Inherited from:
AstNodeBuilder
protected def createIdentifierWithScope(name: String, code: String, typeFullName: String, dynamicTypeHints: Seq[String], lineNumber: Option[Integer], columnNumber: Option[Integer], definitelyIdentifier: Boolean): NewNode

Attributes

Inherited from:
AstCreatorHelper
protected def createIdentifierWithScope(ctx: ParserRuleContext, name: String, code: String, typeFullName: String, dynamicTypeHints: Seq[String], definitelyIdentifier: Boolean): NewNode

Attributes

Inherited from:
AstCreatorHelper
protected def createLiteralNode(code: String, typeFullName: String, dynamicTypeHints: Seq[String], lineNumber: Option[Int], columnNumber: Option[Int]): NewLiteral

Attributes

Inherited from:
AstCreatorHelper
protected def createMethodParameterIn(name: String, lineNumber: Option[Integer], colNumber: Option[Integer], typeFullName: String, order: Int, index: Int): NewMethodParameterIn

Attributes

Inherited from:
AstCreatorHelper
protected def createOpCall(node: TerminalNode, operation: String, code: String, typeFullName: String): NewCall

Attributes

Inherited from:
AstCreatorHelper
protected def createThisIdentifier(ctx: ParserRuleContext, typeFullName: String, dynamicTypeHints: List[String]): NewIdentifier

Attributes

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

Attributes

Inherited from:
AstCreatorBase
protected def fieldIdentifierNode(node: ParserRuleContext, name: String, code: String): NewFieldIdentifier

Attributes

Inherited from:
AstNodeBuilder
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
protected def getOperatorName(token: Token): String

Attributes

Inherited from:
AstCreatorHelper
protected def getUnusedVariableNames(usedVariableNames: HashMap[String, Int], variableName: String): String

Attributes

Inherited from:
AstCreatorHelper
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
protected def identifierNode(node: ParserRuleContext, name: String, code: String, typeFullName: String, dynamicTypeHints: Seq[String]): NewIdentifier

Attributes

Inherited from:
AstNodeBuilder
protected def isBuiltin(x: String): Boolean

Attributes

Inherited from:
AstCreatorHelper
protected def jumpTargetNode(node: ParserRuleContext, name: String, code: String, parserTypeName: Option[String]): NewJumpTarget

Attributes

Inherited from:
AstNodeBuilder
protected def lastStmtAsReturnAst(ctx: ParserRuleContext, lastStmtAst: Ast, maybeCode: Option[String]): Ast

If the last statement is a return, this is returned. If not, then a return node is created.

If the last statement is a return, this is returned. If not, then a return node is created.

Attributes

Inherited from:
AstForStatementsCreator
protected def line(ctx: ParserRuleContext): Option[Integer]

Attributes

Inherited from:
AstCreatorHelper
protected def lineEnd(ctx: ParserRuleContext): Option[Integer]

Attributes

Inherited from:
AstCreatorHelper
protected def literalNode(node: ParserRuleContext, code: String, typeFullName: String, dynamicTypeHints: Seq[String]): NewLiteral

Attributes

Inherited from:
AstNodeBuilder
protected def localNode(node: ParserRuleContext, name: String, code: String, typeFullName: String, closureBindingId: Option[String]): NewLocal

Attributes

Inherited from:
AstNodeBuilder
protected def memberNode(node: ParserRuleContext, name: String, code: String, typeFullName: String, dynamicTypeHints: Seq[String]): NewMember

Attributes

Inherited from:
AstNodeBuilder
protected def memberNode(node: ParserRuleContext, name: String, code: String, typeFullName: String): NewMember

Attributes

Inherited from:
AstNodeBuilder
def membersFromStatementAsts(ast: Ast): Seq[Ast]

Attributes

Inherited from:
AstForTypesCreator
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
protected def methodForClosureStyleFn(ctx: ParserRuleContext): NewMethod

Attributes

Inherited from:
AstForFunctionsCreator
protected def methodNode(node: ParserRuleContext, name: String, code: String, fullName: String, signature: Option[String], fileName: String, astParentType: Option[String], astParentFullName: Option[String]): NewMethod

Attributes

Inherited from:
AstNodeBuilder
def methodNode(node: ParserRuleContext, name: String, fullName: String, signature: String, fileName: String): NewMethod

Attributes

Inherited from:
AstNodeBuilder
protected def methodRefNode(node: ParserRuleContext, code: String, methodFullName: String, typeFullName: String): NewMethodRef

Attributes

Inherited from:
AstNodeBuilder
protected def methodReturnNode(node: ParserRuleContext, typeFullName: String): NewMethodReturn

Attributes

Inherited from:
AstNodeBuilder
def methodStubAst(method: NewMethod, parameters: Seq[Ast], 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
protected def methodsWithName(name: String): List[String]

Attributes

Inherited from:
AstCreatorHelper
protected def newFieldIdentifier(ctx: ParserRuleContext): NewFieldIdentifier

Attributes

Inherited from:
AstCreatorHelper
protected def newImportNode(code: String, importedEntity: String, importedAs: String, include: ParserRuleContext): NewImport

Attributes

Inherited from:
AstNodeBuilder
def nextClosureName(): String

Attributes

Returns

the next available name for a closure in this context

Inherited from:
AstCreatorBase
protected def offset(node: ParserRuleContext): Option[(Int, Int)]

Attributes

Inherited from:
AstNodeBuilder
protected def parameterInNode(node: ParserRuleContext, name: String, code: String, index: Int, isVariadic: Boolean, evaluationStrategy: String, typeFullName: Option[String]): NewMethodParameterIn

Attributes

Inherited from:
AstNodeBuilder
protected def parameterInNode(node: ParserRuleContext, name: String, code: String, index: Int, isVariadic: Boolean, evaluationStrategy: String, typeFullName: String): NewMethodParameterIn

Attributes

Inherited from:
AstNodeBuilder
protected def prefixAsBuiltin(x: String): String

Attributes

Inherited from:
AstCreatorHelper
protected def resolveAlias(name: String): String

Attributes

Returns

the method name if found as an alias, or the given name if not found.

Inherited from:
AstForFunctionsCreator
protected def resolveRelativePath(currentFile: String, argsAst: Seq[Ast], callNode: NewCall): Seq[Ast]

Attributes

Inherited from:
AstForStatementsCreator
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
protected def returnNode(node: TerminalNode, code: String): NewReturn

Attributes

Inherited from:
AstCreatorHelper
protected def returnNode(node: ParserRuleContext, code: String): NewReturn

Attributes

Inherited from:
AstNodeBuilder
protected def scanStmtForHereDoc(stmt: Seq[Ast]): Seq[Ast]

Will determine, if we have recently met a here doc initializer, if this statement should be converted to a here doc literal or returned as-is.

Will determine, if we have recently met a here doc initializer, if this statement should be converted to a here doc literal or returned as-is.

Value parameters

stmt

the statement AST.

Attributes

Returns

the statement AST or nothing if this is determined to be a here doc body.

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

Attributes

Inherited from:
AstCreatorBase
protected def shortenCode(code: String): String

Attributes

Inherited from:
AstNodeBuilder
def staticInitMethodAst(initAsts: List[Ast], fullName: String, signature: Option[String], returnType: String, fileName: Option[String], lineNumber: Option[Integer], columnNumber: Option[Integer]): Ast

Attributes

Inherited from:
AstCreatorBase
protected def text(ctx: ParserRuleContext): String

Attributes

Inherited from:
AstCreatorHelper
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
protected def typeDeclNode(node: ParserRuleContext, name: String, fullName: String, filename: String, code: String, astParentType: String, astParentFullName: String, inherits: Seq[String], alias: Option[String]): NewTypeDecl

Attributes

Inherited from:
AstNodeBuilder
def typeDeclNode(node: ParserRuleContext, name: String, fullName: String, fileName: String, inheritsFrom: Seq[String], alias: Option[String]): NewTypeDecl

Attributes

Inherited from:
AstNodeBuilder
protected def typeRefNode(node: ParserRuleContext, code: String, typeFullName: String): NewTypeRef

Attributes

Inherited from:
AstNodeBuilder
protected def unknownNode(node: ParserRuleContext, code: String): NewUnknown

Attributes

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

protected val UNRESOLVED_YIELD: String

Attributes

Inherited from:
AstForFunctionsCreator
protected val YIELD_SUFFIX: String

Attributes

Inherited from:
AstForFunctionsCreator
protected val blockMethods: ListBuffer[Ast]

Attributes

Inherited from:
AstForFunctionsCreator
val diffGraph: DiffGraphBuilder

Attributes

Inherited from:
AstCreatorBase
protected val fieldReferences: HashMap[String, Set[ParserRuleContext]]

Attributes

Inherited from:
AstForTypesCreator
protected var lastModifier: Option[String]

Attributes

Inherited from:
AstForExpressionsCreator
protected val methodAliases: HashMap[String, String]

Attributes

Inherited from:
AstForFunctionsCreator
protected val methodDefInArgument: ListBuffer[Ast]

Attributes

Inherited from:
AstForFunctionsCreator
protected val methodNameAsIdentifierStack: Stack[Ast]

Attributes

Inherited from:
AstForFunctionsCreator
protected val methodNameToMethod: HashMap[String, NewMethod]

Attributes

Inherited from:
AstForFunctionsCreator
protected val methodNamesWithYield: HashSet[String]

Attributes

Inherited from:
AstForFunctionsCreator
protected val typeDeclNameToTypeDecl: HashMap[String, NewTypeDecl]

Attributes

Inherited from:
AstForTypesCreator

Implicits

Inherited implicits

final implicit protected def BlockContextExt(ctx: BlockContext): BlockContextExt

Attributes

Inherited from:
AstForStatementsCreator
final implicit def ClassDefinitionPrimaryContextExt(ctx: ClassDefinitionPrimaryContext): ClassDefinitionPrimaryContextExt

Attributes

Inherited from:
AstForTypesCreator
final implicit def ClassOrModuleReferenceContextExt(ctx: ClassOrModuleReferenceContext): ClassOrModuleReferenceContextExt

Attributes

Inherited from:
AstForTypesCreator
final implicit def TerminalNodeExt(n: TerminalNode): TerminalNodeExt

Attributes

Inherited from:
AstCreatorHelper