On Tue, Aug 26, 2008 at 09:54:28AM +0100, Paul Gregory wrote:
> On Tue, Aug 26, 2008 at 2:07 AM, <
c42f@...> wrote:
>
> > Revision: 2408
> >
http://aqsis.svn.sourceforge.net/aqsis/?rev=2408&view=rev> > Author: c42f
> > Date: 2008-08-26 01:07:33 +0000 (Tue, 26 Aug 2008)
> >
> > Log Message:
> > -----------
> > * Fix bugs in lexer (line, col) position handling
> >
> > * Make lexer discard comments for now. Later we might want to enable
> > passing
> > them on to the parser in some manner (in particular it would be nice not
> > to
> > loose all the comments when performing RIB validation with miqser).
> >
>
> Be aware, we'll need to be able to pass comments back to the parser for
> support of RiProcedural too, as the input stream is terminated by a '\0377',
> and the recommended way to do this is via RiArchiveRecored(RI_COMMENT,
> '\377'), which produces a comment terminated by '\0377'.
Thanks for pointing that out. My eventual plan for the comments is that
the lexer will accumulate them if requested, and the parser will be able
to retrieve the current list of comments. This could happen at the end
of every RIB request if we wanted to pass the comments through to
libri2rib.
Unfortunately, there doesn't seem to be a clean way to support writing
comments back into the output stream. Originally I had comment tokens
produced by the lexer, but this led to a lot of extra complexity in the
parser and seemed like the wrong thing to do.
> I suppose it would be possible to terminate the stream in the lexer though.
Good point; this would probably be a lot cleaner given the current way
things work. The lexer could then just return an ENDOFFILE token and
everything else would terminate gracefully. To me, this sounds like the
Right Thing to do.
~Chris.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development