Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::dot::Token Struct Reference

Just a simple token struct representing a DOT file fragment. More...

#include <ogdf/fileformats/DotLexer.h>

Public Types

enum class  Type {
  assignment , colon , semicolon , comma , edgeOpDirected , edgeOpUndirected , leftBracket , rightBracket , leftBrace , rightBrace , graph , digraph , subgraph , node ,
  edge , strict , identifier
}
 

Public Member Functions

 Token (size_t tokenRow, size_t tokenColumn, std::string *identifierContent=nullptr)
 

Static Public Member Functions

static std::string toString (const Type &type)
 Returns string representation of given token type.
 

Public Attributes

size_t column
 Indicated a token column.
 
size_t row
 Indicates a token row (line).
 
Type type
 The type of an field.
 
std::string * value
 Identifier content (nullptr for non-id tokens).
 

Detailed Description

Just a simple token struct representing a DOT file fragment.

Each token is represented by type: its either special string (a keyword or punctuation character) or identifier (which is normal string).

Additionaly, each token have its row and column fields indicating where it appeared. This information could be useful for displaying useful debug messages.

See also
dot::Lexer

Definition at line 54 of file DotLexer.h.

Member Enumeration Documentation

◆ Type

Enumerator
assignment 
colon 
semicolon 
comma 
edgeOpDirected 
edgeOpUndirected 
leftBracket 
rightBracket 
leftBrace 
rightBrace 
graph 
digraph 
subgraph 
node 
edge 
strict 
identifier 

Definition at line 55 of file DotLexer.h.

Constructor & Destructor Documentation

◆ Token()

ogdf::dot::Token::Token ( size_t  tokenRow,
size_t  tokenColumn,
std::string *  identifierContent = nullptr 
)

Member Function Documentation

◆ toString()

static std::string ogdf::dot::Token::toString ( const Type type)
static

Returns string representation of given token type.

Member Data Documentation

◆ column

size_t ogdf::dot::Token::column

Indicated a token column.

Definition at line 84 of file DotLexer.h.

◆ row

size_t ogdf::dot::Token::row

Indicates a token row (line).

Definition at line 82 of file DotLexer.h.

◆ type

Type ogdf::dot::Token::type

The type of an field.

Definition at line 80 of file DotLexer.h.

◆ value

std::string* ogdf::dot::Token::value

Identifier content (nullptr for non-id tokens).

Definition at line 86 of file DotLexer.h.


The documentation for this struct was generated from the following file: