45 std::cerr <<
"Can't open CFL grammar file `" <<
fileName <<
"`" << std::endl;
50 std::string
lines =
"";
67 if (
start != std::string::npos && end != std::string::npos)
76 if (
start != std::string::npos && end != std::string::npos)
115 std::string word =
"";
118 while ((
pos =
lines.find(
";")) != std::string::npos)
130 size_t start =
s.find_first_not_of(
" ");
131 if (
start == std::string::npos)
137 size_t end =
s.find_last_not_of(
" ");
146 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