Question: c + + code please. here is the outline: #include #include #include #include lexer.h using namespace std; / / read grammar void ReadGrammar (
c code please. here is the outline:
#include
#include
#include
#include "lexer.h
using namespace std;
read grammar
void ReadGrammar
cout
;
Task
void CalculateFirstSets
cout
;
lexer.h:
#ifndef LEXERH
#define LEXERH
#include
#include
#include "inputbuf.h
Lexer modified for FIRST & FOLLOW project
typedef enum ENDOFFILE ARROW, STAR, HASH, ID ERROR TokenType;
class Token
public:
void Print;
std::string lexeme;
TokenType tokentype;
int lineno;
;
class LexicalAnalyzer
public:
Token GetToken;
Token peekint;
LexicalAnalyzer;
private:
std::vector tokenList;
Token GetTokenMain;
int lineno;
int index;
Token tmp;
InputBuffer input;
bool SkipSpace;
Token ScanId;
;
#endif LEXERH
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
