Question: Check the exp - rules.l file to add more rules for my program no Java,C + + or python / * * * * *
Check the exprules.l file to add more rules for my program no Java,C or python
Name: Vishal Murugavel NetID: vm
Course: CSE
Lab: Lexical Analyzer
Purpose of File: Contains the
This is the file that you should modify for Lab
option noyywrap
#include "lexer.h
global variable to hold current line number being read
int linenumber ;
int linelength ;
int position ;
char tokenvalueMAXTOKENLENGTH;
Data Values
Llaboratoryconfirmed case" return LABORATORY;
Pprobable Case" return PROBABLE;
Mmale return MALE;
Ffemale return FEMALE;
Oother return OTHER;
Years" return AGEX;
Years" return AGEX;
Years" return AGEX;
Years" return AGEX;
Years" return AGEX;
Years" return AGEX;
Years" return AGEX;
Years" return AGEX;
HhispanicLlatino return HISPANIC;
Aamerican Iindian Aalaska NnativeNnonHhispanic return NATIVEAMERICAN;
AasianNnonHhispanic return ASIAN;
BblackNnonHhispanic return BLACK;
Nnative Hhawaiian Oother Ppacific IislanderNnonHhispanic return PACIFICISLANDER;
WwhiteNnonHhispanic return WHITE;
MmultipleOotherNnonHhispanic return MULTIPLEOTHER;
Generic Data Values
"Yes" return YES;
No return NO;
"Unknown" return UNKNOWNTOKEN;
"Missing" return MISSING;
Punctuation
return SEPARATOR;
Eat newline and increment line number
linenumber;
Eat any remaining whitespace
tr Do nothing
Found an unknown character
return UNKNOWNVALUE;
Recognize end of file
return EOFTOKEN;
Match anything else as an unknown token
return UNKNOWNTOKEN; Please add rules to my exprules.l flex file no Java, C or python Use flex to generate a lexical analyzer using the language specification shown in the following table. A
set of files that you will use as a starting point for your code is in the attached
LabStartingPoint.zip file.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
