Remove namespace, usage of g3log
This commit is contained in:
parent
0952ae950b
commit
a103cb1c9c
|
@ -3,17 +3,10 @@
|
||||||
#include "Parsodus/parser.h"
|
#include "Parsodus/parser.h"
|
||||||
#include "Parsodus/util/parserType.h"
|
#include "Parsodus/util/parserType.h"
|
||||||
#include "Lexesis/inputparser.h"
|
#include "Lexesis/inputparser.h"
|
||||||
|
#include "g3log/g3log.hpp"
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
std::set<std::string> getTerminals(std::string file) {
|
|
||||||
std::fstream f(file);
|
|
||||||
return lxs::input::InputParser::getTokens(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace pds {
|
namespace pds {
|
||||||
|
|
||||||
|
@ -27,7 +20,8 @@ namespace pds {
|
||||||
|
|
||||||
Config cnf = *parser.parse();
|
Config cnf = *parser.parse();
|
||||||
if (!cnf.lexesisFile.empty()) {
|
if (!cnf.lexesisFile.empty()) {
|
||||||
auto terminals = getTerminals(cnf.lexesisFile);
|
std::fstream file(cnf.lexesisFile);
|
||||||
|
auto terminals = lxs::input::InputParser::getTokens(file);
|
||||||
for(auto& terminal : terminals)
|
for(auto& terminal : terminals)
|
||||||
cnf.grammar.terminals.insert(terminal);
|
cnf.grammar.terminals.insert(terminal);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +47,7 @@ namespace pds {
|
||||||
if (found_token) break;
|
if (found_token) break;
|
||||||
}
|
}
|
||||||
if (!found_token)
|
if (!found_token)
|
||||||
std::cout << "Warning: Terminal '" << term << "' is not been used." << std::endl;
|
LOG(WARNING) << "Terminal '" << term << "' is not been used." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cnf;
|
return cnf;
|
||||||
|
|
Loading…
Reference in New Issue