Consider the following extended BNF grammar for a subset of the Python programming language,
called MicroPython.

program ::= import list f funcdef g
funcdef ::= def func-identier ( [ identier f , identier g ] ) :
suite return add-expr
suite ::= statement f statement g
statement ::= variable-identier = expr
j if or-test : suite [else : suite ]
j while or-test : suite
j print expr
or-test ::= and-test f or and-test g
and-test ::= not-test f and not-test g
not-test ::= comparison j not not-test
comparison ::= add-expr comp-operator add-expr
comp-operator ::= < j > j == j >= j <= j <>
add-expr ::= mult-expr f add-operator mult-expr g
add-operator ::= + j

Re: programing in python question 80 80

I take it this is an assignment for an undergrad Compilers class?

What sort of progress have you made so far?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.