DynGenPar
Dynamic Generalized Parser
|
Public Member Functions | |
ByteTokenSource () | |
ByteTokenSource (const QString &fileName) | |
virtual | ~ByteTokenSource () |
virtual bool | rewindTo (int pos, const LexerState &=LexerState()) |
rewind to an older position (requires buffering) More... | |
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... | |
bool | rewindTo (int pos, const Node &parseTree, const LexerState &lexerState=LexerState()) |
rewind to an older position (requires buffering) and restore the parse tree (needed for lookahead) More... | |
virtual LexerState | saveState () |
saves the current lexer state, by default a null LexerState More... | |
Protected Member Functions | |
virtual Cat | readToken () |
get the next token from the input, to be implemented by subclasses 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... | |
Protected Attributes | |
QIODevice * | stream |
Protected Attributes inherited from DynGenPar::TokenSource | |
int | currPos |
Node | tree |
sub-parse-tree for hierarchical parsing More... | |
Definition at line 44 of file bytetokensource.h.
|
inline |
Definition at line 46 of file bytetokensource.h.
|
inline |
Definition at line 49 of file bytetokensource.h.
|
inlinevirtual |
Definition at line 53 of file bytetokensource.h.
|
inlineprotectedvirtual |
get the next token from the input, to be implemented by subclasses
Implements DynGenPar::TokenSource.
Reimplemented in DynGenPar::TextByteTokenSource.
Definition at line 95 of file bytetokensource.h.
|
inlineprotectedvirtual |
Reimplemented in DynGenPar::TextByteTokenSource.
Definition at line 102 of file bytetokensource.h.
|
inlinevirtual |
rewind to an older position (requires buffering)
true
if successful, false
otherwisein all cases, destroys the saved parse tree
By default, only succeeds if the position is the current one, otherwise always returns false
. Can be overridden by subclasses.
Some subclasses (e.g., file-backed ones) can wind both forward and backward, some can only rewind, some cannot wind at all. The method will return false
if seeking to the new position is not possible.
Reimplemented from DynGenPar::TokenSource.
Reimplemented in DynGenPar::TextByteTokenSource.
Definition at line 54 of file bytetokensource.h.
|
inline |
Definition at line 88 of file bytetokensource.h.
|
inline |
Definition at line 78 of file bytetokensource.h.
|
inline |
Definition at line 72 of file bytetokensource.h.
|
inline |
Definition at line 66 of file bytetokensource.h.
|
inline |
Definition at line 85 of file bytetokensource.h.
|
protected |
Definition at line 101 of file bytetokensource.h.