%{ (** This module transform the words into a semi-prononciation elements. The letters should be quite close with the associate phonem, but some modification can occur. *) open Tokens %} %token AUX_ %token ENT_ %token IENT_ %token Sep %token A %token B %token C %token D %token E %token E_ACUTE %token E_AGRAVE %token F %token G %token H %token I %token J %token K %token L %token M %token N %token O %token OU %token Q %token P %token R %token S %token SZ %token T %token U %token V %token W (* semi voyel w *) %token X %token Y (* semi voyel j *) %token Z %token Space %token EOL %nonassoc Low %left R %right High %start main %% voyel: | A { A } | E { E } | I { I } | O { O } | A U { O } | E A U { O } | O U { OU } | U { U } | E_ACUTE { E_ACUTE } | E_AGRAVE { E_AGRAVE } letters: | voyel { $1 :: [] } | Space { Space :: [] } | Sep { Sep :: [] } | B { B :: [] } | C { K :: [] } | C H { X :: [] } | C I { S :: I :: [] } | C E { S :: E :: [] } | C U { K :: U :: [] } | C U I { K :: I :: [] } | C U E { K :: E :: [] } | D { D :: [] } | D D { D :: [] } | F { F :: [] } | G { G :: [] } | G I { J :: I :: [] } | G E { J :: E :: [] } | G U { G :: U :: [] } | G U I { G :: I :: [] } | G U E { G :: E :: [] } | H { Sep :: [] } | J { J :: [] } | K { K :: [] } | E L { E :: L :: [] } | E L L { E_AGRAVE :: L :: [] } | I L { I :: L :: [] } | I L L { I :: Y :: [] } | L { L :: [] } | M { M :: [] } | M M { M :: [] } | N { N :: [] } | N N { N :: [] } | O I { W :: A :: [] } | O I N { W :: I :: N :: [] } | P { P :: [] } | P H { F :: [] } | Q { K :: [] } | Q U { K :: [] } | R { R :: [] } | S { SZ :: [] } | S S { S :: [] } | S H { X :: [] } | T { T :: [] } | V { V :: [] } | W { W :: [] } | X { K :: S :: [] } | Y { Y :: [] } | Z { Z :: [] } ending: | AUX_ { O::S::EOL::[]} | IENT_ { I::T::EOL::[]} | ENT_ { E::T::EOL::[]} | EOL { EOL::[] } main: | append(flatten(letters*), ending) { $1 }