Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::dot::Token Struct Reference

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

#include <ogdf/fileformats/DotLexer.h>

Public Types

enum  Type {
  Type::assignment, Type::colon, Type::semicolon, Type::comma, Type::edgeOpDirected, Type::edgeOpUndirected, Type::leftBracket, Type::rightBracket, Type::leftBrace, Type::rightBrace, Type::graph, Type::digraph, Type::subgraph, Type::node,
  Type::edge, Type::strict, Type::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. More...
 

Public Attributes

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

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 55 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 57 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 75 of file DotLexer.h.

◆ row

size_t ogdf::dot::Token::row

Indicates a token row (line).

Definition at line 73 of file DotLexer.h.

◆ type

Type ogdf::dot::Token::type

The type of an field.

Definition at line 71 of file DotLexer.h.

◆ value

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

Identifier content (nullptr for non-id tokens).

Definition at line 77 of file DotLexer.h.


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