diff options
| author | aarne <unknown> | 2004-01-29 12:57:32 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2004-01-29 12:57:32 +0000 |
| commit | d09777a9aaeb580d8e793ad5e572296eb4c351d9 (patch) | |
| tree | 8e6d54d1687bdc772cd67d91d643f246ce023776 /examples/numerals/numerals.Abs.gf | |
| parent | fdddeca0d08ba68b564b14359ef9b4a697cdb636 (diff) | |
New order among numerals.
Diffstat (limited to 'examples/numerals/numerals.Abs.gf')
| -rw-r--r-- | examples/numerals/numerals.Abs.gf | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/numerals/numerals.Abs.gf b/examples/numerals/numerals.Abs.gf new file mode 100644 index 000000000..90aae3cb7 --- /dev/null +++ b/examples/numerals/numerals.Abs.gf @@ -0,0 +1,32 @@ +-- numerals from 1 to 999999 in decimal notation + +flags startcat=Numeral ; + +cat + Numeral ; -- 0.. + Digit ; -- 2..9 + Sub10 ; -- 1..9 + Sub100 ; -- 1..99 + Sub1000 ; -- 1..999 + Sub1000000 ; -- 1..999999 + +fun + num : Sub1000000 -> Numeral ; + + n2, n3, n4, n5, n6, n7, n8, n9 : Digit ; + + pot01 : Sub10 ; -- 1 + pot0 : Digit -> Sub10 ; -- d * 1 + pot110 : Sub100 ; -- 10 + pot111 : Sub100 ; -- 11 + pot1to19 : Digit -> Sub100 ; -- 10 + d + pot0as1 : Sub10 -> Sub100 ; -- coercion of 1..9 + pot1 : Digit -> Sub100 ; -- d * 10 + pot1plus : Digit -> Sub10 -> Sub100 ; -- d * 10 + n + pot1as2 : Sub100 -> Sub1000 ; -- coercion of 1..99 + pot2 : Sub10 -> Sub1000 ; -- m * 100 + pot2plus : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n + pot2as3 : Sub1000 -> Sub1000000 ; -- coercion of 1..999 + pot3 : Sub1000 -> Sub1000000 ; -- m * 1000 + pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n + |
