Sunday, July 12, 2009

Derive the regular grammar to describe the syntax of a conventional representation of do-while statement in c.

do{


............


//body


............}while(condition);

Derive the regular grammar to describe the syntax of a conventional representation of do-while statement in c.
Been out of touch with the dragon book. Here is a try though.





DO_WHILE: do [whitespace+] {


[whitespace+]statement*


[whitespace+]


} [whitespace+] while( expression );





Look at the appendix of The C programming Language book by Kernighan and Ritchie.


No comments:

Post a Comment