Answer» - all programs must start with “begin” and end with “end” - all commands must be ended by “;” - all variables must be declared just after “begin” in the following format; int: i num; float: fl; - three types exist; “int”, “float”, “char” - variables names may be any alphanumeric string, but they must start with a letter - statements between “begin” and “end” can be either a variable declaration or an assignment - an assignment includes four type of operators; +,-,*,/. - the NUMBER of variables or constants in an expression is unlimited - the presedence of operators given as.............. - ........ - .etc
Your PL should include a well-defined regular GRAMMAR for variable names, rules for variable declarations including their type, at least 4 arithmetic and 3 logical operators with their precedence and associativity rules with and without parenthesis, INDEFINITE number of assignments with expressions having unlimited number of operands.
How can i do? I have to use C language and ANTLRWe don't do HOMEWORK here. How will you learn if people do the work for you?All the statements are either false or not universally true. Entire programs can be written without a single semi colon. Entire programs can be written with using C or any part of it. Operators are not always needed. Just nice to have.
The is a very real limit to the number of variable. The number of variables must be less that the numb er of atomic particles in the universe. In practice, even much bless that that.
Ect.? No, ect. ? No, etc can not be used to DEFINE a language structure.
|