GoLanguageFrontend

A language frontend for the GoLanguage. It makes use the internal go/ast package of the Go runtime to parse the AST of a Go program. We make use of JNA to call a dynamic library which exports C function wrappers around the Go API. This is needed because we cannot directly export Go structs and pointers to C.

Constructors

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

Types

Link copied to clipboard
object Companion
Link copied to clipboard

This helper class contains values needed to properly decide in which state const declaration / specifications are in.

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

The current DeclarationContext. This is somewhat of a workaround since we cannot properly communicate state between different handlers. However, because within a LanguageFrontend, everything is parsed sequentially according to AST order, we can safely use this context here.

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
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: GoStandardLibrary.Ast.Node): String?
Link copied to clipboard
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: GoStandardLibrary.Ast.Node)
Link copied to clipboard
open override fun typeOf(type: GoStandardLibrary.Ast.Expr): Type