caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Oliver Bandel" <oliver@first.in-berlin.de>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Typesystem and Parsers
Date: Fri, 22 Oct 2010 19:41:48 +0200	[thread overview]
Message-ID: <20101022194148.21032yqfgzi9y1gc@webmail.in-berlin.de> (raw)
In-Reply-To: <20101022165950.13786wcej1xp31eu@webmail.in-berlin.de>

Zitat von "Oliver Bandel" <oliver@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


  reply	other threads:[~2010-10-22 17:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22 14:59 Oliver Bandel
2010-10-22 17:41 ` Oliver Bandel [this message]
2010-10-22 23:43 ` [Caml-list] " Norman Hardy
2010-10-23  2:25   ` oliver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101022194148.21032yqfgzi9y1gc@webmail.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).