ANTLR3_INT_STREAM_struct (3) - Linux Manuals

NAME

ANTLR3_INT_STREAM_struct -

SYNOPSIS


#include <antlr3intstream.h>

Data Fields


ANTLR3_UINT32(* _LA )(struct ANTLR3_INT_STREAM_struct *intStream, ANTLR3_INT32 i)
Get ANTLR3_UINT32 at current input pointer + i ahead where i=1 is next ANTLR3_UINT32.
ANTLR3_UINT32 cachedSize
Because the indirect call, though small in individual cases can mount up if there are thousands of tokens (very large input streams), callers of size can optionally use this cached size field.
void(* consume )(struct ANTLR3_INT_STREAM_struct *intStream)
Consume the next 'ANTR3_UINT32' in the stream.
void(* free )(struct ANTLR3_INT_STREAM_struct *stream)
Frees any resources that were allocated for the implementation of this interface.
pANTLR3_STRING(* getSourceName )(struct ANTLR3_INT_STREAM_struct *intStream)

ANTLR3_MARKER(* index )(struct ANTLR3_INT_STREAM_struct *intStream)
Return the current input symbol index 0..n where n indicates the last symbol has been read.
ANTLR3_MARKER lastMarker
Last marker position allocated.
ANTLR3_MARKER(* mark )(struct ANTLR3_INT_STREAM_struct *intStream)
Tell the stream to start buffering if it hasn't already.
void(* release )(struct ANTLR3_INT_STREAM_struct *intStream, ANTLR3_MARKER mark)
You may want to commit to a backtrack but don't want to force the stream to keep bookkeeping objects around for a marker that is no longer necessary.
void(* rewind )(struct ANTLR3_INT_STREAM_struct *intStream, ANTLR3_MARKER marker)
Reset the stream so that next call to index would return marker.
void(* rewindLast )(struct ANTLR3_INT_STREAM_struct *intStream)
Reset the stream to the last marker position, witouh destryoing the last marker position.
void(* seek )(struct ANTLR3_INT_STREAM_struct *intStream, ANTLR3_MARKER index)
Set the input cursor to the position indicated by index.
ANTLR3_UINT32(* size )(struct ANTLR3_INT_STREAM_struct *intStream)
Only makes sense for streams that buffer everything up probably, but might be useful to display the entire stream or for testing.
pANTLR3_STRING streamName
Potentially useful in error reporting and so on, this string is an identification of the input source.
void * super
Pointer to the super structure that contains this interface.
ANTLR3_UINT32 type
Input stream type indicator.

Field Documentation

ANTLR3_UINT32(* ANTLR3_INT_STREAM_struct::_LA)(struct ANTLR3_INT_STREAM_struct *intStream, ANTLR3_INT32 i)

Get ANTLR3_UINT32 at current input pointer + i ahead where i=1 is next ANTLR3_UINT32.

Referenced by antlr3AsciiLT(), antlr3AsciiSetUcaseLA(), antlr3CommonTokenDebugStreamSourceNew(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3dfapredict(), antlr3GenericSetupStream(), antlr3RecognitionExceptionNew(), antlr3UCS2SetupStream(), consumeUntil(), consumeUntilSet(), match(), matchc(), matchRange(), matchs(), mismatchIsMissingToken(), mismatchIsUnwantedToken(), nextTokenStr(), recoverFromMismatchedElement(), and setDebugListener().

ANTLR3_UINT32 ANTLR3_INT_STREAM_struct::cachedSize

Because the indirect call, though small in individual cases can mount up if there are thousands of tokens (very large input streams), callers of size can optionally use this cached size field.

Referenced by tokLT().

void(* ANTLR3_INT_STREAM_struct::consume)(struct ANTLR3_INT_STREAM_struct *intStream)

Consume the next 'ANTR3_UINT32' in the stream.

Referenced by antlr3AsciiSeek(), antlr3CommonTokenDebugStreamSourceNew(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3dfapredict(), antlr3GenericSetupStream(), antlr3UCS2Seek(), antlr3UCS2SetupStream(), consumeUntil(), consumeUntilSet(), match(), matchAny(), matchc(), matchRange(), matchs(), recover(), recoverFromMismatchedToken(), and setDebugListener().

void(* ANTLR3_INT_STREAM_struct::free)(struct ANTLR3_INT_STREAM_struct *stream)

Frees any resources that were allocated for the implementation of this interface. Usually this is just releasing the memory allocated for the structure itself, but it may of course do anything it need to so long as it does not stamp on anything else.

Referenced by antlr3CommonTreeNodeStreamFree(), antlr3CTSFree(), antlr3InputClose(), and antlr3IntStreamNew().

pANTLR3_STRING(* ANTLR3_INT_STREAM_struct::getSourceName)(struct ANTLR3_INT_STREAM_struct *intStream)

Referenced by antlr3CommonTokenStreamNew(), and antlr3GenericSetupStream().

ANTLR3_MARKER(* ANTLR3_INT_STREAM_struct::index)(struct ANTLR3_INT_STREAM_struct *intStream)

Return the current input symbol index 0..n where n indicates the last symbol has been read.

Referenced by alreadyParsedRule(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3GenericSetupStream(), antlr3RecognitionExceptionNew(), antlr3UCS2SetupStream(), consumeInitialHiddenTokens(), dbgConsume(), getCharIndex(), memoize(), nextTokenStr(), recover(), and tokLT().

ANTLR3_MARKER ANTLR3_INT_STREAM_struct::lastMarker

Last marker position allocated.

Referenced by antlr3AsciiMark(), antlr3AsciiRewindLast(), and reset().

ANTLR3_MARKER(* ANTLR3_INT_STREAM_struct::mark)(struct ANTLR3_INT_STREAM_struct *intStream)

Tell the stream to start buffering if it hasn't already. Return current input position, index(), or some other marker so that when passed to rewind() you get back to the same spot. rewind(mark()) should not affect the input cursor.

Referenced by antlr3CommonTokenDebugStreamSourceNew(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3dfapredict(), antlr3GenericSetupStream(), pushCharStream(), setDebugListener(), and synpred().

void(* ANTLR3_INT_STREAM_struct::release)(struct ANTLR3_INT_STREAM_struct *intStream, ANTLR3_MARKER mark)

You may want to commit to a backtrack but don't want to force the stream to keep bookkeeping objects around for a marker that is no longer necessary. This will have the same behavior as rewind() except it releases resources without the backward seek.

Referenced by antlr3AsciiRewind(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), and antlr3GenericSetupStream().

void(* ANTLR3_INT_STREAM_struct::rewind)(struct ANTLR3_INT_STREAM_struct *intStream, ANTLR3_MARKER marker)

Reset the stream so that next call to index would return marker. The marker will usually be index() but it doesn't have to be. It's just a marker to indicate what state the stream was in. This is essentially calling release() and seek(). If there are markers created after this marker argument, this routine must unroll them like a stack. Assume the state the stream was in when this marker was created.

Referenced by antlr3AsciiRewindLast(), antlr3CommonTokenDebugStreamSourceNew(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3dfapredict(), antlr3GenericSetupStream(), setDebugListener(), and synpred().

void(* ANTLR3_INT_STREAM_struct::rewindLast)(struct ANTLR3_INT_STREAM_struct *intStream)

Reset the stream to the last marker position, witouh destryoing the last marker position.

Referenced by antlr3CommonTokenDebugStreamSourceNew(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3GenericSetupStream(), popCharStream(), and setDebugListener().

void(* ANTLR3_INT_STREAM_struct::seek)(struct ANTLR3_INT_STREAM_struct *intStream, ANTLR3_MARKER index)

Set the input cursor to the position indicated by index. This is normally used to seek ahead in the input stream. No buffering is required to do this unless you know your stream will use seek to move backwards such as when backtracking.

This is different from rewind in its multi-directional requirement and in that its argument is strictly an input cursor (index).

For char streams, seeking forward must update the stream state such as line number. For seeking backwards, you will be presumably backtracking using the mark/rewind mechanism that restores state and so this method does not need to update state when seeking backwards.

Currently, this method is only used for efficient backtracking, but in the future it may be used for incremental parsing.

Referenced by alreadyParsedRule(), antlr3CommonTokenDebugStreamSourceNew(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3GenericSetupStream(), antlr3UCS2SetupStream(), reset(), and setDebugListener().

ANTLR3_UINT32(* ANTLR3_INT_STREAM_struct::size)(struct ANTLR3_INT_STREAM_struct *intStream)

Only makes sense for streams that buffer everything up probably, but might be useful to display the entire stream or for testing.

Referenced by antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), getTokensSet(), toString(), and toStringSS().

pANTLR3_STRING ANTLR3_INT_STREAM_struct::streamName

Potentially useful in error reporting and so on, this string is an identification of the input source. It may be NULL, so anything attempting to access it needs to check this and substitute a sensible default.

Referenced by antlr3AsciiFileStreamNew(), antlr3AsciiGetSourceName(), antlr3NewAsciiStringCopyStream(), antlr3NewAsciiStringInPlaceStream(), and antlr3NewUCS2StringInPlaceStream().

void* ANTLR3_INT_STREAM_struct::super

Pointer to the super structure that contains this interface. This will usually be a token stream or a tree stream.

Referenced by antlr3AsciiConsume(), antlr3AsciiIndex(), antlr3AsciiLA(), antlr3AsciiLA_ucase(), antlr3AsciiMark(), antlr3AsciiRelease(), antlr3AsciiRewind(), antlr3AsciiSeek(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3CTSFree(), antlr3GenericSetupStream(), antlr3UCS2Consume(), antlr3UCS2Index(), antlr3UCS2LA(), antlr3UCS2Seek(), consume(), consumeInitialHiddenTokens(), dbgConsume(), getCurrentInputSymbol(), and getMissingSymbol().

ANTLR3_UINT32 ANTLR3_INT_STREAM_struct::type

Input stream type indicator. Sometimes useful for error reporting etc.

Referenced by antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3GenericSetupStream(), and antlr3RecognitionExceptionNew().

Author

Generated automatically by Doxygen for ANTLR3C from the source code.