summaryrefslogtreecommitdiff
path: root/examples/tutorial/syntax/Grammar.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-10-22 15:56:11 +0000
committeraarne <aarne@cs.chalmers.se>2007-10-22 15:56:11 +0000
commita6f89fefef9ae755875c8b14c4b4c1513727cb16 (patch)
tree997fc1226ed0989724b62cfbaeebf6a4ed26d83a /examples/tutorial/syntax/Grammar.gf
parent3b878f85d85f1fa7f7ff724dfa161d7ac2b619b8 (diff)
polished the syntax grammar for the book
Diffstat (limited to 'examples/tutorial/syntax/Grammar.gf')
-rw-r--r--examples/tutorial/syntax/Grammar.gf28
1 files changed, 19 insertions, 9 deletions
diff --git a/examples/tutorial/syntax/Grammar.gf b/examples/tutorial/syntax/Grammar.gf
index 5484321ee..c48e89a21 100644
--- a/examples/tutorial/syntax/Grammar.gf
+++ b/examples/tutorial/syntax/Grammar.gf
@@ -6,12 +6,15 @@ abstract Grammar = {
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"
@@ -20,24 +23,31 @@ abstract Grammar = {
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 ;
- PredVP : Pol -> NP -> VP -> S ;
- QuestVP : Pol -> NP -> VP -> QS ;
+ UseCl : Pol -> Cl -> S ;
+ UseQCl : Pol -> QCl -> QS ;
- IPPredVP : Pol -> IP -> VP -> QS ;
- IPPredV2 : Pol -> IP -> NP -> V2 -> 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 ;
-
+ ModCN : AP -> CN -> CN ;
+ AdVP : Adv -> VP -> VP ;
AdAP : AdA -> AP -> AP ;
IDetCN : IDet -> CN -> IP ;
@@ -63,12 +73,12 @@ abstract Grammar = {
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 ;