SelectElaborator
A compiler phase which translates Select
nodes to be directly
interpretable.
This phase,
-
types bindings according to the schema: i) untyped enums are validated and typed according to their declared type. ii) String and Int bindings are translated to ID bindings where appropriate. iii) default values are supplied for missing arguments. iv) arguments are permuted into the order declared in the schema.
-
eliminates Select arguments by delegating to a model-specific
PartialFunction
which is responsible for translatingSelect
nodes into a form which is directly interpretable, replacing them with aFilter
orUnique
node with aPredicate
which is parameterized by the arguments, eg.
Select("character", List(IDBinding("id", "1000")), child)
might be translated to,
Filter(FieldEquals("id", "1000"), child)
-
types narrowing coercions by resolving the target type against the schema.
-
verifies that leaves have an empty subselection set and that structured types have a non-empty subselection set.
-
eliminates Skipped nodes.
- Source:
- compiler.scala