Class ToIr
java.lang.Object
org.clafer.frontend.ToIr
The explicit IR of a model in the full syntax, as the compiler gives it
(
clafer -m clafer), and its scopes. The clafers are the
Symbols: their UIDs, supers, references, cards, group cards,
modifiers and initializers, with the layout, the braces and the defaults
gone. The constraints, objectives, assertions, initial values and
transitions are resolved by the Resolver, and the scopes are the
compiler's (ScopeAnalysis). As in the compiler, the constraints of
a reference to a set expression come first in its clafer, a nested
assertion is quantified over the instances of its clafer
(all this_ : A.b |), and the objectives and assertions are
collected in pre-order.
Every rich explicit model is such a model, so it gives its own IR back.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ToIr.ResultReads a model and its imports, and builds its explicit IR.static ToIr.ResultParses a model in one file, without reading its imports, finds its symbols, and builds its explicit IR.static ToIr.ResulttoIr(ModelFiles files) Builds the explicit IR of the files of a model: their concatenation, with their options combined.static ToIr.ResulttoIr(Syntax.Model model, Symbols.Result symbols, Ir.Options options) static ToIr.ResulttoIr(Syntax.Model model, Symbols.Result symbols, Ir.Options options, Optional<Integer> decimalDigits)
-
Method Details
-
toIr
Parses a model in one file, without reading its imports, finds its symbols, and builds its explicit IR.- Parameters:
source- the text of a model- Returns:
- its IR and the errors
-
read
Reads a model and its imports, and builds its explicit IR.- Parameters:
path- the model's file
-
toIr
Builds the explicit IR of the files of a model: their concatenation, with their options combined. -
toIr
- Parameters:
model- a parsed model without errorssymbols- its symbols, without errorsoptions- the options of the explicit model- Returns:
- its IR and the errors of this pass
-
toIr
public static ToIr.Result toIr(Syntax.Model model, Symbols.Result symbols, Ir.Options options, Optional<Integer> decimalDigits) - Parameters:
decimalDigits- the decimal scale of--decimal-digits, if given
-