[EMAIL PROTECTED] writes: > Han-Wen Nienhuys <[EMAIL PROTECTED]> 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 | [EMAIL PROTECTED] | http://www.xs4all.nl/~hanwen _______________________________________________ lilypond-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/lilypond-devel
