use c code only

Hi i alread given the 80% code you need to full fill remaing 20% code Below are the code and question

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

/* front.c – a lexical analyzer system for simple
arithmetic expressions */
#include
#include
/* Global declarations */
/* Variables */
int charClass;
char lexeme [100];
char nextChar;
int lexLen;
int token;
int nextToken;
FILE *in_fp, *fopen();
/* Function declarations */
void addChar();
void getChar();
void getNonBlank();
int lex();
void expr();
void term();
void factor();
/* Character classes */
#define LETTER 0
#define DIGIT 1
#define UNKNOWN 99
/* Token codes */
#define INT_LIT 10
#define IDENT 11
#define ASSIGN_OP 20
#define ADD_OP 21
#define SUB_OP 22
#define MULT_OP 23
#define DIV_OP 24
#define LEFT_PAREN 25
#define RIGHT_PAREN 26
/******************************************************/
/* main driver */
int main() {
/* Open the input data file and process its contents */
if ((in_fp = fopen(“front.in”, “r”)) == NULL)
printf(“ERROR – cannot open front.in \n”);
else {
getChar();
do {
lex();
expr();
} while (nextToken != EOF);
}
return 0;
}
/*****************************************************/
/* lookup – a function to lookup operators and parentheses
and return the token */
int lookup(char ch) {
switch (ch) {
case ‘(‘:
addChar();
nextToken = LEFT_PAREN;
break;
case ‘)’:
addChar();
nextToken = RIGHT_PAREN;
break;
case ‘+’:
addChar();
nextToken = ADD_OP;
break;
case ‘-‘:
addChar();
nextToken = SUB_OP;
break;
case ‘*’:
addChar();
nextToken = MULT_OP;
break;
case ‘/’:
addChar();
nextToken = DIV_OP;
break;
}
return nextToken;
}
/*****************************************************/
/* addChar – a function to add nextChar to lexeme */
void addChar() {
if (lexLen {(+ | -) }
*/
void expr() {
printf(“Enter \n”);
/* Parse the first term */
term();
/* As long as the next token is + or -, get
the next token and parse the next term */
while (nextToken == ADD_OP || nextToken == SUB_OP) {
lex();
term();
}
printf(“Exit \n”);
} /* End of function expr */
/* term
Parses strings in the language generated by the rule:
-> {(* | /) )
*/
void term() {
printf(“Enter \n”);
/* Parse the first factor */
factor();
/* As long as the next token is * or /, get the
next token and parse the next factor */
while (nextToken == MULT_OP || nextToken == DIV_OP) {
lex();
factor();
}
printf(“Exit \n”);
} /* End of function term */
/* factor
Parses strings in the language generated by the rule:
-> id | int_constant | (

Order a unique copy of this paper

600 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
Top Academic Writers Ready to Help
with Your Research Proposal

Order your essay today and save 25% with the discount code GREEN