The Science Forum - Scientific Discussion and Debate  
 
 Live Chat    FAQ    Search    Usergroups
 
Register  ::  Log in Log in to check your private messages
 
Science Forum Forum Index » Computer Science » Help on parse (derivation) trees..

  
 Help on parse (derivation) trees.. « View previous topic :: View next topic » 
Author Message
kyphu
Posted: Wed Mar 12, 2008 4:04 pm    Post subject: Help on parse (derivation) trees.. Reply with quote

Forum Freshman
Forum Freshman

Joined: 11 Mar 2008
Posts: 2

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!
Back to top
View user's profile Send private message
marnixR
Posted: Thu Mar 13, 2008 12:43 am    Post subject: Reply with quote

Forum Isotope
Forum Isotope

Joined: 10 Apr 2007
Posts: 2590
Location: Cardiff, Wales

as with your previous post, can you give us an example of what a parse or derivation tree looks like - until you do i'm afraid i might just give a completely wrong answer and send you on a wild goose chase that wouldn't be very helpful
_________________
if you find this place too crowded or too confrontational, how about trying Philosophorum,
the amicable forum where small is beautiful and even the trolls are intelligent

biology without evolution is but stamp collecting
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
   Page 1 of 1

Science Forum Forum Index » Computer Science » Help on parse (derivation) trees..
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 
 


Google
 

© 2004-2008 Thescienceforum.com

Sponsored by EnluxLED

Partner Forums
Politics Forum  Radar Detector