grammatica-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Grammatica-users] Empty file parsing


From: Per Cederberg
Subject: Re: [Grammatica-users] Empty file parsing
Date: Thu, 08 Jun 2006 07:38:57 +0200
User-agent: Thunderbird 1.5.0.4 (Macintosh/20060530)

I assume that the comment tokens are marked with %ignore%.
In that case it is not possible to do it with Grammatica,
as all productions must match at least 1 token.

You could do some kind of work-around, though, by ignoring
parse errors on some occations. Perhaps the easiest way
would be to subclass the Tokenizer to set a flag if it
returns a token. In case of parse error, you can then check
the flag to see if the cause was lack of input. Care must
be taken to handle tokenizer exceptions properly though.

I know this isn't an ideal solution. So I've registered a
feature request on the issue:

https://savannah.nongnu.org/bugs/index.php?func=detailitem&item_id=16783

Cheers,

/Per

Leszek Doniec wrote:
Hello,
is there any possibility to parse a file that includes only comments? I use grammatica 1.4. Thanks for help,
Leszek Doniec


------------------------------------------------------------------------

_______________________________________________
Grammatica-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/grammatica-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]