Zitat von "Oliver Bandel" <oli...@first.in-berlin.de>:

Hello,

when reading papers or books on parsing
techniques, the parsing often is done in
different distinctive steps, where type checking
and semantic checks are done after the parse tree
is build up.

This may be the classical way, for example when doing it in C.

When using OCaml with it's strong type system,
IMHO the big advantage is, that the type system can be used to restrict the input data in a way that without additionally checks correct input is enforced, otherwise a parse error is detected.
[...]

Would something like a parse-error-token make sense, when
the typesystem and the ocamlyacc-grammar forbidds parsing
wrong sequences?

Maybe something like (simple example):

type token_t =
    Add
  | Sub
  | Int of int
  | String of string
  | ParseError of string

??


Ciao,
   Oliver

_______________________________________________
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

Reply via email to