DynGenPar
Dynamic Generalized Parser
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
DynGenPar::TextByteTokenSource Class Reference
Inheritance diagram for DynGenPar::TextByteTokenSource:
Inheritance graph

Public Member Functions

 TextByteTokenSource ()
 
 TextByteTokenSource (const QString &fileName)
 
virtual ~TextByteTokenSource ()
 
virtual bool rewindTo (int pos, const LexerState &lexerState=LexerState())
 We can only rewind if we have a lexer state with the true position. More...
 
virtual LexerState saveState ()
 Saves the true stream position (including CRs) and the text position in lines and columns into a lexer state. More...
 
- Public Member Functions inherited from DynGenPar::ByteTokenSource
 ByteTokenSource ()
 
 ByteTokenSource (const QString &fileName)
 
virtual ~ByteTokenSource ()
 
void setInputStdin ()
 
void setInputFile (const QString &fileName)
 
void setInputBytes (const QByteArray &bytes)
 
void setInputString (const QString &string)
 
void setInputBuffer (QByteArray *buffer)
 
- Public Member Functions inherited from DynGenPar::TokenSource
 TokenSource ()
 
virtual ~TokenSource ()
 
Cat nextToken ()
 get the next token from the input, increment current position, save parse tree More...
 
Node parseTree ()
 get the parse tree for the last shifted token More...
 
virtual bool matchParseTree (const Node &treeToMatch)
 match the parse tree for the last shifted token against the given tree More...
 
int currentPosition ()
 get the current input position More...
 

Static Public Member Functions

static TextPosition textPosition (const LexerState &lexerState)
 Retrieves the text position (line and column) stored in the lexer state. More...
 

Protected Member Functions

virtual Cat readToken ()
 Overrides readToken to strip CRs. More...
 
virtual void reset ()
 
- Protected Member Functions inherited from DynGenPar::TokenSource
bool simpleRewind (int pos, bool rewindOnly=false)
 basic implementation of rewindTo for subclasses which support it More...
 

Additional Inherited Members

- Protected Attributes inherited from DynGenPar::ByteTokenSource
QIODevice * stream
 
- Protected Attributes inherited from DynGenPar::TokenSource
int currPos
 
Node tree
 sub-parse-tree for hierarchical parsing More...
 

Detailed Description

Definition at line 129 of file bytetokensource.h.

Constructor & Destructor Documentation

◆ TextByteTokenSource() [1/2]

DynGenPar::TextByteTokenSource::TextByteTokenSource ( )
inline

Definition at line 131 of file bytetokensource.h.

◆ TextByteTokenSource() [2/2]

DynGenPar::TextByteTokenSource::TextByteTokenSource ( const QString &  fileName)
inline

Definition at line 132 of file bytetokensource.h.

◆ ~TextByteTokenSource()

virtual DynGenPar::TextByteTokenSource::~TextByteTokenSource ( )
inlinevirtual

Definition at line 133 of file bytetokensource.h.

Member Function Documentation

◆ readToken()

virtual Cat DynGenPar::TextByteTokenSource::readToken ( )
inlineprotectedvirtual

Overrides readToken to strip CRs.

Reimplemented from DynGenPar::ByteTokenSource.

Definition at line 174 of file bytetokensource.h.

◆ reset()

virtual void DynGenPar::TextByteTokenSource::reset ( )
inlineprotectedvirtual

Reimplemented from DynGenPar::ByteTokenSource.

Definition at line 183 of file bytetokensource.h.

◆ rewindTo()

virtual bool DynGenPar::TextByteTokenSource::rewindTo ( int  pos,
const LexerState lexerState = LexerState() 
)
inlinevirtual

We can only rewind if we have a lexer state with the true position.

Reimplemented from DynGenPar::ByteTokenSource.

Definition at line 135 of file bytetokensource.h.

◆ saveState()

virtual LexerState DynGenPar::TextByteTokenSource::saveState ( )
inlinevirtual

Saves the true stream position (including CRs) and the text position in lines and columns into a lexer state.

Reimplemented from DynGenPar::TokenSource.

Definition at line 161 of file bytetokensource.h.

◆ textPosition()

static TextPosition DynGenPar::TextByteTokenSource::textPosition ( const LexerState lexerState)
inlinestatic

Retrieves the text position (line and column) stored in the lexer state.

Definition at line 167 of file bytetokensource.h.


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