24 #ifndef SRC_RUNTIME_CL_MLGO_MLGO_PARSER_H 25 #define SRC_RUNTIME_CL_MLGO_MLGO_PARSER_H 98 return ln == other.
ln && col == other.
col;
109 :
type{ t }, value{ v }, pos{ pos }
128 static constexpr
size_t max_look_ahead = 10;
136 TokenStream(std::istream &s,
const std::string &delims =
",\n");
142 explicit operator bool()
const;
156 Token peek(
size_t i = 0);
164 return _tokens.front().pos;
170 Token recognize_tok(
char ch);
172 Token num_st(std::string value =
"");
174 Token float_after_dp_st(std::string value =
"");
176 Token text_st(std::string value =
"");
178 bool reached_end()
const;
180 bool is_delim(
char ch)
const;
183 std::istream &_istream;
184 std::deque<Token> _tokens;
194 std::pair<bool, MLGOHeuristics>
parse_mlgo(std::istream &in);
199 #endif //SRC_RUNTIME_CL_MLGO_MLGO_PARSER_H
bool operator==(const CharPosition &other) const
decltype(strategy::transforms) typedef type
std::string value
Token value.
Copyright (c) 2017-2022 Arm Limited.
TokenType type
Token type.
Token(TokenType t, std::string v, CharPosition pos)
std::pair< bool, MLGOHeuristics > parse_mlgo(std::istream &in)
Parse and construct a MLGOHeuristics from input stream.
MLGOHeuristics mlgo(TokenStream &in, bool &valid)
bool operator==(const Token &other) const
CharPosition current_pos() const
Get the position of the current token.