Initial public commit of ISLE prototype DSL compiler.
This commit is contained in:
12
cranelift/isle/examples/test.isle
Normal file
12
cranelift/isle/examples/test.isle
Normal file
@@ -0,0 +1,12 @@
|
||||
(type u32 (primitive u32))
|
||||
(type A (enum (A1 (x u32)) (A2 (x u32))))
|
||||
(type B (enum (B1 (x u32)) (B2 (x u32))))
|
||||
|
||||
(decl Input (A) u32)
|
||||
(extractor Input get_input) ;; fn get_input<C>(ctx: &mut C, ret: u32) -> Option<(A,)>
|
||||
|
||||
(decl Lower (A) B)
|
||||
|
||||
(rule
|
||||
(Lower (A.A1 sub @ (Input (A.A2 42))))
|
||||
(B.B2 sub))
|
||||
Reference in New Issue
Block a user