Version française
Home     About     Download     Resources     Contact us    
Browse thread
ocamlyacc/ocamllex problems
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Laurent Reveillere <Laurent.Reveillere@l...>
Subject: ocamlyacc/ocamllex problems
I am writing a parser that uses Parsing.rhs_start and Parsing.rhs_end in
a rule.
The problem is the following,

1) If I use a simple rule in the lexer that matches a token all is fine.
ex:
    |   "'" ['0' '1' '*' '.']+ "'"  { ... }

2) If I use an automata in the lexer for matching the same token, the
results of Parsing.rhs_start and Parsing.rhs_end are wrong.
ex:	
    | "'"  { ... bits lexbuf ... }
and bits = parse
    | '\'' { ... }
    | ['0' '1' '.' '*' ] { ... }
    | eof  { ... }
    | _    { ... }

	
Here is the ouput of a debug printf for rhs_start and rhs_end values
case 1) Debug: pats='1..00000'       at (964,965)
case 2) Debug: pats='1..00000'       at (955,965)


I am not sure to undertand the reasons of my problem?


-- 
Laurent