Added binary numeral grammars.
This commit is contained in:
1 parent
bb82938d72
commit
30bb51372f
2 files changed
+21
No files matched your search
@@ -0,0 +1,10 @@
|
||||
abstract Binary = {
|
||||
|
||||
cat Bin;
|
||||
|
||||
fun End : Bin ;
|
||||
fun Zero : Bin -> Bin ;
|
||||
fun One : Bin -> Bin ;
|
||||
|
||||
|
||||
}
|
||||
@@ -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 } ;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user