%{ (** 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 %} %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: | { [] } | letters voyel { $2 :: $1 } | letters Space { Space :: $1 } | letters Sep { Sep :: $1 } | letters B { B :: $1 } | letters C { K :: $1 } | letters C H { X :: $1 } | letters C I { I :: S :: $1 } | letters C E { E :: S :: $1 } | letters C U I { I :: K :: $1 } | letters C U E { E :: K :: $1 } | letters D { D :: $1 } | letters D D { D :: $1 } | letters F { F :: $1 } | letters G { G :: $1 } | letters G I { I :: J :: $1 } | letters G E { E :: J :: $1 } | letters G U I { I :: G :: $1 } | letters G U E { E :: G :: $1 } | letters H { Sep :: $1 } | letters J { J :: $1 } | letters K { K :: $1 } | letters E L L { L :: E_AGRAVE :: $1 } | letters E L { L :: E :: $1 } | letters I L L { Y :: I :: $1 } | letters I L { L :: I :: $1 } | letters L { L :: $1 } | letters M { M :: $1 } | letters M M { M :: $1 } | letters N { N :: $1 } | letters N N { N :: $1 } | letters O I N { N :: I :: W :: $1 } | letters O I { A :: W :: $1 } | letters P { P :: $1 } | letters P H { F :: $1 } | letters Q U { K :: $1 } | letters R { R :: $1 } | letters S S { S :: $1 } | letters S H { X :: $1 } | letters S { SZ :: $1 } | letters T { T :: $1 } | letters V { V :: $1 } | letters W { W :: $1 } | letters X { S :: K :: $1 } | letters Y { Y :: $1 } | letters Z { Z :: $1 } main: | letters EOL { EOL::$1 }