Question: 2. Make a context independent grammar (C.I.G.), which generates the conditional if statement with the following restrictions: - You are always going to compare a
2. Make a context independent grammar (C.I.G.), which generates the conditional if statement with the following restrictions: - You are always going to compare a variable with an integer or a variable with another variable. - The relational operators are: <>==!=. - Variables must start at a letter and after that letter there can be any number of numbers or letters. A a a1 a01 restrictions 0a 0 - Numbers are only to be integers of any number of digits. - A number must not start at zero, but may be zero. Restriction 02 2 0 2000 1727 - The logical operators && (and) and II (or) can be used. - Only the parentheses after the if and at the end of the if are to be used. - The body of the if must be indicated by braces - Only assignment expressions are considered in the body of the if, each of them ending with a semicolon (;).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
