Maps a boxed expression to a syntax tree of FEEL (DMN 1.6, 10.2.2: boxed expressions "can be mapped to FEEL text").
| Boxed expression | Tree |
|---|---|
| literal expression | the parse of its text |
| context | a context; the entry with no variable is the result, selected from the context under a key that no text can write |
| function definition | function(parameters) body, the parameters typed by their typeRef |
| invocation | a call of the function by the names of its parameters |
| relation | a list of contexts, one for each row |
| list, conditional, filter | […], if … then … else …, source[match] |
| for, some, every | for v in source return body, some v in source satisfies test, every … |
| decision table | Dmn.Compiler.Table |
Each fragment of text is parsed where it stands, with the names in scope there: the names of the unit, and those that the
boxed expressions around it bind. A part that is missing (an else that is not there, a binding with no formula) is null.
The tree is built as the analyzer wants it, and not as text would be written: a name is its tokens, a key is a string, and
the glue has the zero-width span of its part of the model (Dmn.Compiler.Source).
Summary
Functions
The tree of an expression, with the state, at path in the element of the environment. nil is null.
The tree of a value that the model declares a type for (Feel.AST, "Declared values"): converted to the type and verified
against its allowed values. Unchanged for no type; a type that FEEL cannot read is a diagnostic, and the value is not converted.
The type expression of a typeRef, or nil for no type. A typeRef is read as a type expression (number!,
list<Employee>) with the item definitions as the names that exist; every node of it has the span of the element. A text
that is not one stays a type name, which FEEL then says is unknown.
Functions
@spec compile( Dmn.Model.Expressions.t() | nil, Dmn.Compiler.Env.t(), Dmn.Compiler.Fragment.state(), Dmn.Compiler.Fragment.origin_path() ) :: {Feel.AST.expression(), Dmn.Compiler.Fragment.state()}
The tree of an expression, with the state, at path in the element of the environment. nil is null.
@spec declared( Feel.AST.expression(), String.t() | nil, Dmn.Compiler.Env.t(), Dmn.Compiler.Fragment.state(), Dmn.Compiler.Fragment.origin_path() ) :: {Feel.AST.expression(), Dmn.Compiler.Fragment.state()}
The tree of a value that the model declares a type for (Feel.AST, "Declared values"): converted to the type and verified
against its allowed values. Unchanged for no type; a type that FEEL cannot read is a diagnostic, and the value is not converted.
@spec type_expression( Feel.Diagnostic.span(), String.t() | nil, Feel.ItemDefinitions.t() ) :: Feel.AST.type_expression() | nil
The type expression of a typeRef, or nil for no type. A typeRef is read as a type expression (number!,
list<Employee>) with the item definitions as the names that exist; every node of it has the span of the element. A text
that is not one stays a type name, which FEEL then says is unknown.