24.02.1
|
Go to the documentation of this file.
24 #ifndef SRC_RUNTIME_CL_MLGO_MLGO_PARSER_H
25 #define SRC_RUNTIME_CL_MLGO_MLGO_PARSER_H
135 TokenStream(std::istream &s,
const std::string &delims =
",\n");
141 explicit operator bool()
const;
163 return _tokens.front().pos;
169 Token recognize_tok(
char ch);
171 Token num_st(std::string value =
"");
173 Token float_after_dp_st(std::string value =
"");
175 Token text_st(std::string value =
"");
177 bool reached_end()
const;
179 bool is_delim(
char ch)
const;
182 std::istream &_istream;
183 std::deque<Token> _tokens;
193 std::pair<bool, MLGOHeuristics>
parse_mlgo(std::istream &in);
198 #endif //SRC_RUNTIME_CL_MLGO_MLGO_PARSER_H
std::string value
Token value.
bool operator==(const Token &other) const
Token peek(size_t i=0)
Peek the next ith token.
Token(TokenType t, std::string v, CharPosition pos)
bool operator==(const CharPosition &other) const
static constexpr size_t max_look_ahead
std::pair< bool, MLGOHeuristics > parse_mlgo(std::istream &in)
Parse and construct a MLGOHeuristics from input stream.
CharPosition current_pos() const
Get the position of the current token.
Token take()
Get and pop off the current token.
MLGOHeuristics mlgo(TokenStream &in, bool &valid)
Copyright (c) 2017-2024 Arm Limited.
TokenType type
Token type.
TokenStream(std::istream &s, const std::string &delims=",\n")
Constructor.