summaryrefslogtreecommitdiff
path: root/next-lib/src/common/ParamX.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-09-22 11:49:15 +0000
committeraarne <aarne@cs.chalmers.se>2008-09-22 11:49:15 +0000
commit98665df78b8018af30051cb4a9a31f845e0ba19d (patch)
tree67ba30b09e2b9590a00a4b193bf7611caa935af8 /next-lib/src/common/ParamX.gf
parent4862018f140a1bdcc7961d445ed9aa92facd742f (diff)
moved lib/next-resource to next-lib/src, to enable linking with next-lib as value of GF_LIB_PATH
Diffstat (limited to 'next-lib/src/common/ParamX.gf')
-rw-r--r--next-lib/src/common/ParamX.gf65
1 files changed, 65 insertions, 0 deletions
diff --git a/next-lib/src/common/ParamX.gf b/next-lib/src/common/ParamX.gf
new file mode 100644
index 000000000..65901de66
--- /dev/null
+++ b/next-lib/src/common/ParamX.gf
@@ -0,0 +1,65 @@
+resource ParamX = open Prelude in {
+
+---- flags optimize=noexpand ;
+
+ param
+ Number = Sg | Pl ;
+ Person = P1 | P2 | P3 ;
+ Degree = Posit | Compar | Superl ;
+
+ Anteriority =
+ Simul
+ | Anter --# notpresent
+ ;
+ Tense =
+ Pres
+ | Past --# notpresent
+ | Fut --# notpresent
+ | Cond --# notpresent
+ ;
+
+ param
+
+ Polarity = Pos | Neg ;
+
+ QForm = QDir | QIndir ;
+
+-- Imperatives: True = polite, False = familiar.
+
+ ImpForm = ImpF Number Bool ;
+
+ oper
+ numImp : ImpForm -> Number = \i ->
+ case i of {
+ ImpF n _ => n
+ } ;
+
+ conjNumber : Number -> Number -> Number = \m,n ->
+ case m of {
+ Sg => n ;
+ _ => Pl
+ } ;
+
+-- For persons, we let the latter argument win ("either you or I am absent"
+-- but "either I or you are absent"). This is not quite clear.
+
+ conjPerson : Person -> Person -> Person = \_,p ->
+ p ;
+
+-- To construct a record with a polarity-dependent table.
+
+ polCases : SS -> SS -> {s : Polarity => Str} = \true,false -> {
+ s = table {
+ Pos => true.s ;
+ Neg => false.s
+ }
+ } ;
+
+-- To count the length of a tail in a sequence of digits, e.g. to put commas
+-- as in 1,000,000.
+
+ param
+ DTail = T1 | T2 | T3 ;
+
+
+}