Is there a way in ocamllex to put back certain characters
in the buffer. In flex you can do that
<LOOKING_FOR_XXX>[a-z]+ {
yy_pop_state();
yy_push_state(ST_TOP);
return T_STRING_VARNAME;
}
<LOOKING_FOR_XXX>{ANY_CHAR} {
yyless(0);
yy_pop_state();
yy_push_state(ST_TOP);
}
Should I play with fields like lexbuf_lex_curr_pos ?
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
> Is there a way in ocamllex to put back certain characters
> in the buffer. In flex you can do that
It is also possible with Ulex, using Ulexing.rollback.
Even if you don't need the UTF8 features, I suggest you take a
look at Ulex anyway; the approach used (it's a syntax extension)
provides greater flexibility. Moreover, it also handles latin1
streams fine.
Cheers,
Dario Teixeira