OQL BNF

24 views
Skip to first unread message

Juanjo Conti

unread,
Sep 16, 2009, 7:23:40 AM9/16/09
to ply-...@googlegroups.com
I'm goingo to do a little exercise trying to create a OQL2ORM app.
Objetive: didactic.

I'm using the BNF showed in this book:

http://www.makumba.org/oql-manual.pdf

Could check out it and tell me if PLY can be used for this? I am not
sure if it's BNF or EBNF.

Thanks!
--
Juanjo Conti
blog: http://www.juanjoconti.com.ar

A.T.Hofkamp

unread,
Sep 16, 2009, 7:39:37 AM9/16/09
to ply-...@googlegroups.com
Juanjo Conti wrote:
> I'm goingo to do a little exercise trying to create a OQL2ORM app.
> Objetive: didactic.
>
> I'm using the BNF showed in this book:
>
> http://www.makumba.org/oql-manual.pdf
>
> Could check out it and tell me if PLY can be used for this? I am not
> sure if it's BNF or EBNF.

It's EBNF, things like {FOO} do not exist in BNF.

It does not matter much though, you can use PLY for both.


Albert

Juanjo Conti

unread,
Sep 16, 2009, 6:20:14 PM9/16/09
to ply-...@googlegroups.com
2009/9/16 A.T.Hofkamp <a.t.h...@tue.nl>:

Great! thanks Albert. I'll let you know if I do something.

Juanjo Conti

unread,
Sep 24, 2009, 11:38:46 PM9/24/09
to ply-...@googlegroups.com
2009/9/16 Juanjo Conti <jjc...@gmail.com>

I've being working with the grammar but I found somethinf difficult to workarround. Can this be implemented with PLY yacc?

query ::= type_name ([query] )
query ::= type_name (identifier:query {, identifier: query})
query ::= struct (identifier: query {, identifier: query})
query ::= set ([query {, query}])
query ::= bag ([query {,query}])
query ::= list ([query {,query}])
query ::= (query, query {, query})
query ::=[ list](query .. query)
query ::= array ([query {,query}])

Thanks

D.Hendriks (Dennis)

unread,
Sep 25, 2009, 5:25:28 AM9/25/09
to ply-...@googlegroups.com
Hello Juanjo,

> I've being working with the grammar but I found somethinf difficult to
> workarround.

You don't specify why it is difficult, or what you have to work around.
I assume it is because you have EBNF and need BNF? In such a case, first
translate the EBNF to BNF. A site like
http://lamp.epfl.ch/teaching/archive/compilation-ssc/2000/part4/parsing/node3.html

explains how to do this. Once you have BNF, it should be straight-forward.

> Can this be implemented with PLY yacc?

I don't know whether the above approach will result in shift/reduce
conflicts etc for this particular grammar, but you can just try and
you'll find out...

Best,
Dennis Hendriks


Juanjo Conti wrote:
> 2009/9/16 Juanjo Conti <jjc...@gmail.com <mailto:jjc...@gmail.com>>
>
> 2009/9/16 A.T.Hofkamp <a.t.h...@tue.nl <mailto:a.t.h...@tue.nl>>:
Reply all
Reply to author
Forward
0 new messages