Expression
Fixtype of Leo expressions.
This is a tagged union type, introduced by fty::deftagsum.
Member Tags → Types
- :literal → expression-literal
- :var/const → expression-var/const
- :assoc-const → expression-assoc-const
- :unary → expression-unary
- :binary → expression-binary
- :cond → expression-cond
- :unit → expression-unit
- :tuple → expression-tuple
- :tuple-component → expression-tuple-component
- :struct → expression-struct
- :struct-component → expression-struct-component
- :internal-call → expression-internal-call
- :external-call → expression-external-call
- :static-call → expression-static-call
There are
literals,
identifiers (i.e. variables and free constants),
associated constants,
unary expressions,
binary expressions,
conditional (ternary) expressions,
unit expressions,
tuple expressions,
tuple component expressions,
struct expressions,
struct component expressions,
and free function calls.
At the level of abstract syntax,
there is no need to represent paranthesized expressions.
The tree structure of the abstract syntax provides the grouping.
A unit expression is used instead of a tuple expression of zero components.
Even though tuple expressions
are required to have two or more components in the grammar,
we do not have this restriction at the level of abstract syntax.
Even though struct expressions
are prohibited from having no components in the grammar,
we do not have this restriction at the level of abstract syntax.
Subtopics
- Expressionp
- Recognizer for expression structures.
- Expression-case
- Case macro for the different kinds of expression structures.
- Expression-equiv
- Basic equivalence relation for expression structures.
- Expression-static-call
- Expression-binary
- Expression-cond
- Expression-assoc-const
- Expression-struct-component
- Expression-struct
- Expression-kind
- Get the kind (tag) of a expression structure.
- Expression-unary
- Expression-tuple-component
- Expression-internal-call
- Expression-external-call
- Expression-var/const
- Expression-tuple
- Expression-literal
- Expression-unit
- Expression-fix
- Fixing function for expression structures.
- Expression-count
- Measure for recurring over expression structures.