expressir 2.4.35 → 2.4.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/conformance.yml +34 -0
- data/.gitignore +3 -0
- data/Gemfile +1 -1
- data/TODO.sota/00-overview.md +57 -0
- data/TODO.sota/01-type-checking.md +115 -0
- data/TODO.sota/02-evaluator.md +86 -0
- data/TODO.sota/03-conformance.md +53 -0
- data/TODO.sota/04-lsp.md +70 -0
- data/TODO.sota/05-interop.md +55 -0
- data/TODO.sota/06-dialects.md +57 -0
- data/TODO.sota/07-reference-artifacts.md +55 -0
- data/docs/_guides/interop/index.adoc +25 -0
- data/docs/_guides/interop/json-schema.adoc +88 -0
- data/docs/_guides/interop/owl-rdf.adoc +87 -0
- data/docs/_guides/reference/checker-notes.adoc +55 -0
- data/docs/_guides/reference/checker.adoc +36 -0
- data/docs/_guides/reference/evaluator.adoc +40 -0
- data/docs/_guides/reference/grammar-crosswalk.adoc +299 -0
- data/docs/_guides/reference/index.adoc +22 -0
- data/docs/_guides/reference/lsp.adoc +41 -0
- data/docs/_guides/reference/p21.adoc +30 -0
- data/docs/_guides/reference/shtolo.adoc +36 -0
- data/exe/expressir-lsp +6 -0
- data/expressir.gemspec +2 -2
- data/ext/expressir_core/Cargo.toml +1 -1
- data/lib/expressir/cli.rb +18 -0
- data/lib/expressir/commands/check.rb +3 -1
- data/lib/expressir/commands/export_json_schema.rb +29 -0
- data/lib/expressir/commands/export_owl.rb +26 -0
- data/lib/expressir/commands/validate.rb +3 -0
- data/lib/expressir/commands.rb +2 -0
- data/lib/expressir/conformance/trend.rb +100 -0
- data/lib/expressir/conformance.rb +8 -0
- data/lib/expressir/eval/environment.rb +83 -0
- data/lib/expressir/eval/expression.rb +610 -0
- data/lib/expressir/eval/interpreter.rb +316 -0
- data/lib/expressir/eval/rules.rb +88 -0
- data/lib/expressir/eval/values.rb +74 -0
- data/lib/expressir/eval.rb +17 -0
- data/lib/expressir/express/builders/expression_builder.rb +9 -1
- data/lib/expressir/express/checker.rb +779 -2
- data/lib/expressir/express/dialect.rb +44 -0
- data/lib/expressir/express/formatters/expressions_formatter.rb +4 -1
- data/lib/expressir/express/parser.rb +9 -4
- data/lib/expressir/express.rb +1 -0
- data/lib/expressir/interop/json_schema.rb +195 -0
- data/lib/expressir/interop/owl.rb +216 -0
- data/lib/expressir/interop.rb +13 -0
- data/lib/expressir/lsp/document.rb +226 -0
- data/lib/expressir/lsp/server.rb +184 -0
- data/lib/expressir/lsp/workspace.rb +402 -0
- data/lib/expressir/lsp.rb +11 -0
- data/lib/expressir/mapping/refpath.rb +65 -4
- data/lib/expressir/reference/grammar_crosswalk.rb +122 -0
- data/lib/expressir/reference/grammar_crosswalk.yml +800 -0
- data/lib/expressir/reference/note_catalog.rb +54 -0
- data/lib/expressir/reference.rb +10 -0
- data/lib/expressir/version.rb +1 -1
- data/lib/expressir.rb +4 -0
- data/lib/tasks/conformance.rake +27 -0
- data/lib/tasks/reference.rake +25 -0
- metadata +50 -4
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: JSON Schema Export
|
|
3
|
+
parent: Interop Exports
|
|
4
|
+
grand_parent: Guides
|
|
5
|
+
nav_order: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
= JSON Schema Export
|
|
9
|
+
|
|
10
|
+
== Purpose
|
|
11
|
+
|
|
12
|
+
`Expressir::Interop::JsonSchema` renders one EXPRESS schema as a JSON
|
|
13
|
+
Schema 2020-12 document. The mapping is a project contribution; this
|
|
14
|
+
guide records every decision so consumers can depend on it.
|
|
15
|
+
|
|
16
|
+
== Mapping decisions
|
|
17
|
+
|
|
18
|
+
Entities::
|
|
19
|
+
Each entity becomes a definition under `$defs`. An entity with
|
|
20
|
+
supertypes is an `allOf` of one `$ref` per `SUBTYPE OF` parent plus an
|
|
21
|
+
object schema holding its own explicit attributes. The subtype closure
|
|
22
|
+
is therefore expressed compositionally rather than duplicated.
|
|
23
|
+
Attributes appear in declaration order (inherited attributes come
|
|
24
|
+
through the parent branch of `allOf`). An entity without supertypes is
|
|
25
|
+
the object schema itself with a `title`.
|
|
26
|
+
|
|
27
|
+
Explicit attributes::
|
|
28
|
+
Only explicit attributes are exported. Derived and inverse attributes
|
|
29
|
+
are not part of the Part 21 exchange structure and are omitted.
|
|
30
|
+
|
|
31
|
+
OPTIONAL attributes::
|
|
32
|
+
An optional attribute is left out of `required` and its type becomes
|
|
33
|
+
`anyOf: [type, {type: null}]` — absent and explicit `$` both validate.
|
|
34
|
+
|
|
35
|
+
Types::
|
|
36
|
+
`INTEGER` → `integer`; `REAL`/`NUMBER` → `number`; `STRING` → `string`;
|
|
37
|
+
`BOOLEAN` → `boolean`; `LOGICAL` → `enum: [true, false, null]`
|
|
38
|
+
(`UNKNOWN` maps to null); `BINARY` → a string matching `[01]*`.
|
|
39
|
+
|
|
40
|
+
Enumerations::
|
|
41
|
+
An `ENUMERATION` becomes `{type: string, enum: [...]}`. `BASED_ON`
|
|
42
|
+
chains are folded into the full domain, matching Annex G semantics.
|
|
43
|
+
|
|
44
|
+
SELECT::
|
|
45
|
+
A named select becomes `{anyOf: [$ref, ...]}` over its items;
|
|
46
|
+
`BASED_ON` chains are folded into the full item list. Items referencing
|
|
47
|
+
declarations are `$ref`s.
|
|
48
|
+
|
|
49
|
+
Aggregates::
|
|
50
|
+
`LIST`, `ARRAY`, `SET` and `BAG` become JSON arrays. `minItems` and
|
|
51
|
+
`maxItems` come from the declared bounds (an unbounded upper bound is
|
|
52
|
+
omitted). `SET`, and `LIST ... OF UNIQUE`, set `uniqueItems: true`.
|
|
53
|
+
|
|
54
|
+
Names::
|
|
55
|
+
EXPRESS identifiers are used verbatim. EXPRESS is case-insensitive but
|
|
56
|
+
preserves case; JSON property names are case-sensitive, so consumers
|
|
57
|
+
must use the declared spelling.
|
|
58
|
+
|
|
59
|
+
Root document::
|
|
60
|
+
The root carries `$schema`, `$id`, `title`, every declaration in
|
|
61
|
+
`$defs`, and an `anyOf` over the entity definitions (one JSON document
|
|
62
|
+
describes one entity instance). A schema with no entities has no root
|
|
63
|
+
`anyOf`. Because an instance of a subtype also satisfies each ancestor
|
|
64
|
+
definition, a consumer that knows the EXPRESS entity of an instance
|
|
65
|
+
should validate against that entity's definition under `$defs` rather
|
|
66
|
+
than the root `anyOf`.
|
|
67
|
+
|
|
68
|
+
Not exported::
|
|
69
|
+
`WHERE` and `UNIQUE` rules, `GENERIC`/`GENERIC_ENTITY`, constants and
|
|
70
|
+
subtype constraint expressions. They have no direct JSON Schema
|
|
71
|
+
counterpart and are left to the consumer's semantic layer.
|
|
72
|
+
|
|
73
|
+
== Programmatic use
|
|
74
|
+
|
|
75
|
+
[source,ruby]
|
|
76
|
+
----
|
|
77
|
+
schema = Expressir::Express::Parser.from_file("example.exp").schemas.first
|
|
78
|
+
document = Expressir::Interop::JsonSchema.new(schema).to_json
|
|
79
|
+
File.write("example.schema.json", document)
|
|
80
|
+
----
|
|
81
|
+
|
|
82
|
+
== Part 21 population check
|
|
83
|
+
|
|
84
|
+
Part 21 instances serialize to JSON objects keyed by attribute name in
|
|
85
|
+
the Part 21 slot order (supertype attributes first), with `$` and `*`
|
|
86
|
+
omitted or null, enum values as strings, and references expanded
|
|
87
|
+
in-line (a cycle guard falls back to `{"$ref": "#id"}`). The acceptance
|
|
88
|
+
spec validates the Annex H population against the exported schema.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: OWL/RDF Export
|
|
3
|
+
parent: Interop Exports
|
|
4
|
+
grand_parent: Guides
|
|
5
|
+
nav_order: 2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
= OWL/RDF Export
|
|
9
|
+
|
|
10
|
+
== Purpose
|
|
11
|
+
|
|
12
|
+
`Expressir::Interop::Owl` renders one EXPRESS schema as OWL 2 in Turtle.
|
|
13
|
+
The approach generalizes the ifcOWL lineage from IFC to arbitrary
|
|
14
|
+
EXPRESS. This guide records the decisions and the literature the
|
|
15
|
+
approach follows.
|
|
16
|
+
|
|
17
|
+
== Lineage
|
|
18
|
+
|
|
19
|
+
The mapping follows the published EXPRESS-to-OWL work:
|
|
20
|
+
|
|
21
|
+
* J. Beetz, J. van Leeuwen, B. de Vries, "IfcOWL: A case of transforming
|
|
22
|
+
EXPRESS schemas into ontologies", _Artificial Intelligence for
|
|
23
|
+
Engineering Design, Analysis and Manufacturing_ 23(1), 2009, 89-101.
|
|
24
|
+
* P. Pauwels, W. Terkaj, "EXPRESS to OWL for construction industry:
|
|
25
|
+
Towards a recommendable and usable ifcOWL ontology", _Automation in
|
|
26
|
+
Construction_ 63, 2016, 100-133.
|
|
27
|
+
* W. Terkaj, A. Sojic, "Ontology-based representation of IFC EXPRESS
|
|
28
|
+
rules: An enhancement of the ifcOWL ontology", _Automation in
|
|
29
|
+
Construction_ 57, 2015, 188-201.
|
|
30
|
+
|
|
31
|
+
The last reference is the source of our scope decision on WHERE rules:
|
|
32
|
+
this exporter does not translate rule bodies (see below).
|
|
33
|
+
|
|
34
|
+
== Mapping decisions
|
|
35
|
+
|
|
36
|
+
Entities::
|
|
37
|
+
Each entity becomes an `owl:Class` with one `rdfs:subClassOf` per
|
|
38
|
+
`SUBTYPE OF` parent. Abstract entities carry an `rdfs:comment
|
|
39
|
+
"EXPRESS ABSTRACT SUPERTYPE"`; they are not made equivalent to their
|
|
40
|
+
subtype union.
|
|
41
|
+
|
|
42
|
+
Explicit attributes::
|
|
43
|
+
Each explicit attribute becomes a property with `rdfs:domain` on its
|
|
44
|
+
entity and `rdfs:range` from the attribute type. Entity, select and
|
|
45
|
+
enumeration ranges are object properties; primitive ranges are
|
|
46
|
+
datatype properties. `OPTIONAL` is recorded as an `rdfs:comment`
|
|
47
|
+
rather than an OWL cardinality restriction, because cardinalities
|
|
48
|
+
belong to the entity class and would multiply restrictions per
|
|
49
|
+
attribute.
|
|
50
|
+
|
|
51
|
+
Primitive types::
|
|
52
|
+
`INTEGER` → `xsd:integer`; `REAL`/`NUMBER` → `xsd:double`; `STRING` →
|
|
53
|
+
`xsd:string`; `BOOLEAN` → `xsd:boolean`; `BINARY` → `xsd:hexBinary`.
|
|
54
|
+
`LOGICAL` maps to `xsd:boolean`; EXPRESS `UNKNOWN` has no XSD
|
|
55
|
+
counterpart and is a documented loss. Defined types over primitives are
|
|
56
|
+
emitted as `rdfs:Datatype` with `owl:equivalentClass` to the XSD type.
|
|
57
|
+
|
|
58
|
+
Aggregates::
|
|
59
|
+
`LIST`, `ARRAY`, `SET` and `BAG` attributes are object properties with
|
|
60
|
+
range `rdf:List`; element type and ordering live in the RDF collection.
|
|
61
|
+
|
|
62
|
+
SELECT::
|
|
63
|
+
A named select becomes an `owl:Class` with an `owl:equivalentClass`
|
|
64
|
+
restriction whose `owl:unionOf` lists the item classes (union
|
|
65
|
+
semantics). `BASED_ON` chains are folded into the item list.
|
|
66
|
+
|
|
67
|
+
Enumerations::
|
|
68
|
+
An enumeration becomes an `owl:Class`; each item becomes an
|
|
69
|
+
`owl:NamedIndividual` of that class. `BASED_ON` chains are folded.
|
|
70
|
+
|
|
71
|
+
Not exported::
|
|
72
|
+
`WHERE` and `UNIQUE` rule bodies, subtype constraint expressions,
|
|
73
|
+
derived and inverse attributes, and aggregate bounds. Rule translation
|
|
74
|
+
is a research problem in its own right (see Terkaj & Sojic); consumers
|
|
75
|
+
that need rule semantics should consume the EXPRESS model directly.
|
|
76
|
+
|
|
77
|
+
== Programmatic use
|
|
78
|
+
|
|
79
|
+
[source,ruby]
|
|
80
|
+
----
|
|
81
|
+
schema = Expressir::Express::Parser.from_file("example.exp").schemas.first
|
|
82
|
+
turtle = Expressir::Interop::Owl.new(
|
|
83
|
+
schema,
|
|
84
|
+
base_iri: "https://example.org/my-schema#",
|
|
85
|
+
).export
|
|
86
|
+
File.write("example.ttl", turtle)
|
|
87
|
+
----
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
= Checker note-id catalog
|
|
2
|
+
|
|
3
|
+
// Generated from lib/expressir/express/checker.rb by
|
|
4
|
+
// `rake reference:notes`. Do not edit by hand; the reference
|
|
5
|
+
// spec fails when this file is stale.
|
|
6
|
+
|
|
7
|
+
== Purpose
|
|
8
|
+
|
|
9
|
+
Every note id the Checker can raise, with the number of call
|
|
10
|
+
sites in the implementation. New checks use `:check_*` ids;
|
|
11
|
+
the conformance-derived ids (`:check_expr_*`, `:check_dialect_*`)
|
|
12
|
+
cite their clause in the note message.
|
|
13
|
+
|
|
14
|
+
[cols="3,1", options="header"]
|
|
15
|
+
|===
|
|
16
|
+
| Note id | Call sites
|
|
17
|
+
|
|
18
|
+
| `check_agg_type` | 1
|
|
19
|
+
| `check_attrib_name_fun` | 1
|
|
20
|
+
| `check_attribute_redeclaration` | 3
|
|
21
|
+
| `check_dialect_2004_only` | 1
|
|
22
|
+
| `check_dialect_deprecated` | 1
|
|
23
|
+
| `check_dialect_mixed` | 1
|
|
24
|
+
| `check_duplicate_declaration` | 1
|
|
25
|
+
| `check_enumeration_extended_type` | 1
|
|
26
|
+
| `check_expr_assignment_type` | 1
|
|
27
|
+
| `check_expr_initializer_type` | 1
|
|
28
|
+
| `check_expr_operand_domain` | 7
|
|
29
|
+
| `check_expr_return` | 2
|
|
30
|
+
| `check_expr_unique_duplicate` | 1
|
|
31
|
+
| `check_expr_where_boolean` | 1
|
|
32
|
+
| `check_interface_kind_restriction` | 1
|
|
33
|
+
| `check_inverse_attrib_ref` | 2
|
|
34
|
+
| `check_inverse_derive` | 1
|
|
35
|
+
| `check_inverse_entity` | 1
|
|
36
|
+
| `check_inverse_inverse` | 1
|
|
37
|
+
| `check_schema_iface_resource_duplicate` | 1
|
|
38
|
+
| `check_schema_interface_redundant` | 1
|
|
39
|
+
| `check_select_extended_type` | 1
|
|
40
|
+
| `check_select_named_type` | 1
|
|
41
|
+
| `check_self_schema_reference` | 2
|
|
42
|
+
| `check_string_no_entity` | 1
|
|
43
|
+
| `check_subtype_cycle` | 1
|
|
44
|
+
| `check_subtype_ref` | 1
|
|
45
|
+
| `check_subtypeof_invalid` | 1
|
|
46
|
+
| `check_supertype_ref` | 2
|
|
47
|
+
| `check_unique_name_pattern` | 1
|
|
48
|
+
| `check_unresolved_ref` | 3
|
|
49
|
+
| `check_where_name_pattern` | 1
|
|
50
|
+
| `qualified_attrib_attr_not_found` | 1
|
|
51
|
+
| `qualified_attrib_group_not_ancestor` | 1
|
|
52
|
+
| `qualified_attrib_group_not_found` | 1
|
|
53
|
+
|===
|
|
54
|
+
|
|
55
|
+
The catalog covers 35 note ids.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Checker
|
|
3
|
+
parent: Reference
|
|
4
|
+
grand_parent: Guides
|
|
5
|
+
nav_order: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
= Checker
|
|
9
|
+
|
|
10
|
+
== Purpose
|
|
11
|
+
|
|
12
|
+
`Expressir::Express::Checker` performs static, edition-aware semantic
|
|
13
|
+
checks over a parsed repository. Notes carry a stable id, a severity,
|
|
14
|
+
the schema, a message citing the ISO 10303-11 clause where the check
|
|
15
|
+
comes from, and the offending model node.
|
|
16
|
+
|
|
17
|
+
== Note ids
|
|
18
|
+
|
|
19
|
+
The catalog is generated from the checker source and published as the
|
|
20
|
+
"Checker note-id catalog" guide. New conformance-derived
|
|
21
|
+
checks use `:check_expr_*`, `:check_statement_*`, `:check_rule_*` and
|
|
22
|
+
`:check_dialect_*` ids; the message carries the clause.
|
|
23
|
+
|
|
24
|
+
== Dialects
|
|
25
|
+
|
|
26
|
+
`Checker.new(repository, dialect: :"10303-11:1994")` reports
|
|
27
|
+
2004-only constructs as errors when targeting the 1994 edition;
|
|
28
|
+
`dialect: :"10303-11:2004"` reports the Annex K deprecated inline
|
|
29
|
+
subtype-constraint syntax as warnings. Without a dialect the report is
|
|
30
|
+
unchanged. See the Dialect awareness task notes (TODO.sota/06).
|
|
31
|
+
|
|
32
|
+
== Severities and validity
|
|
33
|
+
|
|
34
|
+
`Checker#valid?` is true when no error-severity note was raised.
|
|
35
|
+
Indeterminate expression results are not violations; only a proven
|
|
36
|
+
false WHERE rule is.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Evaluator
|
|
3
|
+
parent: Reference
|
|
4
|
+
grand_parent: Guides
|
|
5
|
+
nav_order: 6
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
= Evaluator
|
|
9
|
+
|
|
10
|
+
== Purpose
|
|
11
|
+
|
|
12
|
+
`Expressir::Eval` executes EXPRESS: expressions over a value model,
|
|
13
|
+
functions (parameters, locals, control flow), and WHERE rules over a
|
|
14
|
+
Part 21 population.
|
|
15
|
+
|
|
16
|
+
== Expressions
|
|
17
|
+
|
|
18
|
+
`Expressir::Eval::Expression` implements ISO 10303-11 clause 12:
|
|
19
|
+
arithmetic with result typing, logical tables (12.4), relational
|
|
20
|
+
orderings (12.2.1), IN (12.2.3), LIKE patterns (12.2.5, table 11),
|
|
21
|
+
intervals, aggregate operations (tables 16-18 including element
|
|
22
|
+
singletons), QUERY, and indeterminate propagation. The value model
|
|
23
|
+
lives in `Values`: logical constants, enumeration and binary values,
|
|
24
|
+
aggregates and Part 21 instances.
|
|
25
|
+
|
|
26
|
+
== Execution
|
|
27
|
+
|
|
28
|
+
`Expressir::Eval::Interpreter` runs functions and procedures:
|
|
29
|
+
assignment (including indexed), IF/CASE, WHILE/UNTIL/increment REPEAT
|
|
30
|
+
with SKIP and ESCAPE, RETURN (falling off the end is an error), and the
|
|
31
|
+
builtin set A (`ABS` … `VALUE`, `TYPEOF`, `USEDIN`). Populations are
|
|
32
|
+
read through `Expressir::Eval::Environment`, which maps Part 21 slots
|
|
33
|
+
in clause 12 order.
|
|
34
|
+
|
|
35
|
+
== Rules
|
|
36
|
+
|
|
37
|
+
`Expressir::Eval::Rules.check(population, schema)` evaluates each
|
|
38
|
+
instance's entity WHERE rules with `SELF` and both bare and
|
|
39
|
+
`SELF\attribute` bindings. A rule is violated only when it evaluates
|
|
40
|
+
to false; indeterminate is not a violation (clause 9.4).
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
= Grammar cross-walk
|
|
2
|
+
|
|
3
|
+
// Generated by `rake reference:crosswalk` from
|
|
4
|
+
// lib/expressir/express/grammar/parser.rb and the Annex A snapshot.
|
|
5
|
+
// Do not edit by hand; the reference spec fails when this file is stale.
|
|
6
|
+
|
|
7
|
+
== Purpose
|
|
8
|
+
|
|
9
|
+
Every parsanol grammar rule is mapped to the ISO 10303-11:2004
|
|
10
|
+
Annex A production it implements. Divergences from the standard
|
|
11
|
+
grammar are classified with one of these statuses:
|
|
12
|
+
|
|
13
|
+
* `aligned` — The grammar rule implements the same-named Annex production.
|
|
14
|
+
* `decomposed` — The grammar rule is one piece of an Annex production that the PEG splits.
|
|
15
|
+
* `token` — Literal operator/delimiter token; Annex A names keywords but not punctuation.
|
|
16
|
+
* `lexical` — Character-class or whitespace handling inlined in the PEG (clause 7).
|
|
17
|
+
* `internal` — PEG-internal rule with no Annex counterpart.
|
|
18
|
+
* `support-code` — Handled by supporting Ruby code rather than a grammar rule.
|
|
19
|
+
|
|
20
|
+
== Rules
|
|
21
|
+
|
|
22
|
+
[cols="2,3,1,4", options="header"]
|
|
23
|
+
|===
|
|
24
|
+
| Parsanol rule | Annex A production | Status | Note
|
|
25
|
+
|
|
26
|
+
| `abstractEntityDeclaration` | abstract_entity_declaration | aligned |
|
|
27
|
+
| `abstractSupertype` | abstract_supertype | aligned |
|
|
28
|
+
| `abstractSupertypeDeclaration` | abstract_supertype_declaration | aligned |
|
|
29
|
+
| `actualParameterList` | actual_parameter_list | aligned |
|
|
30
|
+
| `addLikeOp` | add_like_op | aligned |
|
|
31
|
+
| `aggregateInitializer` | aggregate_initializer | aligned |
|
|
32
|
+
| `aggregateSource` | aggregate_source | aligned |
|
|
33
|
+
| `aggregateType` | aggregate_type | aligned |
|
|
34
|
+
| `aggregationTypes` | aggregation_types | aligned |
|
|
35
|
+
| `algorithmHead` | algorithm_head | aligned |
|
|
36
|
+
| `aliasStmt` | alias_stmt | aligned |
|
|
37
|
+
| `anyKeyword` | | internal | keyword guard that keeps identifiers from consuming reserved words
|
|
38
|
+
| `arrayType` | array_type | aligned |
|
|
39
|
+
| `assignmentStmt` | assignment_stmt | aligned |
|
|
40
|
+
| `attributeDecl` | attribute_decl | aligned |
|
|
41
|
+
| `attributeId` | attribute_id | aligned |
|
|
42
|
+
| `attributeQualifier` | attribute_qualifier | aligned |
|
|
43
|
+
| `attributeRef` | attribute_ref | aligned |
|
|
44
|
+
| `bagType` | bag_type | aligned |
|
|
45
|
+
| `binaryLiteral` | binary_literal | aligned |
|
|
46
|
+
| `binaryType` | binary_type | aligned |
|
|
47
|
+
| `bit` | bit | aligned |
|
|
48
|
+
| `booleanType` | boolean_type | aligned |
|
|
49
|
+
| `bound1` | bound_1 | aligned |
|
|
50
|
+
| `bound2` | bound_2 | aligned |
|
|
51
|
+
| `boundSpec` | bound_spec | aligned |
|
|
52
|
+
| `builtInConstant` | built_in_constant | aligned |
|
|
53
|
+
| `builtInFunction` | built_in_function | aligned |
|
|
54
|
+
| `builtInProcedure` | built_in_procedure | aligned |
|
|
55
|
+
| `caseAction` | case_action | aligned |
|
|
56
|
+
| `caseLabel` | case_label | aligned |
|
|
57
|
+
| `caseStmt` | case_stmt | aligned |
|
|
58
|
+
| `compoundStmt` | compound_stmt | aligned |
|
|
59
|
+
| `concreteTypes` | concrete_types | aligned |
|
|
60
|
+
| `constantBody` | constant_body | aligned |
|
|
61
|
+
| `constantDecl` | constant_decl | aligned |
|
|
62
|
+
| `constantFactor` | constant_factor | aligned |
|
|
63
|
+
| `constantId` | constant_id | aligned |
|
|
64
|
+
| `constantRef` | constant_ref | aligned |
|
|
65
|
+
| `constructedTypes` | constructed_types | aligned |
|
|
66
|
+
| `declaration` | declaration | aligned |
|
|
67
|
+
| `delim` | | lexical | the delimiter semicolon (7.3)
|
|
68
|
+
| `deriveClause` | derive_clause | aligned |
|
|
69
|
+
| `derivedAttr` | derived_attr | aligned |
|
|
70
|
+
| `digit` | digit | aligned |
|
|
71
|
+
| `digits` | digits | aligned |
|
|
72
|
+
| `domainRule` | domain_rule | aligned |
|
|
73
|
+
| `element` | element | aligned |
|
|
74
|
+
| `embeddedRemark` | embedded_remark | aligned |
|
|
75
|
+
| `encodedCharacter` | encoded_character | aligned |
|
|
76
|
+
| `encodedStringLiteral` | encoded_string_literal | aligned |
|
|
77
|
+
| `entityBody` | entity_body | aligned |
|
|
78
|
+
| `entityConstructor` | entity_constructor | aligned |
|
|
79
|
+
| `entityDecl` | entity_decl | aligned |
|
|
80
|
+
| `entityHead` | entity_head | aligned |
|
|
81
|
+
| `entityId` | entity_id | aligned |
|
|
82
|
+
| `entityRef` | entity_ref | aligned |
|
|
83
|
+
| `enumerationExtension` | enumeration_extension | aligned |
|
|
84
|
+
| `enumerationId` | enumeration_id | aligned |
|
|
85
|
+
| `enumerationItem` | enumeration_items | decomposed |
|
|
86
|
+
| `enumerationItems` | enumeration_items | aligned |
|
|
87
|
+
| `enumerationRef` | enumeration_ref | aligned |
|
|
88
|
+
| `enumerationReference` | enumeration_reference | aligned |
|
|
89
|
+
| `enumerationType` | enumeration_type | aligned |
|
|
90
|
+
| `escapeStmt` | escape_stmt | aligned |
|
|
91
|
+
| `explicitAttr` | explicit_attr | aligned |
|
|
92
|
+
| `expression` | expression | aligned |
|
|
93
|
+
| `factor` | factor | aligned |
|
|
94
|
+
| `formalParameter` | formal_parameter | aligned |
|
|
95
|
+
| `functionCall` | function_call | aligned |
|
|
96
|
+
| `functionDecl` | function_decl | aligned |
|
|
97
|
+
| `functionHead` | function_head | aligned |
|
|
98
|
+
| `functionId` | function_id | aligned |
|
|
99
|
+
| `functionRef` | function_ref | aligned |
|
|
100
|
+
| `generalAggregationTypes` | general_aggregation_types | aligned |
|
|
101
|
+
| `generalArrayType` | general_array_type | aligned |
|
|
102
|
+
| `generalBagType` | general_bag_type | aligned |
|
|
103
|
+
| `generalListType` | general_list_type | aligned |
|
|
104
|
+
| `generalRef` | general_ref | aligned |
|
|
105
|
+
| `generalSetType` | general_set_type | aligned |
|
|
106
|
+
| `generalizedTypes` | generalized_types | aligned |
|
|
107
|
+
| `genericEntityType` | generic_entity_type | aligned |
|
|
108
|
+
| `genericType` | generic_type | aligned |
|
|
109
|
+
| `groupQualifier` | group_qualifier | aligned |
|
|
110
|
+
| `hexDigit` | hex_digit | aligned |
|
|
111
|
+
| `ifStmt` | if_stmt | aligned |
|
|
112
|
+
| `ifStmtElseStatements` | if_stmt | decomposed |
|
|
113
|
+
| `ifStmtStatements` | if_stmt | decomposed |
|
|
114
|
+
| `increment` | increment | aligned |
|
|
115
|
+
| `incrementControl` | increment_control | aligned |
|
|
116
|
+
| `index` | index | aligned |
|
|
117
|
+
| `index1` | index_1 | aligned |
|
|
118
|
+
| `index2` | index_2 | aligned |
|
|
119
|
+
| `indexQualifier` | index_qualifier | aligned |
|
|
120
|
+
| `instantiableType` | instantiable_type | aligned |
|
|
121
|
+
| `integerLiteral` | integer_literal | aligned |
|
|
122
|
+
| `integerType` | integer_type | aligned |
|
|
123
|
+
| `interfaceSpecification` | interface_specification | aligned |
|
|
124
|
+
| `interval` | interval | aligned |
|
|
125
|
+
| `intervalHigh` | interval_high | aligned |
|
|
126
|
+
| `intervalItem` | interval_item | aligned |
|
|
127
|
+
| `intervalLow` | interval_low | aligned |
|
|
128
|
+
| `intervalOp` | interval_op | aligned |
|
|
129
|
+
| `inverseAttr` | inverse_attr | aligned |
|
|
130
|
+
| `inverseAttrType` | inverse_attr | decomposed |
|
|
131
|
+
| `inverseClause` | inverse_clause | aligned |
|
|
132
|
+
| `letter` | letter | aligned |
|
|
133
|
+
| `listType` | list_type | aligned |
|
|
134
|
+
| `literal` | literal | aligned |
|
|
135
|
+
| `localDecl` | local_decl | aligned |
|
|
136
|
+
| `localVariable` | local_variable | aligned |
|
|
137
|
+
| `logicalExpression` | logical_expression | aligned |
|
|
138
|
+
| `logicalLiteral` | logical_literal | aligned |
|
|
139
|
+
| `logicalType` | logical_type | aligned |
|
|
140
|
+
| `multiplicationLikeOp` | multiplication_like_op | aligned |
|
|
141
|
+
| `namedTypeOrRename` | named_type_or_rename | aligned |
|
|
142
|
+
| `namedTypes` | named_types | aligned |
|
|
143
|
+
| `nullStmt` | null_stmt | aligned |
|
|
144
|
+
| `numberType` | number_type | aligned |
|
|
145
|
+
| `numericExpression` | numeric_expression | aligned |
|
|
146
|
+
| `octet` | octet | aligned |
|
|
147
|
+
| `oneOf` | one_of | aligned |
|
|
148
|
+
| `op_asterisk` | | token | literal `*`
|
|
149
|
+
| `op_colon` | | token | literal `:`
|
|
150
|
+
| `op_colon_equals_colon` | | token | literal `:=:`
|
|
151
|
+
| `op_colon_less_greater_colon` | | token | literal `:<>:`
|
|
152
|
+
| `op_comma` | | token | literal `,`
|
|
153
|
+
| `op_decl` | | token | literal `:=`
|
|
154
|
+
| `op_delim` | | token | literal `;`
|
|
155
|
+
| `op_double_asterisk` | | token | literal `**`
|
|
156
|
+
| `op_double_backslash` | | token | literal `\`
|
|
157
|
+
| `op_double_pipe` | | token | literal `\|\|`
|
|
158
|
+
| `op_equals` | | token | literal `=`
|
|
159
|
+
| `op_greater_equal` | | token | literal `>=`
|
|
160
|
+
| `op_greater_than` | | token | literal `>`
|
|
161
|
+
| `op_left_curly_brace` | | token | literal `{`
|
|
162
|
+
| `op_leftbracket` | | token | literal `[`
|
|
163
|
+
| `op_leftparen` | | token | literal `(`
|
|
164
|
+
| `op_less_equal` | | token | literal `<=`
|
|
165
|
+
| `op_less_greater` | | token | literal `<>`
|
|
166
|
+
| `op_less_than` | | token | literal `<`
|
|
167
|
+
| `op_minus` | | token | literal `-`
|
|
168
|
+
| `op_period` | | token | literal `.`
|
|
169
|
+
| `op_pipe` | | token | literal `\|`
|
|
170
|
+
| `op_plus` | | token | literal `+`
|
|
171
|
+
| `op_query_begin` | | token | literal `<*`
|
|
172
|
+
| `op_query_end` | | token | literal `*>`
|
|
173
|
+
| `op_question_mark` | | token | literal `?`
|
|
174
|
+
| `op_right_curly_brace` | | token | literal `}`
|
|
175
|
+
| `op_rightbracket` | | token | literal `]`
|
|
176
|
+
| `op_rightparen` | | token | literal `)`
|
|
177
|
+
| `op_slash` | | token | literal `/`
|
|
178
|
+
| `parameter` | parameter | aligned |
|
|
179
|
+
| `parameterId` | parameter_id | aligned |
|
|
180
|
+
| `parameterRef` | parameter_ref | aligned |
|
|
181
|
+
| `parameterType` | parameter_type | aligned |
|
|
182
|
+
| `population` | population | aligned |
|
|
183
|
+
| `precisionSpec` | precision_spec | aligned |
|
|
184
|
+
| `primary` | primary | aligned |
|
|
185
|
+
| `procedureCallStmt` | procedure_call_stmt | aligned |
|
|
186
|
+
| `procedureDecl` | procedure_decl | aligned |
|
|
187
|
+
| `procedureHead` | procedure_head | aligned |
|
|
188
|
+
| `procedureHeadParameter` | procedure_head | decomposed |
|
|
189
|
+
| `procedureId` | procedure_id | aligned |
|
|
190
|
+
| `procedureRef` | procedure_ref | aligned |
|
|
191
|
+
| `qualifiableFactor` | qualifiable_factor | aligned |
|
|
192
|
+
| `qualifiedAttribute` | qualified_attribute | aligned |
|
|
193
|
+
| `qualifier` | qualifier | aligned |
|
|
194
|
+
| `queryExpression` | query_expression | aligned |
|
|
195
|
+
| `realLiteral` | real_literal | aligned |
|
|
196
|
+
| `realType` | real_type | aligned |
|
|
197
|
+
| `redeclaredAttribute` | redeclared_attribute | aligned |
|
|
198
|
+
| `referenceClause` | reference_clause | aligned |
|
|
199
|
+
| `referencedAttribute` | referenced_attribute | aligned |
|
|
200
|
+
| `relOp` | rel_op | aligned |
|
|
201
|
+
| `relOpExtended` | rel_op_extended | aligned |
|
|
202
|
+
| `renameId` | rename_id | aligned |
|
|
203
|
+
| `repeatControl` | repeat_control | aligned |
|
|
204
|
+
| `repeatStmt` | repeat_stmt | aligned |
|
|
205
|
+
| `repetition` | repetition | aligned |
|
|
206
|
+
| `resourceOrRename` | resource_or_rename | aligned |
|
|
207
|
+
| `resourceRef` | resource_ref | aligned |
|
|
208
|
+
| `returnStmt` | return_stmt | aligned |
|
|
209
|
+
| `ruleDecl` | rule_decl | aligned |
|
|
210
|
+
| `ruleHead` | rule_head | aligned |
|
|
211
|
+
| `ruleId` | rule_id | aligned |
|
|
212
|
+
| `ruleLabelId` | rule_label_id | aligned |
|
|
213
|
+
| `ruleLabelRef` | rule_label_ref | aligned |
|
|
214
|
+
| `ruleRef` | rule_ref | aligned |
|
|
215
|
+
| `schemaBody` | schema_body | aligned |
|
|
216
|
+
| `schemaBodyDeclaration` | schema_body | decomposed |
|
|
217
|
+
| `schemaDecl` | schema_decl | aligned |
|
|
218
|
+
| `schemaId` | schema_id | aligned |
|
|
219
|
+
| `schemaRef` | schema_ref | aligned |
|
|
220
|
+
| `schemaVersionId` | schema_version_id | aligned |
|
|
221
|
+
| `selectExtension` | select_extension | aligned |
|
|
222
|
+
| `selectList` | select_list | aligned |
|
|
223
|
+
| `selectType` | select_type | aligned |
|
|
224
|
+
| `selector` | selector | aligned |
|
|
225
|
+
| `setType` | set_type | aligned |
|
|
226
|
+
| `sign` | sign | aligned |
|
|
227
|
+
| `simpleExpression` | simple_expression | aligned |
|
|
228
|
+
| `simpleFactor` | simple_factor | aligned |
|
|
229
|
+
| `simpleFactorExpression` | simple_factor | decomposed |
|
|
230
|
+
| `simpleFactorUnaryExpression` | simple_factor | decomposed |
|
|
231
|
+
| `simpleId` | simple_id | aligned |
|
|
232
|
+
| `simpleStringLiteral` | simple_string_literal | aligned |
|
|
233
|
+
| `simpleTypes` | simple_types | aligned |
|
|
234
|
+
| `skipStmt` | skip_stmt | aligned |
|
|
235
|
+
| `space` | | lexical | whitespace between tokens (7.1)
|
|
236
|
+
| `spaces` | | lexical | whitespace between tokens (7.1)
|
|
237
|
+
| `stmt` | stmt | aligned |
|
|
238
|
+
| `stringLiteral` | string_literal | aligned |
|
|
239
|
+
| `stringType` | string_type | aligned |
|
|
240
|
+
| `subsuper` | subsuper | aligned |
|
|
241
|
+
| `subtypeConstraint` | subtype_constraint | aligned |
|
|
242
|
+
| `subtypeConstraintBody` | subtype_constraint_body | aligned |
|
|
243
|
+
| `subtypeConstraintDecl` | subtype_constraint_decl | aligned |
|
|
244
|
+
| `subtypeConstraintHead` | subtype_constraint_head | aligned |
|
|
245
|
+
| `subtypeConstraintId` | subtype_constraint_id | aligned |
|
|
246
|
+
| `subtypeConstraintRef` | subtype_constraint_ref | aligned |
|
|
247
|
+
| `subtypeDeclaration` | subtype_declaration | aligned |
|
|
248
|
+
| `supertypeConstraint` | supertype_constraint | aligned |
|
|
249
|
+
| `supertypeExpression` | supertype_expression | aligned |
|
|
250
|
+
| `supertypeFactor` | supertype_factor | aligned |
|
|
251
|
+
| `supertypeRule` | supertype_rule | aligned |
|
|
252
|
+
| `supertypeTerm` | supertype_term | aligned |
|
|
253
|
+
| `syntax` | syntax | aligned |
|
|
254
|
+
| `tailRemark` | tail_remark | aligned |
|
|
255
|
+
| `term` | term | aligned |
|
|
256
|
+
| `totalOver` | total_over | aligned |
|
|
257
|
+
| `trivia` | | lexical | whitespace and embedded remarks (7.1)
|
|
258
|
+
| `typeDecl` | type_decl | aligned |
|
|
259
|
+
| `typeId` | type_id | aligned |
|
|
260
|
+
| `typeLabel` | type_label | aligned |
|
|
261
|
+
| `typeLabelId` | type_label_id | aligned |
|
|
262
|
+
| `typeLabelRef` | type_label_ref | aligned |
|
|
263
|
+
| `typeRef` | type_ref | aligned |
|
|
264
|
+
| `unaryOp` | unary_op | aligned |
|
|
265
|
+
| `underlyingType` | underlying_type | aligned |
|
|
266
|
+
| `uniqueClause` | unique_clause | aligned |
|
|
267
|
+
| `uniqueRule` | unique_rule | aligned |
|
|
268
|
+
| `untilControl` | until_control | aligned |
|
|
269
|
+
| `useClause` | use_clause | aligned |
|
|
270
|
+
| `variableId` | variable_id | aligned |
|
|
271
|
+
| `variableRef` | variable_ref | aligned |
|
|
272
|
+
| `whereClause` | where_clause | aligned |
|
|
273
|
+
| `whileControl` | while_control | aligned |
|
|
274
|
+
| `width` | width | aligned |
|
|
275
|
+
| `widthSpec` | width_spec | aligned |
|
|
276
|
+
|===
|
|
277
|
+
|
|
278
|
+
== Annex A productions without a dedicated rule
|
|
279
|
+
|
|
280
|
+
These productions are handled by supporting code rather than a
|
|
281
|
+
grammar rule:
|
|
282
|
+
|
|
283
|
+
[cols="3,1,5", options="header"]
|
|
284
|
+
|===
|
|
285
|
+
| Annex A production | Status | Handled by
|
|
286
|
+
|
|
287
|
+
| `lparen_then_not_lparen_star` | lexical | embedded-remark lookahead in the PEG
|
|
288
|
+
| `not_lparen_star` | lexical | embedded-remark lookahead in the PEG
|
|
289
|
+
| `not_paren_star` | lexical | embedded-remark lookahead in the PEG
|
|
290
|
+
| `not_paren_star_quote_special` | lexical | embedded-remark lookahead in the PEG
|
|
291
|
+
| `not_paren_star_special` | lexical | embedded-remark lookahead in the PEG
|
|
292
|
+
| `not_quote` | lexical | string-literal lookahead in the PEG
|
|
293
|
+
| `not_rparen_star` | lexical | embedded-remark lookahead in the PEG
|
|
294
|
+
| `not_rparen_star_then_rparen` | lexical | embedded-remark lookahead in the PEG
|
|
295
|
+
| `remark` | support-code | remark scanning is performed by RemarkScanner/RemarkAttacher
|
|
296
|
+
| `remark_ref` | support-code | remark scanning is performed by RemarkScanner/RemarkAttacher
|
|
297
|
+
| `remark_tag` | support-code | remark scanning is performed by RemarkScanner/RemarkAttacher
|
|
298
|
+
| `special` | lexical | character-class regex in the PEG (7.1)
|
|
299
|
+
|===
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Reference
|
|
3
|
+
nav_order: 13
|
|
4
|
+
has_children: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
= Reference
|
|
8
|
+
|
|
9
|
+
== Purpose
|
|
10
|
+
|
|
11
|
+
Citable, generated reference material. The grammar cross-walk and the
|
|
12
|
+
checker note-id catalog are generated from the implementation and kept
|
|
13
|
+
in sync by specs; the subsystem guides describe the architecture and
|
|
14
|
+
the standard clauses each subsystem enforces.
|
|
15
|
+
|
|
16
|
+
== Generating
|
|
17
|
+
|
|
18
|
+
[source,shell]
|
|
19
|
+
----
|
|
20
|
+
bundle exec rake reference:crosswalk
|
|
21
|
+
bundle exec rake reference:notes
|
|
22
|
+
----
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Language Server
|
|
3
|
+
parent: Reference
|
|
4
|
+
grand_parent: Guides
|
|
5
|
+
nav_order: 7
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
= Language Server
|
|
9
|
+
|
|
10
|
+
== Purpose
|
|
11
|
+
|
|
12
|
+
`expressir-lsp` is a stdio language server (JSON-RPC 2.0, LSP 3.17)
|
|
13
|
+
exposing the parser, checker and resolution machinery to editors.
|
|
14
|
+
|
|
15
|
+
== Launch
|
|
16
|
+
|
|
17
|
+
[source,shell]
|
|
18
|
+
----
|
|
19
|
+
bundle exec expressir-lsp
|
|
20
|
+
----
|
|
21
|
+
|
|
22
|
+
== Capabilities
|
|
23
|
+
|
|
24
|
+
* full-sync documents (`didOpen`, `didChange`, `didSave`, `didClose`);
|
|
25
|
+
* diagnostics from Checker notes, mapped through `NodePositionIndex`
|
|
26
|
+
and `LineMap` to UTF-16 ranges, plus parse-error diagnostics;
|
|
27
|
+
* document symbols for schemas, entities, types, functions, procedures,
|
|
28
|
+
rules and attributes;
|
|
29
|
+
* go-to-definition through the USE/REFERENCE ladder and its alias map;
|
|
30
|
+
* references across all open documents;
|
|
31
|
+
* hover with a PrettyFormatter excerpt;
|
|
32
|
+
* rename across schemas, with edits applied in memory, every affected
|
|
33
|
+
document reparsed, SchemaCompare rejecting unrelated removals, and
|
|
34
|
+
the renamed schema re-emitted through the Formatter.
|
|
35
|
+
|
|
36
|
+
== Incremental behaviour
|
|
37
|
+
|
|
38
|
+
Changes reparse the document through the native/core parser path;
|
|
39
|
+
identical text is a no-op and checker results are memoized per document
|
|
40
|
+
set. Content-incremental parsing awaits an incremental API in the
|
|
41
|
+
expressir-rs core.
|