Commit 55e7e4e
authored
Support inheritance (#459)
### Changes
- Change naming scheme so the name `$heap` is always used as the heap to
read/assign to in the body. For read-only procedures, `$heap` is the
input parameter as well as the one to read. For read/write procedures,
`$heap` is the out parameter and `$heap_in` the input one.
- Add a `Map.const` function to the Core factory
- Add datatypes to Laurel, to support a more incremental translation to
Core
- During translation, introduce a `Field` datatype that has a
constructor for each user defined field.
- During translation, introduce a `UserType` datatype that has a
constructor for each user defined type.
- Support composites that have fields with the same name but different
types
- Move the handling of `new` from HeapParameterization to a new pass
`TypeHierarchy`, that also handles `<value> as <Type>` and `<value> is
<Type>`.
### Testing
- Add a test `sameFieldNameDifferentType` to the mutable fields test
file
- Added a test file related to inheritance1 parent 044a90b commit 55e7e4e
File tree
17 files changed
+911
-211
lines changed- StrataTest/Languages
- Core
- Laurel/Examples/Objects
- Python
- Strata/Languages
- Core
- Laurel
- Grammar
17 files changed
+911
-211
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
223 | 238 | | |
224 | 239 | | |
225 | 240 | | |
| |||
359 | 374 | | |
360 | 375 | | |
361 | 376 | | |
| 377 | + | |
362 | 378 | | |
363 | 379 | | |
364 | 380 | | |
| |||
464 | 480 | | |
465 | 481 | | |
466 | 482 | | |
| 483 | + | |
467 | 484 | | |
468 | 485 | | |
469 | 486 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
209 | 217 | | |
210 | 218 | | |
211 | 219 | | |
| |||
230 | 238 | | |
231 | 239 | | |
232 | 240 | | |
233 | | - | |
| 241 | + | |
| 242 | + | |
234 | 243 | | |
235 | 244 | | |
236 | 245 | | |
| |||
400 | 409 | | |
401 | 410 | | |
402 | 411 | | |
403 | | - | |
| 412 | + | |
404 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
405 | 423 | | |
406 | 424 | | |
407 | 425 | | |
408 | | - | |
| 426 | + | |
409 | 427 | | |
410 | 428 | | |
411 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
97 | 105 | | |
98 | | - | |
| 106 | + | |
99 | 107 | | |
100 | 108 | | |
101 | 109 | | |
| |||
0 commit comments