com.github.gchudnov.bscript.builder.state

Type members

Classlikes

final case class Ctx(data: List[String])
Companion:
object
object Ctx

Context the symbol resides in

Context the symbol resides in

Companion:
class
final case class Meta(scopeTree: ScopeTree, scopeSymbols: Map[EqWrap[Scope], List[Symbol]], symbolScopes: Map[EqWrap[Symbol], Scope], methodArgs: Map[EqWrap[SMethod], List[SVar]], methodRetTypes: Map[EqWrap[SMethod], Type], methodAsts: Map[EqWrap[SMethod], AST], astScopes: Map[EqWrap[AST], Scope], varTypes: Map[EqWrap[SVar], Type])

Metadata - Scope & Symbol State

Metadata - Scope & Symbol State

NOTE: we're not storing symbols in Block, Method, Struct explicitly, since it is causing huge AST-rewrites on updates.

To avoid rewrites, it is possible to use mutable Block, Method, Struct, but we want to avoid it to enable better traceability of mutations.

Value parameters:
astScopes

Scope, AST refers to; { AST -> Scope } -- parent scope for AST

methodArgs

Arguments that belong to a method; { Method -> List[Var] } NOTE: We use List[Var] and NOT a Set to maintain the order Vars were added.

methodAsts

AST, a Symbol references; { Symbol -> AST }

methodRetTypes

Return Type, associated with a method; { Method -> Type }

scopeSymbols

All symbols that belong to a scope; { Scope -> List[Symbol] } NOTE: We use List[Symbol] and NOT a Set to maintain the order Symbols were added.

scopeTree

Scope tree where a child Scope points to a parent Scope (child -> parent)

symbolScopes

Scope a Symbol belongs to; { Symbol -> Scope }

varTypes

Type, assigned to a variable { Var -> Type }. A Type for the variable might be changed, e.g. auto -> long.

Companion:
object
object Meta
Companion:
class
final case class ScopeTree(vertices: Set[EqWrap[Scope]], edges: Map[EqWrap[Scope], Scope])

Scope Tree

Scope Tree

Value parameters:
edges

child -> parent links. Allows to traverse the tree from leaves up to the root.

vertices

all available Scopes

Companion:
object
object ScopeTree
Companion:
class