libutap  0.93
Uppaal Timed Automata Parser
UTAP::PositionTracker Class Reference

Help class used by the lexer, parser and xmlreader to keep track of the current position. More...

#include <libparser.h>

Static Public Member Functions

static void reset ()
 Resets position tracker to position 0. More...
 
static void setPath (ParserBuilder *builder, std::string s)
 Sets the current path to s, offset to 0 and line to 1. More...
 
static int increment (ParserBuilder *builder, int n)
 Sets the position of builder to [position, position + n) and increments position and offset by n. More...
 
static void newline (ParserBuilder *builder, int n)
 Increments line by n and adds the position to builder. More...
 

Static Public Attributes

static uint32_t line
 
static uint32_t offset
 
static uint32_t position = 0
 
static std::string path
 

Detailed Description

Help class used by the lexer, parser and xmlreader to keep track of the current position.

Definition at line 58 of file libparser.h.

Member Function Documentation

◆ increment()

int UTAP::PositionTracker::increment ( UTAP::ParserBuilder parser,
int  n 
)
static

Sets the position of builder to [position, position + n) and increments position and offset by n.

Definition at line 834 of file lexer.cc.

References UTAP::ParserBuilder::setPosition().

Referenced by UTAP::symbol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ newline()

void UTAP::PositionTracker::newline ( UTAP::ParserBuilder parser,
int  n 
)
static

Increments line by n and adds the position to builder.

Definition at line 841 of file lexer.cc.

References UTAP::ParserBuilder::addPosition().

Here is the call graph for this function:

◆ reset()

static void UTAP::PositionTracker::reset ( )
static

Resets position tracker to position 0.

◆ setPath()

void UTAP::PositionTracker::setPath ( UTAP::ParserBuilder parser,
std::string  s 
)
static

Sets the current path to s, offset to 0 and line to 1.

Sets the position of builder to [position, position + 1) (a one character dummy position; this is useful when assigning error messages to XML elements without a text content). Adds position to builder and increments it by 1.

Definition at line 819 of file lexer.cc.

References UTAP::ParserBuilder::addPosition().

Referenced by UTAP::symbol().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ line

uint32_t PositionTracker::line
static

Definition at line 61 of file libparser.h.

◆ offset

uint32_t PositionTracker::offset
static

Definition at line 62 of file libparser.h.

◆ path

std::string PositionTracker::path
static

Definition at line 64 of file libparser.h.

◆ position

uint32_t PositionTracker::position = 0
static

Definition at line 63 of file libparser.h.


The documentation for this class was generated from the following files: