Constructors

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

Properties

Link copied to clipboard
Link copied to clipboard
override var ctx: TranslationContext
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val namespace: Name?
Link copied to clipboard
open override val scope: Scope?
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
open fun cleanup()
Link copied to clipboard
Link copied to clipboard
open override fun codeOf(astNode: Python.AST.AST): String?

This functions extracts the source code from the input file given a location. This is a bit tricky in Python, as indents are part of the syntax. We also don't want to include leading whitespaces/tabs in case of extracting a nested code fragment. Thus, we use the following approximation to retrieve the fragment's source code:

Link copied to clipboard
open override fun locationOf(astNode: Python.AST.AST): PhysicalLocation?
Link copied to clipboard
open override fun parse(file: File): TranslationUnitDeclaration
Link copied to clipboard
Link copied to clipboard
open fun process(from: Any, to: Node)
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 setComment(node: Node, astNode: Python.AST.AST)
Link copied to clipboard
open override fun typeOf(type: Python.AST.AST?): Type

Type information is optional in python in form of annotations. So if a type annotation is present, we parse it, otherwise we assume that it is dynamically typed and thus return an AutoType.

fun typeOf(typeId: String): Type

Resolves a Type based on its string identifier.