BNF grammar

I know I should have try it first but I dont understand what is this asking about. My english is my very bad. Can you please telling in easy english. PLus this is very confusing. Please help me out

Write a BNF grammar for the for statement of C. Assume <expression> and <statement> and <block> are defined elsewhere nonterminals (you dont' define them). Statement is a single statement, including control statements but excluding block, and block is some code with {} around. Do not use the extended BNF notation.

For the above, write operational semantics.

Design a regular language where every sentence has to start with any number of strings 11, then repeats 100 any number of times, then repeat 00 at least once.

For the above, how many valid strings there are?

For the above, how many valid strings are there if we restrict the total length to a) at most 7 bits? b) exactly 7 bits?
Last edited on
Here is what I have try for




<for loop> ::= for ( <expression> ; <expression>; <expression> ) <statement>

I dont know how to do

Design a regular language where every sentence has to start with any number of strings 11, then repeats 100 any number of times, then repeat 00 at least once.

For the above, how many valid strings there are?

For the above, how many valid strings are there if we restrict the total length to a) at most 7 bits? b) exactly 7 bits?
Last edited on
Topic archived. No new replies allowed.