An environment that maps a NameElement
to the scope in which it is bound.
A BoundElement
is bound in a certain scope scope
, which keeps track of the actual element that
el
stands for.
The base class for elements of the abstract syntax tree.
The base class for elements in the AST that represent names scala.util.parsing.ast.Binders.
Returns a given result, but executes the supplied closure before returning.
A Scope
keeps track of one or more syntactic elements that represent bound names.
A variable that escaped its scope (i.
Represents an element with variables that are bound in a certain scope.
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
If a list of UnderBinder
s all have the same scope, they can be turned in to an UnderBinder
containing a list of the elements in the original UnderBinder
.
If a list of UnderBinder
s all have the same scope, they can be turned in to an UnderBinder
containing a list of the elements in the original UnderBinder
.
The name sequence
comes from the fact that this method's type is equal to the type of monadic sequence.
!orig.isEmpty
implies orig.forall(ub => ub.scope eq orig(0).scope)
This component provides functionality for enforcing variable binding during parse-time.
When parsing simple languages, like Featherweight Scala, these parser combinators will fully enforce the binding discipline. When names are allowed to be left unqualified, these mechanisms would have to be complemented by an extra phase that resolves names that couldn't be resolved using the naive binding rules. (Maybe some machinery to model
implicit
binders (e.g.,this
and imported qualifiers) and selection on a binder will suffice?)