Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Get rid of this
- //using namespace LA;
- EntryPoint::EntryPoint()
- {
- //ctor
- }
- EntryPoint::~EntryPoint()
- {
- //dtor
- }
- int main()
- {
- std::ifstream indata;
- std::string filename = "prog1.px";
- // Reads the source .px file
- indata.open(filename.c_str());
- if(!indata)
- {
- std::cerr << "Error: file could not be opened." << std::endl;
- exit(1);
- }
- #ifndef LEXICAL_ANALYSIS
- LA::LexicalAnalyzer lexicalAnalyzer(indata);
- lexicalAnalyzer.analyze();
- // Checks if some error happened on the lexical analysis
- if(lexicalAnalyzer.hasError())
- {
- lexicalAnalyzer.showErrors();
- exit(1);
- }
- std::cout << "Lexical Analysis successfully performed! \n\n -> Tokens List" << std::endl;
- lexicalAnalyzer.showTokens(); // Show the list of tokens generated on the lexical analysis
- }
- #endif // LEXICAL_ANALYSIS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement