5#ifndef BOTANIST_TOKENIZER_H
6#define BOTANIST_TOKENIZER_H
13#include <collection2/list.hpp>
23 collection2::List<Token>& tokenList;
26 bool isLastTokenizationSucceeded =
false;
44 bool tryParse(
char const* str,
Token::Kind& kind,
size_t& length)
const;
55 size_t tryParseAsNumber(
char const* str)
const;
66 size_t tryParseAsOperator(
char const* str)
const;
76 size_t tryParseAsBracket(
char const* str)
const;
79 explicit Tokenizer(collection2::List<Token>& tokenList) : tokenList(tokenList){};
数式を項や演算子、括弧など意味のある単位に分割する
Definition: tokenizer.hpp:20
size_t tokenize(const char *formula)
与えられた数式を、数値や演算子、括弧等のトークンに分割する
void dumpTokenList(bool colorlized=true) const
トークンリストのダンプ
Kind
トークンの種類
Definition: token.hpp:16