So far, I was able to use pyparsing to parse ebnf grammars. However, I wanted to try the following code sample but could not come up with a good grammar.
global radius = 5
DrawCircle(radius)
{
radius = 10
DrawCircle(radius)
}
DrawCircle(radius)
The value of radius with in the scope should be 10, 5 otherwise. Any help would be appreciated ?
Regards
Praveen
I was able to get the parser for the above code by running:
I have a follow up question. I am used to write ebnf grammar using http://pyparsing.wikispaces.com/file/view/ebnf.py
Can I get some help identifying the ebnf for forward or equivalent of the above code ? or should I do outside ebnf ?
Regards
Praveen