Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I / * * * * * * * * * * * * * * * * * * * * * * *

I/*********************************************************************
Name: Vishal Murugavel NetID: vm603
Course: CSE 4714
Lab: 01- Lexical Analyzer
Purpose of File: Contains the ....
This is the file that you should modify for Lab 1.
**********************************************************************/
%option noyywrap
%{
#include "lexer.h"
// global variable to hold current line number being read
int line_number =1;
%}
%%
/* Data Values */
[0-9]{4}\/[0-9]{2}\/[0-9]{2}{return DATE; }
"Laboratory-confirmed case" { return LABORATORY; }
"Probable Case" { return PROBABLE; }
"Male" { return MALE; }
"Female" { return FEMALE; }
"Other" { return OTHER; }
"0-9 Years" { return AGE_0X; }
"10-19 Years" { return AGE_1X; }
"20-39 Years" { return AGE_2X; }
"40-49 Years" { return AGE_4X; }
"50-59 Years" { return AGE_5X; }
"60-69 Years" { return AGE_6X; }
"70-79 Years" { return AGE_7X; }
"80+ Years" { return AGE_8X; }
"Hispanic/Latino"{ return HISPANIC; }
"American Indian / Alaska Native, Non-Hispanic" { return NATIVE_AMERICAN; }
"Asian, Non-Hispanic" { return ASIAN; }
"Black, Non-Hispanic" { return BLACK; }
"Native Hawaiian / Other Pacific Islander, Non-Hispanic" { return PACIFIC_ISLANDER; }
"\"[wW]\"hite, Non-Hispanic" { return WHITE; }
"Multiple/Other, Non-Hispanic" { return MULTIPLE_OTHER; }
/* Generic Data Values */
"Yes" { return YES; }
"No"{ return NO; }
"Unknown" { return UNKNOWN_VALUE; }
"Missing" { return MISSING; }
/* Punctuation */
","{ return SEPARATOR; }
/* Eat any whitespace, will need to be modified to count lines */
[\t\r
]+{ line_number++; }/* nop */
/* Found an unknown character */
.{ return UNKNOWN_VALUE; }
/* Recognize end of file */
<>{ return EOF_TOKEN; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago

Question

Draw and explain the operation of LVDT for pressure measurement

Answered: 1 week ago