summaryrefslogtreecommitdiff
path: root/src/lib/parser.mly
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2021-09-05 19:41:40 +0200
committerSébastien Dailly <sebastien@chimrod.com>2021-09-05 19:41:40 +0200
commit6a34154b77ac80f89df816ba0062f382d915fb22 (patch)
tree5dab18f15fe8555d5369a9c492228f6aa4d23001 /src/lib/parser.mly
parent853e281a6719125866f8b948540944c571b091c6 (diff)
Updated tests
Diffstat (limited to 'src/lib/parser.mly')
-rw-r--r--src/lib/parser.mly35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/lib/parser.mly b/src/lib/parser.mly
index e5e6773..8fe4a55 100644
--- a/src/lib/parser.mly
+++ b/src/lib/parser.mly
@@ -11,7 +11,7 @@ See [1] for the theory behind the analysis
%{
-
+ open Modifiers.Sig
%}
%start<Sounds.t List.t> main
@@ -51,6 +51,7 @@ liquid:
nasal:
| N { Sounds.n }
| M { Sounds.m }
+ | G N { Sounds.gn }
consonant:
| occlusiv { $1 }
@@ -69,7 +70,8 @@ opening_consonant:
| liquid { $1, None }
| obstruent liquid { $1, Some $2 }
| occlusiv fricativ { $1, Some $2 }
- | consonant semi_voyel{ $1, Some $2 }
+
+semi:
| semi_voyel { $1, None }
@@ -87,6 +89,9 @@ voyels:
| O { Sounds.o }
| U { Sounds.voyel_y }
| OU { Sounds.voyel_u }
+
+voyels_semi:
+ | voyels { $1 }
| W A { Sounds.diphtongue Sounds.semi_voyel_w Sounds.a}
| W I { Sounds.diphtongue Sounds.semi_voyel_w Sounds.i}
| I E { Sounds.diphtongue Sounds.i (Sounds.e `Opened) }
@@ -96,18 +101,20 @@ ending_consonant:
| B { Some (Sounds.b ) }
| T { Some (Sounds.t )}
| K { Some (Sounds.k)}
+ | G { Some (Sounds.g)}
| liquid { Some $1 }
| nasal { Some $1 }
-consonant_group:
- | f = fricativ
- o = opening_consonant
+
+%inline consonant_group(opening)
+ : f = fricativ
+ o = opening
{
{ ending = None
; opening = f::(fst o)::[]
; following = snd o }
}
- | o = opening_consonant
+ | o = opening
{
{ ending = None
; opening = [ fst o ]
@@ -115,7 +122,7 @@ consonant_group:
}
| e = ending_consonant
Sep?
- o = opening_consonant
+ o = opening
{
{ ending = Some e
; opening = [ fst o ]
@@ -124,18 +131,24 @@ consonant_group:
| e = ending_consonant
Sep?
f = fricativ
- o = opening_consonant
+ o = opening
{
{ ending = Some e
; opening = f::[ fst o ]
; following = snd o }
}
+
+(** Exclude a semi voyel in both consonant and voyel position *)
syllable:
- | c = consonant_group?
- v = voyels
+ | c = consonant_group(opening_consonant)?
+ v = voyels_semi
Sep?
{ (v, c) }
+ | c = consonant_group(semi)
+ v = voyels
+ Sep?
+ { (v, Some c) }
syllables:
@@ -145,7 +158,7 @@ syllables:
word:
- | Sep? syllables consonant_group? EOL { Process.rebuild $3 $2 }
+ | Sep? syllables consonant_group(opening_consonant)? EOL { Process.rebuild $3 $2 }
main:
| word { $1 }