ANTLR3_INT_STREAM_struct man page

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 antlr38BitLT(), antlr38BitSetUcaseLA(), antlr3CommonTokenDebugStreamSourceNew(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3dfapredict(), antlr3EBCDICSetupStream(), antlr3GenericSetupStream(), antlr3RecognitionExceptionNew(), antlr3UTF16Seek(), antlr3UTF16SetupStream(), antlr3UTF32Seek(), antlr3UTF32SetupStream(), antlr3UTF8SetupStream(), 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 fillBuffer(), size(), skipOffTokenChannels(), and tokLT().

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

Consume the next 'ANTR3_UINT32' in the stream.

Referenced by antlr38BitSeek(), antlr3CommonTokenDebugStreamSourceNew(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3dfapredict(), antlr3GenericSetupStream(), antlr3UTF16Seek(), antlr3UTF16SetupStream(), antlr3UTF32Seek(), antlr3UTF32SetupStream(), antlr3UTF8SetupStream(), 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(), antlr3UTF16SetupStream(), antlr3UTF32SetupStream(), consumeInitialHiddenTokens(), dbgConsume(), dbgMark(), getCharIndex(), mark(), memoize(), recover(), and tokLT().

ANTLR3_MARKER ANTLR3_INT_STREAM_struct::lastMarker

Last marker position allocated.

Referenced by antlr38BitMark(), antlr38BitRewindLast(), dbgMark(), dbgRewindLast(), mark(), reset(), and rewindLast().

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 antlr38BitRewind(), 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 antlr38BitRewindLast(), antlr3CommonTokenDebugStreamSourceNew(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3dfapredict(), antlr3GenericSetupStream(), dbgRewindLast(), rewindLast(), 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(), antlr3UTF16SetupStream(), antlr3UTF32SetupStream(), dbgRewindStream(), pop(), push(), rewindLast(), rewindMark(), rewindStream(), 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 antlr38BitGetSourceName(), antlr38BitReuse(), antlr3FileStreamNew(), and antlr3StringStreamNew().

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 _LA(), antlr38BitConsume(), antlr38BitIndex(), antlr38BitLA(), antlr38BitLA_ucase(), antlr38BitMark(), antlr38BitRelease(), antlr38BitRewind(), antlr38BitSeek(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3CTSFree(), antlr3EBCDICLA(), antlr3GenericSetupStream(), antlr3UTF16Consume(), antlr3UTF16ConsumeBE(), antlr3UTF16ConsumeLE(), antlr3UTF16Index(), antlr3UTF16LA(), antlr3UTF16LABE(), antlr3UTF16LALE(), antlr3UTF16Seek(), antlr3UTF32Consume(), antlr3UTF32Index(), antlr3UTF32LA(), antlr3UTF32LABE(), antlr3UTF32LALE(), antlr3UTF32Seek(), antlr3UTF8Consume(), antlr3UTF8LA(), consume(), consumeInitialHiddenTokens(), dbgConsume(), dbgLA(), dbgMark(), dbgRewindLast(), dbgRewindStream(), getCurrentInputSymbol(), getMissingSymbol(), getSourceName(), mark(), seek(), size(), and tindex().

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.

Referenced By

antlr3-cachedSize(3) and antlr3-lastMarker(3) are aliases of ANTLR3_INT_STREAM_struct(3).

Tue Oct 4 2016 Version 3.3.1 ANTLR3C