Implemented grammer loading

This commit is contained in:
Nathan Braswell
2013-05-20 19:34:15 -04:00
parent 46d59ac595
commit d2698cf203
11 changed files with 342 additions and 4 deletions

32
include/Parser.h Normal file
View File

@@ -0,0 +1,32 @@
#ifndef PARSER_H
#define PARSER_H
#ifndef NULL
#define NULL 0
#endif
#include "ParseRule.h"
#include "Symbol.h"
#include "StringReader.h"
#include <map>
#include <vector>
#include <string>
#include <iostream>
class Parser {
public:
Parser();
~Parser();
void loadGrammer(std::string grammerInputString);
std::string grammerToString();
private:
StringReader reader;
std::map<std::string, Symbol*> symbols;
std::vector<ParseRule*> loadedGrammer;
Symbol* getOrAddSymbol(std::string symbolString, bool isTerminal);
};
#endif