[Tutor] Python Grammer

Alan Gauld alan.gauld at btinternet.com
Sat Mar 22 00:27:59 CET 2008


"Eric Walker" <sli1que at yahoo.com> wrote

.
> I have some text that I have to parse. I want to use grammers.
> I can't seem to understand how the syntax works.
> something like:
> hello :=<some regex >

OK, Thats somethjing called Backaus Naur Format (or BNF),
try Googling for it - or Wikipedia - and you will get lots of 
examples.
It's a format for defining grammars (such as programming languages.)
ISTR it was invented to describe Algol which was the great grand-daddy
of C/C++/Java etc.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list