com.github.gchudnov.bscript.builder.state
Type members
Classlikes
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
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