Doxygen
|
This class describes a character stream that maintains line and column number positions of the characters. 更多...
#include <CharStream.h>
Public 成员函数 | |
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) |
Backs up the input stream by amount steps. 更多... | |
virtual JJChar | BeginToken () |
Returns the next character that marks the beginning of the next token. 更多... | |
virtual JJChar | readChar () |
Returns the next character from the selected input. 更多... | |
virtual void | ExpandBuff (bool wrapAround) |
virtual void | FillBuff () |
virtual JJString | GetImage () |
Returns a string made up of characters from the marked token beginning to the current buffer position. 更多... | |
virtual JJString | GetSuffix (int len) |
Returns an array of characters that make up the suffix of length 'len' for the currently matched token. 更多... | |
virtual void | DeleteBuffers () |
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. 更多... | |
virtual | ~CharStream () |
bool | endOfInput () |
CharStream (const JJChar *buf, int sz, int startline, int startcolumn, int buffersize) | |
CharStream (const JJChar *buf, int sz, int startline, int startcolumn) | |
CharStream (const JJString &str, int startline, int startcolumn, int buffersize) | |
CharStream (const JJString &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 JJString &str, int startline, int startcolumn, int buffersize) |
virtual void | ReInit (const JJString &str, int startline, int startcolumn) |
virtual void | adjustBeginLineColumn (int newLine, int newCol) |
Protected 成员函数 | |
virtual void | UpdateLineColumn (JJChar c) |
Protected 属性 | |
int * | bufline |
int * | bufcolumn |
JJChar * | 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 成员函数 | |
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.
在文件 CharStream.h 第 31 行定义.
|
inlinevirtual |
在文件 CharStream.h 第 155 行定义.
引用了 DeleteBuffers(), deleteStream , 以及 inputStream.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
|
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.
在文件 CharStream.h 第 69 行定义.
|
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.
在文件 CharStream.h 第 82 行定义.
引用了 bufpos, readChar() , 以及 tokenBegin.
|
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.
被这些函数引用 ~CharStream().
|
inline |
在文件 CharStream.h 第 162 行定义.
引用了 bufpos, ReaderStream::endOfInput(), inBuf, inputStream , 以及 maxNextCharInd.
|
virtual |
|
virtual |
被这些函数引用 readChar().
|
inlinevirtual |
|
inlinevirtual |
|
inlineprivate |
在文件 CharStream.h 第 37 行定义.
引用了 bufcolumn , 以及 trackLineColumn.
被这些函数引用 getBeginColumn(), getColumn() , 以及 getEndColumn().
|
inlineprivate |
在文件 CharStream.h 第 44 行定义.
引用了 bufline , 以及 trackLineColumn.
被这些函数引用 getBeginLine(), getEndLine() , 以及 getLine().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
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.
在文件 CharStream.h 第 129 行定义.
引用了 buffer, bufpos, bufsize , 以及 tokenBegin.
|
inlinevirtual |
|
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 :
在文件 CharStream.h 第 142 行定义.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Returns the next character from the selected input.
The method of selecting the input is the responsibility of the class implementing this class.
在文件 CharStream.h 第 95 行定义.
引用了 buffer, bufpos, bufsize, FillBuff(), inBuf, maxNextCharInd, trackLineColumn , 以及 UpdateLineColumn().
被这些函数引用 BeginToken().
|
inlinevirtual |
在文件 CharStream.h 第 238 行定义.
引用了 INITIAL_BUFFER_SIZE , 以及 ReInit().
|
virtual |
|
inlinevirtual |
在文件 CharStream.h 第 231 行定义.
引用了 INITIAL_BUFFER_SIZE , 以及 ReInit().
|
inlinevirtual |
在文件 CharStream.h 第 227 行定义.
引用了 INITIAL_BUFFER_SIZE , 以及 ReInit().
|
virtual |
被这些函数引用 CharStream() , 以及 ReInit().
|
inline |
|
inlinevirtual |
|
protectedvirtual |
被这些函数引用 readChar().
|
protected |
在文件 CharStream.h 第 258 行定义.
|
protected |
在文件 CharStream.h 第 249 行定义.
被这些函数引用 getBufcolumn().
|
protected |
在文件 CharStream.h 第 250 行定义.
被这些函数引用 GetImage(), GetSuffix() , 以及 readChar().
|
protected |
在文件 CharStream.h 第 248 行定义.
被这些函数引用 getBufline().
|
protected |
在文件 CharStream.h 第 251 行定义.
被这些函数引用 backup(), BeginToken(), endOfInput(), getColumn(), getEndColumn(), getEndLine(), GetImage(), getLine(), GetSuffix() , 以及 readChar().
|
protected |
在文件 CharStream.h 第 252 行定义.
被这些函数引用 backup(), GetImage(), GetSuffix() , 以及 readChar().
|
protected |
在文件 CharStream.h 第 254 行定义.
|
protected |
在文件 CharStream.h 第 264 行定义.
被这些函数引用 ~CharStream().
|
protected |
在文件 CharStream.h 第 260 行定义.
被这些函数引用 backup(), endOfInput() , 以及 readChar().
|
protected |
在文件 CharStream.h 第 263 行定义.
被这些函数引用 endOfInput() , 以及 ~CharStream().
|
protected |
在文件 CharStream.h 第 255 行定义.
|
protected |
在文件 CharStream.h 第 259 行定义.
被这些函数引用 endOfInput() , 以及 readChar().
|
protected |
在文件 CharStream.h 第 256 行定义.
|
protected |
在文件 CharStream.h 第 257 行定义.
|
protected |
在文件 CharStream.h 第 261 行定义.
被这些函数引用 getTabSize() , 以及 setTabSize().
|
protected |
在文件 CharStream.h 第 253 行定义.
被这些函数引用 BeginToken(), getBeginColumn(), getBeginLine() , 以及 GetImage().
|
protected |
在文件 CharStream.h 第 262 行定义.
被这些函数引用 getBufcolumn(), getBufline(), getTrackLineColumn(), readChar() , 以及 setTrackLineColumn().