Revamped error handling: keep going beyond some errors to accumulate a list of build errors, like most conventional compilers.

This commit is contained in:
Chris Fallin
2021-09-09 23:27:25 -07:00
parent b46fa6acb0
commit 7d38b3b6d8
8 changed files with 359 additions and 308 deletions

View File

@@ -0,0 +1,36 @@
(type u32 (primitive u32))
(type bool (primitive bool))
(type A (enum (A1 (x u32))))
(decl Ext1 (u32) A)
(decl Ext2 (u32) A)
(extern extractor Ext1 ext1)
(extern extractor Ext2 ext2)
(decl C (bool) A)
(extern constructor C c)
(decl Lower (A) A)
(rule
(Lower
(and
a
(Ext1 x)
(Ext2 =q)))
(C y))
(type R (enum (A (x u32))))
(type Opcode (enum A B C))
(type MachInst (enum D E F))
(decl Lower2 (Opcode) MachInst)
(rule
(Lower2 (Opcode.A))
(R.A (Opcode.A)))
(rule
(Lower2 (Opcode.B))
(MachInst.E))
(rule
(Lower2 (Opcode.C))
(MachInst.F))