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 calcQualifier(typeString: List<String>, old: Type.Qualifier): Type.Qualifier
Infers corresponding qualifier information for the type depending on the keywords.
Link copied to clipboard
open fun calcStorage(typeString: List<String>): Type.Storage
Infers the corresponding storage type depending on the present storage keyword.
Link copied to clipboard
@NotNull
open fun createFrom(@NotNull name: @NotNull CharSequence, language: Language<out LanguageFrontend>): @NotNull Type
@NotNull
open fun createFrom(@NotNull name: @NotNull CharSequence, resolveAlias: Boolean, language: Language<out LanguageFrontend>): @NotNull Type
Parses the type from a char sequence and the supplied language.
open fun createFrom(@NotNull type: @NotNull String, resolveAlias: Boolean, lang: 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, scopeManager: ScopeManager): @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>): @NotNull Type
Does the same as createIgnoringAlias 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
open fun isKnownSpecifier(specifier: String, language: Language<out LanguageFrontend>): Boolean
Link copied to clipboard
open fun isStorageSpecifier(specifier: String, language: Language<out LanguageFrontend>): Boolean
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): @NotNull List<String>
Separates typeString into the different Parts that make up the type information

Properties

Link copied to clipboard
val UNKNOWN_TYPE_STRING: String = "UNKNOWN"