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 "0
";
}
// Task 3
void CalculateFirstSets()
{
cout "3
";
}
lexer.h:
#ifndef __LEXER__H__
#define __LEXER__H__
#include
#include
#include "inputbuf.h"
// Lexer modified for FIRST & FOLLOW project
typedef enum { END_OF_FILE =0, ARROW, STAR, HASH, ID, ERROR } TokenType;
class Token {
public:
void Print();
std::string lexeme;
TokenType token_type;
int line_no;
};
class LexicalAnalyzer {
public:
Token GetToken();
Token peek(int);
LexicalAnalyzer();
private:
std::vector tokenList;
Token GetTokenMain();
int line_no;
int index;
Token tmp;
InputBuffer input;
bool SkipSpace();
Token ScanId();
};
#endif //__LEXER__H__
c + + code please. here is the outline: #include

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!