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

A container for information about lines and positions in the input file. More...

#include <position.h>

Classes

struct  line_t
 

Public Member Functions

void add (uint32_t position, uint32_t offset, uint32_t line, const std::string &path)
 Add information about a line to the container. More...
 
const line_tfind (uint32_t position) const
 Retrieves information about the line containing the given position. More...
 
void dump ()
 Dump table to stdout. More...
 

Detailed Description

A container for information about lines and positions in the input file.

Elements in the container contain information about the position in the input file of the first character of a line and the XPath to the XML element containing the line. In general, the line number refers to the line inside the XML element and is not a global numbering of the lines in the input file. Also the offset of the first character relative to the beginning of the XML element is stored.

If the input file is not an XML document, the path element of a line is the empty string, the offset equals the position, and the line numbers refer to the line number in the input file. In essence, the whole input file is treated as if it were a single XML element.

Definition at line 61 of file position.h.

Member Function Documentation

◆ add()

void Positions::add ( uint32_t  position,
uint32_t  offset,
uint32_t  line,
const std::string &  path 
)

Add information about a line to the container.

Definition at line 30 of file position.cpp.

Referenced by UTAP::TimedAutomataSystem::addPosition().

Here is the caller graph for this function:

◆ dump()

void Positions::dump ( )

Dump table to stdout.

Definition at line 67 of file position.cpp.

◆ find()

const Positions::line_t & Positions::find ( uint32_t  position) const

Retrieves information about the line containing the given position.

The last line in the container is considered to extend to inifinity (until another line is added).

Definition at line 57 of file position.cpp.


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