summaryrefslogtreecommitdiff
path: root/examples-3.0/tutorial/syntax/Grammar.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-17 13:16:15 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-17 13:16:15 +0000
commit23b8136af27b0baaa8fcb5272a613d5f2ee447fa (patch)
tree2e7cd2930b7e8b6b0d911c00ec2d279b882f4893 /examples-3.0/tutorial/syntax/Grammar.gf
parent7c097669d2c3934622c57f6e2f4ddee8826953d3 (diff)
started examples-3.0 with examples that are tested to work
Diffstat (limited to 'examples-3.0/tutorial/syntax/Grammar.gf')
-rw-r--r--examples-3.0/tutorial/syntax/Grammar.gf86
1 files changed, 86 insertions, 0 deletions
diff --git a/examples-3.0/tutorial/syntax/Grammar.gf b/examples-3.0/tutorial/syntax/Grammar.gf
new file mode 100644
index 000000000..c48e89a21
--- /dev/null
+++ b/examples-3.0/tutorial/syntax/Grammar.gf
@@ -0,0 +1,86 @@
+abstract Grammar = {
+
+ flags startcat=Phr ;
+
+ cat
+ Phr ; -- any complete sentence e.g. "Is this pizza good?"
+ S ; -- declarative sentence e.g. "this pizza is good"
+ QS ; -- question sentence e.g. "is this pizza good"
+ Cl ; -- declarative clause e.g. "this pizza is good"
+ QCl ; -- question clause e.g. "is this pizza good"
+ NP ; -- noun phrase e.g. "this pizza"
+ IP ; -- interrogative phrase e.g "which pizza"
+ CN ; -- common noun phrase e.g. "very good pizza"
+ Det ; -- determiner e.g. "this"
+ IDet ; -- interrog. determiner e.g. "which"
+ AP ; -- adjectival phrase e.g. "very good"
+ Adv ; -- adverb e.g. "today"
+ AdA ; -- adadjective e.g. "very"
+ VP ; -- verb phrase e.g. "is good"
+ N ; -- noun e.g. "pizza"
+ A ; -- adjective e.g. "good"
+ V ; -- intransitive verb e.g. "boil"
+ V2 ; -- two-place verb e.g. "eat"
+ Pol ; -- polarity (pos or neg)
+ Conj ; -- conjunction e.g. "and"
+ Subj ; -- conjunction e.g. "because"
+
+ fun
+ PhrS : S -> Phr ;
+ PhrQS : QS -> Phr ;
+
+ UseCl : Pol -> Cl -> S ;
+ UseQCl : Pol -> QCl -> QS ;
+
+ QuestCl : Cl -> QCl ;
+
+ SubjS : Subj -> S -> Adv ;
+
+ PredVP : NP -> VP -> Cl ;
+
+ QuestVP : IP -> VP -> QCl ;
+ QuestV2 : IP -> NP -> V2 -> QCl ;
+
+ ComplV2 : V2 -> NP -> VP ;
+ ComplAP : AP -> VP ;
+
+ DetCN : Det -> CN -> NP ;
+
+ ModCN : AP -> CN -> CN ;
+ AdVP : Adv -> VP -> VP ;
+ AdAP : AdA -> AP -> AP ;
+
+ IDetCN : IDet -> CN -> IP ;
+
+ ConjS : Conj -> S -> S -> S ;
+ ConjNP : Conj -> NP -> NP -> NP ;
+
+ -- lexical insertion
+
+ UseN : N -> CN ;
+ UseA : A -> AP ;
+ UseV : V -> VP ;
+
+ -- entries of the closed lexicon
+
+ this_Det : Det ;
+ that_Det : Det ;
+ these_Det : Det ;
+ those_Det : Det ;
+ every_Det : Det ;
+ theSg_Det : Det ;
+ thePl_Det : Det ;
+ indef_Det : Det ;
+ plur_Det : Det ;
+ two_Det : Det ;
+ which_IDet : IDet ;
+ today_Adv : Adv ;
+ very_AdA : AdA ;
+ and_Conj : Conj ;
+ because_Subj : Subj ;
+
+ -- polarities
+
+ PPos, PNeg : Pol ;
+
+}