30 std::vector<std::pair<std::string::iterator, std::size_t>>
m_it_to_row;
31 std::string::iterator
m_it, m_next_it;
41 void registerNewLine(std::string::iterator it, std::size_t row);
51 void initParser(
const std::string& filename,
const std::string& code);
60 void error(
const std::string& error, std::string exp);
67 void errorWithNextToken(
const std::string& message);
75 void errorMissingSuffix(
char suffix,
const std::string& node_name);
81 long getCount() {
return std::distance(m_str.begin(), m_it); }
87 std::size_t
getSize()
const {
return m_str.size(); }
93 [[nodiscard]]
bool isEOF()
const {
return m_it == m_str.end(); }
95 void backtrack(
long n);
104 bool accept(
const CharPred& t, std::string* s =
nullptr);
112 bool expect(
const CharPred& t, std::string* s =
nullptr);
116 bool space(std::string* s =
nullptr);
117 bool inlineSpace(std::string* s =
nullptr);
118 bool comment(std::string* s =
nullptr);
119 bool spaceComment(std::string* s =
nullptr);
120 bool newlineOrComment(std::string* s =
nullptr);
123 bool number(std::string* s =
nullptr);
124 bool signedNumber(std::string* s =
nullptr);
125 bool hexNumber(
unsigned length, std::string* s =
nullptr);
126 bool name(std::string* s =
nullptr);
127 bool sequence(
const std::string& s);
128 bool packageName(std::string* s =
nullptr);
137 bool anyUntil(
const CharPred& delim, std::string* s =
nullptr);
146 bool oneOf(std::initializer_list<std::string> words, std::string* s =
nullptr);