On Fri, Sep 5, 2014 at 10:39 AM, Geoffrey Irving <[email protected]> wrote:

> > All of which is leading me to the following questions:
> >
> > Is the tokenizer/parser phase distinction actually useful in modern front
> > ends?
> > What value is it providing, and should it be preserved?
> > Why use two algorithms (regular expression engine, parse algorithm) when
> one
> > will suffice?
> >
> > The only place in BitC v0 where the phase distinction was important was
> the
> > layout engine, and that actually does seem difficult to express in a
> > conventional grammar. It can be expressed in a predicated grammar with
> > suitable predicates.
> >
> > Opinions?
>
> I'd guess that if there are any good reasons, they'll be all about
> error reporting.


Hmm. That's one that I hadn't considered. The two types of errors that I
have historically issued from the tokenizer are:

1. I can't find a token - but this can be done from the parser
2. I've gotten far enough to know what token this has to be, and now I'm
(a) looking at something that can't be here or (b) looking for something
missing that *must* be here. Both of these can be handled from the parser
as well.

Both of these errors occur conceptually at the parse level as well.

Interesting that you should bring up error reporting for a completely
different reason, and I'll get to that in a second (next note).


shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to