Parser bug ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Parser bug ?

Vilmundur Palmason

I have been using the development version  of grammatica (1.5 alpha 2) and it looks to me like there is a bug in the parser generation.

The attached grammar should do as a test case,  by passing to it :

{start a b c}

i get:

net.percederberg.grammatica.parser.ParserLogException: unexpected token "b" <IDENT>, expected "}", on line 1 column: 10
    at net.percederberg.grammatica.parser.Parser.reset (Parser.java:271)
    at net.percederberg.grammatica.parser.Parser.parse(Parser.java:303)
     ...
A workaround for this simple case is to eliminate the Sentence production by inlining it.

Unfortunately I have a grammar file that is much bigger where it is difficult to use such a workaround
without increasing the complexity.

Regards,

Vilmundur Palmason





_______________________________________________
Grammatica-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/grammatica-users

problem.grammar (952 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Parser bug ?

Leszek Doniec
Hi,
Productions NumberList and WordList have the same begining. In the version of grammatica I use it was a problem, I don't know if it is already solved. Try to add one common production for those two, something like this:
 
Result = List;
 
List = "{" [IDENT ":"] ( WordList | NumberList); // Or just Result = ...
 
NumberList = NUMBER ("," NUMBER)+ "}";
WordList = Sentence "}";

I can't check it right now, but I hope it works
Regards,
Leszek Doniec
 
 
2006/9/5, Vilmundur Palmason <[hidden email]>:

I have been using the development version  of grammatica (1.5 alpha 2) and it looks to me like there is a bug in the parser generation.

The attached grammar should do as a test case,  by passing to it :

{start a b c}

i get:

net.percederberg.grammatica.parser.ParserLogException: unexpected token "b" <IDENT>, expected "}", on line 1 column: 10
    at net.percederberg.grammatica.parser.Parser.reset (Parser.java:271)
    at net.percederberg.grammatica.parser.Parser.parse(Parser.java:303)
     ...
A workaround for this simple case is to eliminate the Sentence production by inlining it.

Unfortunately I have a grammar file that is much bigger where it is difficult to use such a workaround
without increasing the complexity.

Regards,
 

Vilmundur Palmason





_______________________________________________
Grammatica-users mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.nongnu.org/mailman/listinfo/grammatica-users" target="_blank">http://lists.nongnu.org/mailman/listinfo/grammatica-users





_______________________________________________
Grammatica-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/grammatica-users
Reply | Threaded
Open this post in threaded view
|

Re: Parser bug ?

Vilmundur Palmason
Thanks,  this is one possible workaround.

Does anyone know if there are plans for further development (i.e. 1.5 release) ?
I really hope there are, this is an excellent tool.

Regards,
Vilmundur Palmason

2006/9/5, Leszek Doniec <[hidden email]>:
Hi,
Productions NumberList and WordList have the same begining. In the version of grammatica I use it was a problem, I don't know if it is already solved. Try to add one common production for those two, something like this:
 
Result = List;
 
List = "{" [IDENT ":"] ( WordList | NumberList); // Or just Result = ...
 
NumberList = NUMBER ("," NUMBER)+ "}";
WordList = Sentence "}";

I can't check it right now, but I hope it works
Regards,
Leszek Doniec
 
 
2006/9/5, Vilmundur Palmason <[hidden email]>:

I have been using the development version  of grammatica (1.5 alpha 2) and it looks to me like there is a bug in the parser generation.

The attached grammar should do as a test case,  by passing to it :

{start a b c}

i get:

net.percederberg.grammatica.parser.ParserLogException: unexpected token "b" <IDENT>, expected "}", on line 1 column: 10
    at net.percederberg.grammatica.parser.Parser.reset (Parser.java:271)
    at net.percederberg.grammatica.parser.Parser.parse(Parser.java:303)
     ...
A workaround for this simple case is to eliminate the Sentence production by inlining it.

Unfortunately I have a grammar file that is much bigger where it is difficult to use such a workaround
without increasing the complexity.

Regards,
 

Vilmundur Palmason





_______________________________________________
Grammatica-users mailing list
[hidden email]
<a style="border-bottom-style: groove;" href="http://lists.nongnu.org/mailman/listinfo/grammatica-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.nongnu.org/mailman/listinfo/grammatica-users





_______________________________________________
Grammatica-users mailing list
[hidden email]
<a style="border-bottom-style: groove;" onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.nongnu.org/mailman/listinfo/grammatica-users" target="_blank">http://lists.nongnu.org/mailman/listinfo/grammatica-users




_______________________________________________
Grammatica-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/grammatica-users
Reply | Threaded
Open this post in threaded view
|

Re: Parser bug ?

Per Cederberg
I guess I am the one who really *should* know about
version 1.5... The thing is that I got kind of stuck
on the new look-ahead implementation about a year ago.
And since then I've been too busy with other things
to really look at Grammatica seriously.

But I do have the intention to finish version 1.5
any year now... ;-)

I am really sorry about the extreme delay here. But
I guess that is what happens when one tries to both
have a full-time job and run 3 open source projects
in parallell.

Cheers,

/Per

PS. The current 1.5.alpha2 should be really stable
and all. It is just that it is a bit slower than what
I recon it should be.

Vilmundur Palmason wrote:

> Thanks,  this is one possible workaround.
>
> Does anyone know if there are plans for further development (i.e. 1.5
> release) ?
> I really hope there are, this is an excellent tool.
>
> Regards,
> Vilmundur Palmason
>
> 2006/9/5, Leszek Doniec <[hidden email]
> <mailto:[hidden email]>>:
>
>     Hi,
>     Productions NumberList and WordList have the same begining. In the
>     version of grammatica I use it was a problem, I don't know if it is
>     already solved. Try to add one common production for those two,
>     something like this:
>      
>     Result = List;
>      
>     List = "{" [IDENT ":"] ( WordList | NumberList); // Or just Result = ...
>      
>     NumberList = NUMBER ("," NUMBER)+ "}";
>     WordList = Sentence "}";
>
>     I can't check it right now, but I hope it works
>     Regards,
>     Leszek Doniec
>      
>      
>     2006/9/5, Vilmundur Palmason <[hidden email]
>     <mailto:[hidden email]>>:
>
>
>     I have been using the development version  of grammatica (1.5 alpha
>     2) and it looks to me like there is a bug in the parser generation.
>
>     The attached grammar should do as a test case,  by passing to it :
>
>     {start a b c}
>
>     i get:
>
>     net.percederberg.grammatica.parser.ParserLogException: unexpected
>     token "b" <IDENT>, expected "}", on line 1 column: 10
>         at net.percederberg.grammatica.parser.Parser.reset (Parser.java:271)
>         at net.percederberg.grammatica.parser.Parser.parse(Parser.java:303)
>          ...
>     A workaround for this simple case is to eliminate the Sentence
>     production by inlining it.
>
>     Unfortunately I have a grammar file that is much bigger where it is
>     difficult to use such a workaround
>     without increasing the complexity.
>
>     Regards,
>      
>
>     Vilmundur Palmason
>
>
>
>
>
>     _______________________________________________
>     Grammatica-users mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.nongnu.org/mailman/listinfo/grammatica-users
>     <http://lists.nongnu.org/mailman/listinfo/grammatica-users>
>
>
>
>
>
>     _______________________________________________
>     Grammatica-users mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.nongnu.org/mailman/listinfo/grammatica-users
>     <http://lists.nongnu.org/mailman/listinfo/grammatica-users>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grammatica-users mailing list
> [hidden email]
> http://lists.nongnu.org/mailman/listinfo/grammatica-users


_______________________________________________
Grammatica-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/grammatica-users