X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fpxp%2Fpxp%2Ftools%2Fucs2_to_utf8%2Fparser.mly;fp=helm%2FDEVEL%2Fpxp%2Fpxp%2Ftools%2Fucs2_to_utf8%2Fparser.mly;h=2fba77593f2d7d0053d87d46ed466a72d9d4d707;hb=c03d2c1fdab8d228cb88aaba5ca0f556318bebc5;hp=0000000000000000000000000000000000000000;hpb=758057e85325f94cd88583feb1fdf6b038e35055;p=helm.git diff --git a/helm/DEVEL/pxp/pxp/tools/ucs2_to_utf8/parser.mly b/helm/DEVEL/pxp/pxp/tools/ucs2_to_utf8/parser.mly new file mode 100644 index 000000000..2fba77593 --- /dev/null +++ b/helm/DEVEL/pxp/pxp/tools/ucs2_to_utf8/parser.mly @@ -0,0 +1,40 @@ +/******************************************************/ +/* Claudio Sacerdoti Coen */ +/* 14/05/2000 */ +/******************************************************/ + +%token CHAR +%token IDENT +%token LET +%token EQ +%token END_OF_LET +%token RBRACKET +%token PIPE +%token LBRACKET +%token RANGE +%token EOF +%start main +%type main + +%% + +main: + EOF { [] } + | declaration main { $1::$2 } +; + +declaration: + LET IDENT EQ regexp END_OF_LET + { { Types.id = $2 ; Types.rel = $4 } } +; + +regexp: + regexptoken PIPE regexp { $1::$3 } + | regexptoken { [$1] } +; + +regexptoken: + CHAR { Types.Char $1 } + | LBRACKET CHAR RANGE CHAR RBRACKET { Types.Interval ($2,$4) } + | IDENT { Types.Identifier $1 } +;