43 std::cerr <<
"Can't open CFL grammar file `" <<
fileName <<
"`" << std::endl;
48 std::string
lines =
"";
65 if (
start != std::string::npos && end != std::string::npos)
74 if (
start != std::string::npos && end != std::string::npos)
113 std::string word =
"";
116 while ((
pos =
lines.find(
";")) != std::string::npos)
128 size_t start =
s.find_first_not_of(
" ");
129 if (
start == std::string::npos)
135 size_t end =
s.find_last_not_of(
" ");
144 std::string word =
"";
void setStartKind(Kind startKind)
Symbol insertSymbol(std::string strLit)
SymbolMap< Symbol, Productions > & getRawProductions()
Kind insertTerminalKind(std::string strLit)
std::vector< Symbol > Production
GrammarBase * build() const
Build grammarBase from fileName.
const std::string parseProductionsString() const
Parse start symbol and production from file string.
const std::string stripSpace(std::string s) const
Strip front and tail space.
const std::vector< std::string > loadWordProductions() const
Parse whole production string to production vector.
llvm::IRBuilder IRBuilder