Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ generated in the following situations:

* [BAZEL] Update Bazel to 8.5.1

* [LRM] Refactor `Abstract_Type` requirement

### 2.0.3

* [API] Fix incorrect output of `Integer_Literal.dump()` method.
Expand Down
6 changes: 4 additions & 2 deletions documentation/LRM.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# TRLC LRM

* [Version 3.1](https://bmw-software-engineering.github.io/trlc/lrm.html) (Current Stable)
* [Version 3.0](https://bmw-software-engineering.github.io/trlc/lrm-3.0.html)
* [Version 3.3](https://bmw-software-engineering.github.io/trlc/lrm.html) (Development)
* [Version 3.2](https://bmw-software-engineering.github.io/trlc/lrm-3.2.html) (Current Stable)
* [Version 3.1](https://bmw-software-engineering.github.io/trlc/lrm-3.1.html)
* [Version 3.0](https://bmw-software-engineering.github.io/trlc/lrm-3.0.html)
* [Version 2.9](https://bmw-software-engineering.github.io/trlc/lrm-2.9.html)
* [Version 2.8](https://bmw-software-engineering.github.io/trlc/lrm-2.8.html)
* [Version 2.7](https://bmw-software-engineering.github.io/trlc/lrm-2.7.html)
Expand Down
10 changes: 8 additions & 2 deletions language-reference-manual/lrm.trlc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package LRM

Versioning Version {
major = 3
minor = 2
minor = 3
}

GFDL_License License {
Expand Down Expand Up @@ -656,9 +656,15 @@ section "Type declarations" {
text = "The root type for a record extension must be a valid record type."
}

Static_Semantics Abstract_Type_Declaration {
text = '''
A record may be marked `abstract`.
'''
}

Static_Semantics Abstract_Types {
text = '''
A record may be marked `abstract`, in which case no objects of this
If a record is marked `abstract`, then no objects of this
type may be declared. It must be extended *(even if that extension is
empty)* before instances of that type can be declared.
*(Note that it is possible to have components of an abstract type.)*
Expand Down
2 changes: 2 additions & 0 deletions trlc/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ def parse_record_declaration(self):
t_final = None
is_abstract = False
is_final = False
# lobster-trace: LRM.Abstract_Type_Declaration
if self.peek_kw("abstract"):
self.match_kw("abstract")
t_abstract = self.ct
Expand Down Expand Up @@ -1791,6 +1792,7 @@ def parse_record_object_declaration(self):
r_typ = self.parse_qualified_name(self.default_scope,
ast.Record_Type)
r_typ.set_ast_link(self.ct)
# lobster-trace: LRM.Abstract_Types
if r_typ.is_abstract:
self.mh.error(self.ct.location,
"cannot declare object of abstract record type %s" %
Expand Down
Loading