147 explicit Lexer(std::istream& input);
156 const std::vector<Token>&
tokens()
const;
const std::vector< Token > & tokens() const
Returns list of tokens (first use Lexer::tokenize())
bool isDotAlnum(signed char c)
Checks if character is allowed in an identifier by DOT standard.
bool match(const std::string &str, bool word=false)
Checks if head matches given string. Advances head on success.
std::vector< Token > m_tokens
Lexer(std::istream &input)
Initializes lexer with given input (but does nothing to it).
bool tokenize()
Scans input and turns it into token list.
bool identifier(Token &token)
Checks whether head is an identifier.
bool match(const Token::Type &type, bool word=false)
Checks if head matches given token. Advances head on success.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
Just a simple token struct representing a DOT file fragment.
static std::string toString(const Type &type)
Returns string representation of given token type.
Type type
The type of an field.
size_t column
Indicated a token column.
size_t row
Indicates a token row (line).
std::string * value
Identifier content (nullptr for non-id tokens).
Token(size_t tokenRow, size_t tokenColumn, std::string *identifierContent=nullptr)