[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: precise input location
From: |
Han-Wen Nienhuys |
Subject: |
Re: precise input location |
Date: |
Sat, 8 Jan 2005 13:16:47 +0100 |
address@hidden writes:
> Han-Wen Nienhuys <address@hidden> writes:
> >
> > Right now, parser.yy sets the input location of music expressions
> > directly (using set_spot()). This method is flawed, since the parser
> > occasionally has to look ahead for parsing correctly, thus putting the
> > origin property in the wrong spot. If you want to attack this problem,
> > you would have to modify the lexer to store the exact input locations
> > of each token (including the end); there's no need to store the input
> > string itself, since that is defined by the begin and end pointer of
> > the token. (Locations are stored as pointers into a memory copy of the
> > input file.)
> >
> > Then it should not be hard to make the parser use the location of
> > every token. A music expression is located at the start/end of its
> > tokens.
>
> Would that mean to change the token types from
>
> In order to propagate origins to non-terminals, other (non-terminal)
> types should also have the origin and end fields.
>
> Am I missing something more straightforward?
I believe bison has builtin support for handling locations (check out
the bison manual under Locations). Maybe you could run some experiments
whether it's usable for us.
>
> nicolas
>
--
Han-Wen Nienhuys | address@hidden | http://www.xs4all.nl/~hanwen
- precise input location, Nicolas Sceaux, 2005/01/03
- precise input location, Han-Wen Nienhuys, 2005/01/03
- Re: precise input location, Nicolas Sceaux, 2005/01/08
- Re: precise input location,
Han-Wen Nienhuys <=
- Re: precise input location, Nicolas Sceaux, 2005/01/08
- Re: precise input location, Nicolas Sceaux, 2005/01/09
- Re: precise input location, Nicolas Sceaux, 2005/01/09
- Re: precise input location, Han-Wen Nienhuys, 2005/01/09
- Re: precise input location, Nicolas Sceaux, 2005/01/09
- Re: precise input location, Han-Wen Nienhuys, 2005/01/09