Question: you will implement a interpreter, using lex and yacc or flex and bison, for a small calculator language (actually an integer calculator) with its grammar
you will implement a interpreter, using lex and yacc or flex and bison, for a small calculator language (actually an integer calculator) with its grammar given in BNF notation. The language literals are enclosed with ' '. means empty string or null input. Grammar:-> end -> | ->INT_CONSTANT | + | - | * | / |( ) The possible set of tokens, represented with regular expressions, includes: PLUS -> + MINUS -> - TIMES -> * DIV -> / LPAREN -> ( RPAREN -> ) INT_CONSTANT -> digit digit* digit ->[0-9] END -> end ENDOFLINE ->
Step by Step Solution
There are 3 Steps involved in it
To create an interpreter for a small calculator using lex and yacc or flex and bison youll need to follow several steps Ill outline the general proces... View full answer
Get step-by-step solutions from verified subject matter experts
