ANTLR3C 3.1.2

antlr3input.h File Reference

Defines the basic structures used to manipulate character streams from any input source. More...

#include <antlr3defs.h>
#include <antlr3string.h>
#include <antlr3commontoken.h>
#include <antlr3intstream.h>
Include dependency graph for antlr3input.h:
This graph shows which files directly or indirectly include this file:

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
 Master context structure for an ANTLR3 C runtime based input stream.
typedef struct
ANTLR3_LEX_STATE_struct 
ANTLR3_LEX_STATE
 Structure for track lex input states as part of mark() and rewind() of lexer.

Functions

void antlr3AsciiSetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 type)
 Common function to setup function interface for an 8 bit ASCII input stream.
void antlr3GenericSetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 type)
void antlr3UCS2SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 type)
 Common function to setup function interface for a 16 bit "UCS2" input stream.

Detailed Description

Defines the basic structures used to manipulate character streams from any input source.

The first implementation of this stream was ASCII 8 bit, but any character size and encoding can in theory be used, so long as they can return a 32 bit Integer representation of their characters amd efficiently mark and revert to specific offsets into their input streams.


Typedef Documentation

Structure for track lex input states as part of mark() and rewind() of lexer.


Function Documentation

void antlr3AsciiSetupStream ( pANTLR3_INPUT_STREAM  input,
ANTLR3_UINT32  type 
)

Common function to setup function interface for an 8 bit ASCII input stream.

Parameters:
inputInput stream context pointer
Remarks:
  • Many of the 8 bit ASCII oriented file stream handling functions will be usable by any or at least some other input streams. Therefore it is perfectly acceptable to call this function to install the ASCII handler then override just those functions that would not work for the particular input encoding, such as consume for instance.

References antlr3GenericSetupStream(), antlr3StringFactoryNew(), and ANTLR3_INPUT_STREAM_struct::strFactory.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void antlr3GenericSetupStream ( pANTLR3_INPUT_STREAM  input,
ANTLR3_UINT32  type 
)

References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_INPUT_STREAM_struct::_LT, ANTLR3_CHARSTREAM, antlr3AsciiConsume(), antlr3AsciiGetCharPosition(), antlr3AsciiGetLine(), antlr3AsciiGetLineBuf(), antlr3AsciiGetSourceName(), antlr3AsciiIndex(), antlr3AsciiLA(), antlr3AsciiLT(), antlr3AsciiMark(), antlr3AsciiRelease(), antlr3AsciiRewind(), antlr3AsciiRewindLast(), antlr3AsciiSeek(), antlr3AsciiSetCharPosition(), antlr3AsciiSetLine(), antlr3AsciiSetNewLineChar(), antlr3AsciiSetUcaseLA(), antlr3AsciiSize(), antlr3AsciiSubstr(), 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_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 antlr3AsciiSetupStream(), and antlr3UCS2SetupStream().

Here is the call graph for this function:

Here is the caller graph for this function:

void antlr3UCS2SetupStream ( pANTLR3_INPUT_STREAM  input,
ANTLR3_UINT32  type 
)

Common function to setup function interface for a 16 bit "UCS2" input stream.

Parameters:
inputInput stream context pointer
Remarks:
  • Strictly speaking, there is no such thing as a UCS2 input stream as the term tends to confuse the notions of character encoding, unicode and so on. However because there will possibly be a need for a UTF-16 stream, I needed to identify 16 bit streams that do not support surrogate encodings and UCS2 is how it is mostly referred to. For instance Java, Oracle and others use a 16 bit encoding of characters and so this type of stream is very common. Take it to mean, therefore, a straight 16 bit uncomplicated encoding of Unicode code points.

References ANTLR3_INT_STREAM_struct::_LA, antlr3GenericSetupStream(), antlr3UCS2Consume(), antlr3UCS2Index(), antlr3UCS2LA(), antlr3UCS2Seek(), antlr3UCS2StringFactoryNew(), antlr3UCS2Substr(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INT_STREAM_struct::consume, 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 antlr3NewUCS2StringInPlaceStream().

Here is the call graph for this function:

Here is the caller graph for this function: