#include <CharStream.h>
Public Member Functions | |
void | setTabSize (int i) |
int | getTabSize (int i) |
virtual int | getColumn () |
virtual int | getLine () |
virtual int | getEndColumn () |
virtual int | getEndLine () |
virtual int | getBeginColumn () |
virtual int | getBeginLine () |
virtual bool | getTrackLineColumn () |
virtual void | setTrackLineColumn (bool val) |
virtual void | backup (int amount) |
virtual JAVACC_CHAR_TYPE | BeginToken () |
virtual JAVACC_CHAR_TYPE | readChar () |
virtual void | ExpandBuff (bool wrapAround) |
virtual void | FillBuff () |
virtual JAVACC_STRING_TYPE | GetImage () |
virtual JAVACC_STRING_TYPE | GetSuffix (int len) |
virtual void | DeleteBuffers () |
virtual | ~CharStream () |
bool | endOfInput () |
CharStream (const JAVACC_CHAR_TYPE *buf, int sz, int startline, int startcolumn, int buffersize) | |
CharStream (const JAVACC_CHAR_TYPE *buf, int sz, int startline, int startcolumn) | |
CharStream (const JAVACC_STRING_TYPE &str, int startline, int startcolumn, int buffersize) | |
CharStream (const JAVACC_STRING_TYPE &str, int startline, int startcolumn) | |
CharStream (ReaderStream *input_stream, int startline, int startcolumn, int buffersize) | |
CharStream (ReaderStream *input_stream, int startline, int startcolumn) | |
CharStream (ReaderStream *input_stream) | |
virtual void | ReInit (ReaderStream *input_stream, int startline, int startcolumn, int buffersize) |
virtual void | ReInit (ReaderStream *input_stream, int startline, int startcolumn) |
virtual void | ReInit (ReaderStream *input_stream) |
virtual void | ReInit (const JAVACC_STRING_TYPE &str, int startline, int startcolumn, int buffersize) |
virtual void | ReInit (const JAVACC_STRING_TYPE &str, int startline, int startcolumn) |
virtual void | adjustBeginLineColumn (int newLine, int newCol) |
Protected Member Functions | |
virtual void | UpdateLineColumn (JAVACC_CHAR_TYPE c) |
Protected Attributes | |
int * | bufline |
int * | bufcolumn |
JAVACC_CHAR_TYPE * | buffer |
int | bufpos |
int | bufsize |
int | tokenBegin |
int | column |
int | line |
bool | prevCharIsCR |
bool | prevCharIsLF |
int | available |
int | maxNextCharInd |
int | inBuf |
int | tabSize |
bool | trackLineColumn |
ReaderStream * | inputStream |
bool | deleteStream |
Private Member Functions | |
int | getBufcolumn (int pos) |
int | getBufline (int pos) |
This class describes a character stream that maintains line and column number positions of the characters. It also has the capability to backup the stream to some extent. An implementation of this class is used in the TokenManager implementation generated by JavaCCParser.
All the methods except backup can be implemented in any fashion. backup needs to be implemented correctly for the correct operation of the lexer. Rest of the methods are all used to get information like line number, column number and the string that constitutes a token and are not used by the lexer. Hence their implementation won't affect the generated lexer's operation.
Definition at line 30 of file CharStream.h.
|
inlinevirtual |
Definition at line 152 of file CharStream.h.
|
inline |
Definition at line 163 of file CharStream.h.
|
inline |
Definition at line 172 of file CharStream.h.
|
inline |
Definition at line 180 of file CharStream.h.
|
inline |
Definition at line 189 of file CharStream.h.
|
inline |
Definition at line 197 of file CharStream.h.
|
inline |
Definition at line 206 of file CharStream.h.
|
inline |
Definition at line 214 of file CharStream.h.
|
virtual |
Definition at line 73 of file CharStream.cc.
|
inlinevirtual |
Backs up the input stream by amount steps. Lexer calls this method if it had already read some characters, but could not use them to match a (longer) token. So, they will be used again as the prefix of the next token and it is the implemetation's responsibility to do this right.
Definition at line 66 of file CharStream.h.
|
inlinevirtual |
Returns the next character that marks the beginning of the next token. All characters must remain in the buffer between two successive calls to this method to implement backup correctly.
Definition at line 79 of file CharStream.h.
|
virtual |
The lexer calls this function to indicate that it is done with the stream and hence implementations can free any resources held by this class.
Definition at line 67 of file CharStream.cc.
|
inline |
Definition at line 159 of file CharStream.h.
|
virtual |
Definition at line 113 of file CharStream.cc.
|
virtual |
Definition at line 143 of file CharStream.cc.
|
inlinevirtual |
Definition at line 54 of file CharStream.h.
|
inlinevirtual |
Definition at line 55 of file CharStream.h.
|
inlineprivate |
Definition at line 35 of file CharStream.h.
|
inlineprivate |
Definition at line 42 of file CharStream.h.
|
inlinevirtual |
Definition at line 50 of file CharStream.h.
|
inlinevirtual |
Definition at line 52 of file CharStream.h.
|
inlinevirtual |
Definition at line 53 of file CharStream.h.
|
inlinevirtual |
Returns a string made up of characters from the marked token beginning to the current buffer position. Implementations can return anything that they want to. For example, for efficiency, one might decide to just return NULL, which is a valid implementation.
Definition at line 126 of file CharStream.h.
|
inlinevirtual |
Definition at line 51 of file CharStream.h.
|
inlinevirtual |
Returns an array of characters that make up the suffix of length 'len' for the currently matched token. This is used to build up the matched string for use in actions in the case of MORE. A simple and inefficient implementation of this is as follows :
Definition at line 139 of file CharStream.h.
|
inline |
Definition at line 33 of file CharStream.h.
|
inlinevirtual |
Definition at line 57 of file CharStream.h.
|
inlinevirtual |
Returns the next character from the selected input. The method of selecting the input is the responsibility of the class implementing this class.
Definition at line 92 of file CharStream.h.
|
virtual |
Definition at line 43 of file CharStream.cc.
|
inlinevirtual |
Definition at line 224 of file CharStream.h.
|
inlinevirtual |
Definition at line 228 of file CharStream.h.
|
virtual |
Definition at line 36 of file CharStream.cc.
|
inlinevirtual |
Definition at line 235 of file CharStream.h.
|
inline |
Definition at line 32 of file CharStream.h.
|
inlinevirtual |
Definition at line 58 of file CharStream.h.
|
protectedvirtual |
Definition at line 175 of file CharStream.cc.
|
protected |
Definition at line 255 of file CharStream.h.
|
protected |
Definition at line 246 of file CharStream.h.
|
protected |
Definition at line 247 of file CharStream.h.
|
protected |
Definition at line 245 of file CharStream.h.
|
protected |
Definition at line 248 of file CharStream.h.
|
protected |
Definition at line 249 of file CharStream.h.
|
protected |
Definition at line 251 of file CharStream.h.
|
protected |
Definition at line 261 of file CharStream.h.
|
protected |
Definition at line 257 of file CharStream.h.
|
protected |
Definition at line 260 of file CharStream.h.
|
protected |
Definition at line 252 of file CharStream.h.
|
protected |
Definition at line 256 of file CharStream.h.
|
protected |
Definition at line 253 of file CharStream.h.
|
protected |
Definition at line 254 of file CharStream.h.
|
protected |
Definition at line 258 of file CharStream.h.
|
protected |
Definition at line 250 of file CharStream.h.
|
protected |
Definition at line 259 of file CharStream.h.