IdentifierContext

IdentifierContext

data class IdentifierContext

From the docs:

Where I is a IdentifierContext:


I  ::=   { types       (id?),
funcs       (id?),
tables      (id?),
mems        (id?),
globals     (id?),
locals      (id?),
labels      (id?),
typedefs    functype   }

Fields

Name Description
val types: MutableMap<Int?, Type>
val functions: MutableMap<Int?, Function>
val tables: MutableMap<Int?, Table>
val mems: MutableMap<Int?, Memory>
val globals: MutableMap<Int?, Global>
val locals: MutableMap<Int?, Local>
val labels: MutableMap<Int?, Local>
val typedefs: MutableMap<FunctionType, TypeDef>

Constructors

<init>

constructor(types: MutableMap<Int?, Type>, functions: MutableMap<Int?, Function>, tables: MutableMap<Int?, Table>, mems: MutableMap<Int?, Memory>, globals: MutableMap<Int?, Global>, locals: MutableMap<Int?, Local>, labels: MutableMap<Int?, Local>, typedefs: MutableMap<FunctionType, TypeDef>)

From the docs:

Where I is a IdentifierContext:


I  ::=   { types       (id?),
funcs       (id?),
tables      (id?),
mems        (id?),
globals     (id?),
locals      (id?),
labels      (id?),
typedefs    functype   }

Parameters

Name Description
types: MutableMap<Int?, Type>
functions: MutableMap<Int?, Function>
tables: MutableMap<Int?, Table>
mems: MutableMap<Int?, Memory>
globals: MutableMap<Int?, Global>
locals: MutableMap<Int?, Local>
labels: MutableMap<Int?, Local>
typedefs: MutableMap<FunctionType, TypeDef>

Methods

get

fun <T : Identifier> get(id: Int?): T?

Gets an Identifier by its registered id, or null if none is registered yet.

Parameters

Name Description
id: Int?

ReturnValue

Name Description
T?

get

fun get(funcType: FunctionType): TypeDef?

Gets an Identifier.TypeDef by its funcType, or null if none is registered yet.

Parameters

Name Description
funcType: FunctionType

ReturnValue

Name Description
TypeDef?

register

fun <T : Identifier> register(identifier: Identifier): T

Registers an Identifier with the IdentifierContext.

Parameters

Name Description
identifier: Identifier

ReturnValue

Name Description
T