You will design a lexical and syntax analyzer for your own programming language. You will describe
some rules for your programming language and call it as MPL (My Programming Language). For
example, your rules may be as;
- 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;
- 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
The assignment will be submitted in 3 steps:
Step 1. 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, anybody help me? pls :///
Sorry, but you are not allowed to view signatures , please Register or Login