Lexical analysis tool.
More...
#include <ogdf/fileformats/DotLexer.h>
Lexical analysis tool.
This class reads the given input and generates a token list. Token list representation of DOT file is much easier for further processing (like parsing) as it automatically gets rid of comments and deals with various identifier representations in DOT format (C-like identifier, double-quoted strings, number literals).
- See also
- dot::Parser
Definition at line 96 of file DotLexer.h.
◆ Lexer()
| ogdf::dot::Lexer::Lexer |
( |
std::istream & |
input | ) |
|
|
explicit |
Initializes lexer with given input (but does nothing to it).
◆ ~Lexer()
| ogdf::dot::Lexer::~Lexer |
( |
| ) |
|
◆ identifier()
| bool ogdf::dot::Lexer::identifier |
( |
Token & |
token | ) |
|
|
private |
Checks whether head is an identifier.
- Parameters
-
| token | Function fills it with identifier value and col/row info. |
- Returns
- True if matches, false otherwise.
◆ match() [1/2]
| bool ogdf::dot::Lexer::match |
( |
const Token::Type & |
type | ) |
|
|
private |
Checks if head matches given token. Advances head on success.
- Parameters
-
| type | A type of token being matched. |
- Returns
- True if matches, false otherwise.
◆ match() [2/2]
| bool ogdf::dot::Lexer::match |
( |
const std::string & |
str | ) |
|
|
private |
Checks if head matches given string. Advances head on success.
- Parameters
-
| str | A string being matched. |
- Returns
- True if matches, false otherwise.
◆ tokenize()
| bool ogdf::dot::Lexer::tokenize |
( |
| ) |
|
Scans input and turns it into token list.
- Returns
- True if success, false otherwise.
◆ tokenizeLine()
| bool ogdf::dot::Lexer::tokenizeLine |
( |
| ) |
|
|
private |
◆ tokens()
| const std::vector<Token>& ogdf::dot::Lexer::tokens |
( |
| ) |
const |
◆ m_buffer
| std::string ogdf::dot::Lexer::m_buffer |
|
private |
◆ m_col
| size_t ogdf::dot::Lexer::m_col |
|
private |
◆ m_input
| std::istream& ogdf::dot::Lexer::m_input |
|
private |
◆ m_row
| size_t ogdf::dot::Lexer::m_row |
|
private |
◆ m_tokens
| std::vector<Token> ogdf::dot::Lexer::m_tokens |
|
private |
The documentation for this class was generated from the following file: