TypeParser

open class TypeParser

Class responsible for parsing the type definition and create the same Type as described by the type string, but complying to the CPG TypeSystem

Functions

Link copied to clipboard
open fun createFrom(@NotNull type: @NotNull String, resolveAlias: Boolean, frontend: LanguageFrontend): Type
A specialized version of the type parsing function that needs a language frontend and does magic with generics and typedefs.
@NotNull
open fun createFrom(@NotNull type: @NotNull String, language: Language<out LanguageFrontend>, resolveAlias: Boolean, ctx: TranslationContext): @NotNull Type
Use this function for parsing new types and obtaining a new Type the TypeParser creates from the typeString.
Link copied to clipboard
@NotNull
open fun createIgnoringAlias(@NotNull string: @NotNull String, @NotNull language: @NotNull Language<out LanguageFrontend>, ctx: TranslationContext): @NotNull Type
Does the same as createFrom but explicitly does not use type alias resolution.
Link copied to clipboard
open fun isElaboratedTypeSpecifier(specifier: String, language: Language<out LanguageFrontend>): Boolean
Returns whether the specifier is part of an elaborated type specifier.
Link copied to clipboard
@NotNull
open fun reWrapType(@NotNull oldChain: @NotNull Type, @NotNull newRoot: @NotNull Type): @NotNull Type
Reconstructs the type chain when the root node is modified e.g.
Link copied to clipboard
@NotNull
open fun separate(@NotNull type: @NotNull String, language: Language<out LanguageFrontend>): @NotNull List<String>
Separates typeString into the different Parts that make up the type information