IniFileFrontend

The INI file frontend. This frontend utilizes the ini4j library to parse the config file. The result consists of

Note:

  • the "ini4j" library does not provide any super type for all nodes. Thus, the frontend accepts Any

  • typeOf has to be implemented, but as there are no types always returns the builtin string type

  • codeOf has to accept Any (because of the limitations stated above) and simply returns .toString()

  • locationOf always returns null as the "ini4j" library does not provide any means of getting a location given a node

  • setComment not implemented as this is not used (no Handler pattern implemented)

  • Comments in general are not supported.

Constructors

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

Properties

Link copied to clipboard
Link copied to clipboard
override var ctx: TranslationContext
Link copied to clipboard
Link copied to clipboard
open override val language: Language<out LanguageFrontend<Any, Any?>>
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: Any): String?

Returns an approximation of the original code by re-creating (parts of) the INI file given the parsed results provided by ini4j. This is not a perfect representation of the original code (comments, order, ...), however re-parsing it should result in the same CPG-representation.

Link copied to clipboard
open override fun locationOf(astNode: Any): PhysicalLocation?

Return the entire file as the location of any node. The parsing library in use does not provide more fine granular access to a node's location.

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: Any)
Link copied to clipboard
open override fun typeOf(type: Any?): Type