Jump to content

Recommended Posts

Posted

I was given a question of the follwing:

 

Consider the Baby Programming Language (BPL). It is a very simple programming language,

whose syntax is given by the following grammar:

 

S → WHILE B DO S ENDWHILE; | SS | A | P

A → I := E;

I → char(char)٭

E → digit | E + E | I

P → PRINT I;

B → TRUE | FALSE | E == E

 

Give the parse (derivation) tree for :

WHILE 4==3 DO PRINT x; x:=4; ENDWHILE;

ex := 4;

 

I'm really stuck. Somebody help!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.