Any character size and encoding can in theory be used, so long as a set of functinos is provided that can return a 32 bit Integer representation of their characters amd efficiently mark and revert to specific offsets into their input streams.
#include <antlr3defs.h>
#include <antlr3string.h>
#include <antlr3commontoken.h>
#include <antlr3intstream.h>
#include <antlr3convertutf.h>
Data Structures | |
struct | ANTLR3_INPUT_STREAM_struct |
Master context structure for an ANTLR3 C runtime based input stream. More... | |
struct | ANTLR3_LEX_STATE_struct |
Structure for track lex input states as part of mark() and rewind() of lexer. More... | |
Typedefs | |
typedef struct ANTLR3_INPUT_STREAM_struct | ANTLR3_INPUT_STREAM |
typedef struct ANTLR3_LEX_STATE_struct | ANTLR3_LEX_STATE |
Functions | |
void | antlr38BitSetupStream (pANTLR3_INPUT_STREAM input) |
Common function to setup function interface for an 8 bit input stream. | |
void | antlr3EBCDICSetupStream (pANTLR3_INPUT_STREAM input) |
Common function to setup function interface for a EBCDIC input stream. | |
void | antlr3GenericSetupStream (pANTLR3_INPUT_STREAM input) |
void | antlr3UTF16SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian) |
Common function to setup function interface for a UTF16 or UCS2 input stream. | |
void | antlr3UTF32SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian) |
Common function to setup function interface for a UTF3 input stream. | |
void | antlr3UTF8SetupStream (pANTLR3_INPUT_STREAM input) |
Common function to setup function interface for a UTF8 input stream. |
typedef struct ANTLR3_LEX_STATE_struct ANTLR3_LEX_STATE |
void antlr38BitSetupStream | ( | pANTLR3_INPUT_STREAM | input | ) |
Common function to setup function interface for an 8 bit input stream.
input | Input stream context pointer |
References antlr3StringFactoryNew(), ANTLR3_INPUT_STREAM_struct::encoding, and ANTLR3_INPUT_STREAM_struct::strFactory.
Referenced by setupInputStream().
void antlr3EBCDICSetupStream | ( | pANTLR3_INPUT_STREAM | input | ) |
Common function to setup function interface for a EBCDIC input stream.
input | Input stream context pointer |
References ANTLR3_INT_STREAM_struct::_LA, antlr3EBCDICLA(), antlr3StringFactoryNew(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INPUT_STREAM_struct::encoding, ANTLR3_INPUT_STREAM_struct::istream, and ANTLR3_INPUT_STREAM_struct::strFactory.
Referenced by setupInputStream().
void antlr3GenericSetupStream | ( | pANTLR3_INPUT_STREAM | input | ) |
References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_INPUT_STREAM_struct::_LT, antlr38BitConsume(), antlr38BitGetCharPosition(), antlr38BitGetLine(), antlr38BitGetLineBuf(), antlr38BitGetSourceName(), antlr38BitIndex(), antlr38BitLA(), antlr38BitLT(), antlr38BitMark(), antlr38BitRelease(), antlr38BitReuse(), antlr38BitRewind(), antlr38BitRewindLast(), antlr38BitSeek(), antlr38BitSetCharPosition(), antlr38BitSetLine(), antlr38BitSetNewLineChar(), antlr38BitSetUcaseLA(), antlr38BitSize(), antlr38BitSubstr(), ANTLR3_CHARSTREAM, antlr3InputClose(), antlr3InputReset(), antlr3IntStreamNew(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INPUT_STREAM_struct::close, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::free, ANTLR3_INPUT_STREAM_struct::getCharPositionInLine, ANTLR3_INPUT_STREAM_struct::getLine, ANTLR3_INPUT_STREAM_struct::getLineBuf, ANTLR3_INT_STREAM_struct::getSourceName, ANTLR3_INT_STREAM_struct::index, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_INT_STREAM_struct::mark, ANTLR3_INPUT_STREAM_struct::markers, ANTLR3_INT_STREAM_struct::release, ANTLR3_INPUT_STREAM_struct::reset, ANTLR3_INPUT_STREAM_struct::reuse, ANTLR3_INT_STREAM_struct::rewind, ANTLR3_INT_STREAM_struct::rewindLast, ANTLR3_INT_STREAM_struct::seek, ANTLR3_INPUT_STREAM_struct::setCharPositionInLine, ANTLR3_INPUT_STREAM_struct::setLine, ANTLR3_INPUT_STREAM_struct::SetNewLineChar, ANTLR3_INPUT_STREAM_struct::setUcaseLA, ANTLR3_INPUT_STREAM_struct::size, ANTLR3_INPUT_STREAM_struct::substr, ANTLR3_INT_STREAM_struct::super, and ANTLR3_INT_STREAM_struct::type.
Referenced by antlr3CreateFileStream(), and antlr3CreateStringStream().
void antlr3UTF16SetupStream | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_BOOLEAN | machineBigEndian, | |||
ANTLR3_BOOLEAN | inputBigEndian | |||
) |
Common function to setup function interface for a UTF16 or UCS2 input stream.
input | Input stream context pointer |
References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_FALSE, ANTLR3_TRUE, antlr3StringFactoryNew(), antlr3UTF16Consume(), antlr3UTF16ConsumeBE(), antlr3UTF16ConsumeLE(), antlr3UTF16Index(), antlr3UTF16LA(), antlr3UTF16LABE(), antlr3UTF16LALE(), antlr3UTF16Seek(), antlr3UTF16Substr(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::encoding, ANTLR3_INT_STREAM_struct::index, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_INT_STREAM_struct::seek, ANTLR3_INPUT_STREAM_struct::strFactory, and ANTLR3_INPUT_STREAM_struct::substr.
Referenced by setupInputStream().
void antlr3UTF32SetupStream | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_BOOLEAN | machineBigEndian, | |||
ANTLR3_BOOLEAN | inputBigEndian | |||
) |
Common function to setup function interface for a UTF3 input stream.
input | Input stream context pointer |
References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_FALSE, ANTLR3_TRUE, antlr3StringFactoryNew(), antlr3UTF32Consume(), antlr3UTF32Index(), antlr3UTF32LA(), antlr3UTF32LABE(), antlr3UTF32LALE(), antlr3UTF32Seek(), antlr3UTF32Substr(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::encoding, ANTLR3_INT_STREAM_struct::index, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_INT_STREAM_struct::seek, ANTLR3_INPUT_STREAM_struct::strFactory, and ANTLR3_INPUT_STREAM_struct::substr.
Referenced by setupInputStream().
void antlr3UTF8SetupStream | ( | pANTLR3_INPUT_STREAM | input | ) |
Common function to setup function interface for a UTF8 input stream.
input | Input stream context pointer |
References ANTLR3_INT_STREAM_struct::_LA, antlr3StringFactoryNew(), antlr3UTF8Consume(), antlr3UTF8LA(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::encoding, ANTLR3_INPUT_STREAM_struct::istream, and ANTLR3_INPUT_STREAM_struct::strFactory.
Referenced by setupInputStream().