mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-11 05:49:31 -06:00
more test/srg to examples/test/srg
This commit is contained in:
7
examples/test/srg/cyclic-direct/cyclic-direct.gf
Normal file
7
examples/test/srg/cyclic-direct/cyclic-direct.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
cat S;
|
||||
|
||||
fun f : S -> S ;
|
||||
fun g : S ;
|
||||
|
||||
lin f s = { s = s.s } ;
|
||||
lin g = { s = "g" } ;
|
||||
9
examples/test/srg/cyclic-empty-prod/cyclic-empty-prod.gf
Normal file
9
examples/test/srg/cyclic-empty-prod/cyclic-empty-prod.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
cat S; E;
|
||||
|
||||
fun s : S ;
|
||||
fun es : E -> S -> S ;
|
||||
fun e : E ;
|
||||
|
||||
lin s = { s = "s" } ;
|
||||
lin es e s = { s = e.s ++ s.s } ;
|
||||
lin e = { s = [] } ;
|
||||
11
examples/test/srg/cyclic-indirect/cyclic-indirect.gf
Normal file
11
examples/test/srg/cyclic-indirect/cyclic-indirect.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
-- a grammar with an indirect cycle
|
||||
|
||||
cat S; G;
|
||||
|
||||
fun f : S ;
|
||||
fun fg : G -> S ;
|
||||
fun gf : S -> G ;
|
||||
|
||||
lin f = { s = "f" } ;
|
||||
lin fg x = x;
|
||||
lin gf x = x;
|
||||
@@ -0,0 +1,9 @@
|
||||
cat S; E;
|
||||
|
||||
fun f : E -> S ;
|
||||
fun g : S -> S ;
|
||||
fun e : E ;
|
||||
|
||||
lin f e = { s = e.s } ;
|
||||
lin g s = { s = s.s ++ "x" } ;
|
||||
lin e = { s = "e" } ;
|
||||
7
examples/test/srg/left-recursive/left-recursive.gf
Normal file
7
examples/test/srg/left-recursive/left-recursive.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
cat S;
|
||||
|
||||
fun f : S -> S ;
|
||||
g : S ;
|
||||
|
||||
lin f x = { s = x.s ++ "f" } ;
|
||||
g = { s = "s" } ;
|
||||
4
examples/test/srg/variants-ebnf/variants-ebnf.gf
Normal file
4
examples/test/srg/variants-ebnf/variants-ebnf.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
cat S;
|
||||
fun f : S;
|
||||
|
||||
lin f = { s = variants {"a"; "b"} ++ variants {"c"; "d"} ++ variants {"e"; "f"} ++ variants { "g";"h";} } ;
|
||||
Reference in New Issue
Block a user