From 30bb51372fa8fdb6d68d1fd1b15793940c8d4e3b Mon Sep 17 00:00:00 2001 From: bringert Date: Thu, 1 Dec 2005 13:11:01 +0000 Subject: [PATCH] Added binary numeral grammars. --- examples/numerals/Binary.gf | 10 ++++++++++ examples/numerals/BinaryDigits.gf | 11 +++++++++++ 2 files changed, 21 insertions(+) create mode 100644 examples/numerals/Binary.gf create mode 100644 examples/numerals/BinaryDigits.gf diff --git a/examples/numerals/Binary.gf b/examples/numerals/Binary.gf new file mode 100644 index 000000000..f053b64ba --- /dev/null +++ b/examples/numerals/Binary.gf @@ -0,0 +1,10 @@ +abstract Binary = { + +cat Bin; + +fun End : Bin ; +fun Zero : Bin -> Bin ; +fun One : Bin -> Bin ; + + +} \ No newline at end of file diff --git a/examples/numerals/BinaryDigits.gf b/examples/numerals/BinaryDigits.gf new file mode 100644 index 000000000..3a30a993c --- /dev/null +++ b/examples/numerals/BinaryDigits.gf @@ -0,0 +1,11 @@ +concrete BinaryDigits of Binary = { + +flags startcat=Bin ; + +lincat Bin = { s : Str } ; + +lin End = { s = "" } ; +lin Zero b = { s = "0" ++ b.s } ; +lin One b = { s = "1" ++ b.s } ; + +} \ No newline at end of file