Class Symbols
java.lang.Object
org.clafer.frontend.Symbols
The symbols of a model, the first pass after the parser: a symbol per
clafer, with its UID, its parent, its super clafer, the type of its
reference, its card and group card with the defaults applied, its temporal
modifiers and the clock of its initializer. An enumeration declares a
symbol for itself and one for each literal. The tree is not changed: the
symbols are found by their declarations.
The rules are those of the Clafer compiler, in the order it applies them:
the desugarer (Desugarer.hs: enumerations, clafer uses, a primitive
super, a reference to a constant), the UIDs (UIDs.hs), the supers
(ResolverInheritance.resolveNModule, with the relocation of a
top-level abstract clafer that extends a nested one, gsdlab/clafer#67),
the references (resolveOModule), and the defaults of the cards
(analyzeModule). A reference's target is resolved as the compiler
resolves it: by a name, a path of names, or a set expression whose type is
the primitive of its values or the nearest common super of its clafers.
The names inside constraints are the next pass.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA clafer, or an enumeration or one of its literals.static final recordA group card.static final recordAn interval of a card or a group card.static final recordThe reference of a clafer.static enumThe modifiers of a reference:finalref,finaltarget, andfinal, which is both.static final recordThe symbols of a model. -
Method Summary
Modifier and TypeMethodDescriptionstatic Symbols.Resultanalyze(Syntax.Model model) static Stringstatic Stringoutline(Symbols.Result symbols) The clafers as the explicit form declares them, without their constraints and the values of their initializers: one line per clafer,[abstract] [modifiers] gcard uid [: super] [-> type] card [init], its subclafers indented under it, and an enumeration asenum E = a | b.
-
Method Details
-
analyze
- Parameters:
model- a parsed model- Returns:
- its symbols
-
outline
The clafers as the explicit form declares them, without their constraints and the values of their initializers: one line per clafer,[abstract] [modifiers] gcard uid [: super] [-> type] card [init], its subclafers indented under it, and an enumeration asenum E = a | b. It is what the symbols say about a model, andoutline(Ir.Model)gives the same for an explicit model.- Parameters:
symbols- the symbols of a model- Returns:
- its outline
-
outline
- Parameters:
model- an explicit model- Returns:
- its outline, as
outline(Result)
-