src/antlr3inputstream.c(3)

πŸ“¦ version 3.4, in fedora 43

🌸 src/antlr3inputstream.c β€” the ANTLR3C bestie cut 🌸

okay so hi bestie πŸ’– this is the manual page for src/antlr3inputstream.c out of the ANTLR3C docs, and it is literally the origin story for every input stream you're ever gonna touch in this library. It's giving ✨infrastructure✨, it's giving 🌈foundation🌈, and yes, it is long, so buckle up and hydrate. 🧚


✨ NAME ✨

src/antlr3inputstream.c β€” base functions to initialize and manipulate any input stream. 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <antlr3input.h>

πŸ‘‘ Functions πŸ‘‘

  • static void antlr38BitConsume (pANTLR3_INT_STREAM is) β€” consume the next character in an 8 bit input stream πŸ“
  • static ANTLR3_UINT32 antlr38BitGetCharPosition (pANTLR3_INPUT_STREAM input) β€” return the current offset in to the current line in the input stream
  • static ANTLR3_UINT32 antlr38BitGetLine (pANTLR3_INPUT_STREAM input) β€” return the line number as understood by the 8 bit input stream
  • static void * antlr38BitGetLineBuf (pANTLR3_INPUT_STREAM input) β€” return a pointer into the input stream that points at the start of the current input line as triggered by the end of line character installed for the stream ('
  • static pANTLR3_STRING antlr38BitGetSourceName (pANTLR3_INT_STREAM is)
  • static ANTLR3_MARKER antlr38BitIndex (pANTLR3_INT_STREAM is) β€” calculate the current index in the output stream
  • static ANTLR3_UCHAR antlr38BitLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) β€” return the input element assuming an 8 bit ascii input
  • static ANTLR3_UCHAR antlr38BitLA_ucase (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) β€” return the input element assuming an 8 bit input and always return the UPPER CASE character πŸ‘‘
  • static void * antlr38BitLT (pANTLR3_INPUT_STREAM input, ANTLR3_INT32 lt) β€” return the input element assuming an 8 bit ascii input
  • static ANTLR3_MARKER antlr38BitMark (pANTLR3_INT_STREAM is) β€” mark the current input point in an 8Bit 8 bit stream such as a file stream, where all the input is available in the buffer
  • static void antlr38BitRelease (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) β€” rewind the lexer input to the state specified by the supplied mark
  • static void antlr38BitReuse (pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name) β€” install a new source code in to a working input stream so that the input stream can be reused ♻️
  • static void antlr38BitRewind (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) β€” rewind the lexer input to the state specified by the supplied mark
  • static void antlr38BitRewindLast (pANTLR3_INT_STREAM is) β€” rewind the lexer input to the state specified by the last produced mark
  • static void antlr38BitSeek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) β€” rewind the lexer input to the state specified by the supplied mark
  • static void antlr38BitSetCharPosition (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 position) β€” set the current offset in the current line to be a particular setting
  • static void antlr38BitSetLine (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 line) β€” set the current line number as understood by the input stream
  • static void antlr38BitSetNewLineChar (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 newlineChar) β€” set the newline trigger character in the input stream to the supplied parameter
  • static void antlr38BitSetUcaseLA (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN flag)
  • void antlr38BitSetupStream (pANTLR3_INPUT_STREAM input) β€” common function to setup function interface for an 8 bit input stream
  • static ANTLR3_UINT32 antlr38BitSize (pANTLR3_INPUT_STREAM input) β€” return the size of the current input stream, as an 8Bit file which in this case is the total input
  • static pANTLR3_STRING antlr38BitSubstr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) β€” return a substring of the 8 bit input stream in newly allocated memory
  • static ANTLR3_UCHAR antlr3EBCDICLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) β€” return the input element assuming an 8 bit EBCDIC input
  • void antlr3EBCDICSetupStream (pANTLR3_INPUT_STREAM input) β€” common function to setup function interface for a EBCDIC input stream
  • void antlr3GenericSetupStream (pANTLR3_INPUT_STREAM input)
  • static void antlr3InputClose (pANTLR3_INPUT_STREAM input) β€” close down an input stream and free any memory allocated by it 🫧
  • static void antlr3InputReset (pANTLR3_INPUT_STREAM input) β€” reset a re-startable input stream to the start
  • static void antlr3UTF16Consume (pANTLR3_INT_STREAM is) β€” consume the next character in a UTF16 input stream
  • static void antlr3UTF16ConsumeBE (pANTLR3_INT_STREAM is) β€” consume the next character in a UTF16 input stream when the input is Big Endian and the machine is not
  • static void antlr3UTF16ConsumeLE (pANTLR3_INT_STREAM is) β€” consume the next character in a UTF16 input stream when the input is Little Endian and the machine is not Note that the UTF16 routines do not do any substantial verification of the input stream as for performance sake, we assume it is validly encoded
  • static ANTLR3_MARKER antlr3UTF16Index (pANTLR3_INT_STREAM is) β€” calculate the current index in the output stream
  • static ANTLR3_UCHAR antlr3UTF16LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) β€” return the input element assuming an 8 bit ascii input
  • static ANTLR3_UCHAR antlr3UTF16LABE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) β€” return the input element assuming a UTF16 input when the input is Little Endian and the machine is not
  • static ANTLR3_UCHAR antlr3UTF16LALE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) β€” return the input element assuming a UTF16 input when the input is Little Endian and the machine is not
  • static void antlr3UTF16Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) β€” rewind the lexer input to the state specified by the supplied mark
  • 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
  • static pANTLR3_STRING antlr3UTF16Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) β€” return a substring of the UTF16 input stream in newly allocated memory
  • static void antlr3UTF32Consume (pANTLR3_INT_STREAM is) β€” consume the next character in a UTF32 input stream
  • static ANTLR3_MARKER antlr3UTF32Index (pANTLR3_INT_STREAM is) β€” calculate the current index in the output stream
  • static ANTLR3_UCHAR antlr3UTF32LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) β€” return the input element assuming a UTF32 input in natural machine byte order
  • static ANTLR3_UCHAR antlr3UTF32LABE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) β€” return the input element assuming a UTF32 input in big endian byte order
  • static ANTLR3_UCHAR antlr3UTF32LALE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) β€” return the input element assuming a UTF32 input in little endian byte order
  • static void antlr3UTF32Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) β€” rewind the lexer input to the state specified by the supplied mark
  • void antlr3UTF32SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian) β€” common function to setup function interface for a UTF3 input stream
  • static pANTLR3_STRING antlr3UTF32Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) β€” return a substring of the UTF16 input stream in newly allocated memory
  • static void antlr3UTF8Consume (pANTLR3_INT_STREAM is) β€” consume the next character in a UTF8 input stream
  • static ANTLR3_UCHAR antlr3UTF8LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) β€” return the input element assuming a UTF8 input
  • void antlr3UTF8SetupStream (pANTLR3_INPUT_STREAM input) β€” common function to setup function interface for a UTF8 input stream

πŸ“ Variables πŸ“

  • const ANTLR3_UCHAR e2a [256]
  • static const UTF32 offsetsFromUTF8 [6] β€” magic values subtracted from a buffer value during UTF8 conversion ✨
  • static const ANTLR3_UINT32 trailingBytesForUTF8 [256] β€” index into the table below with the first byte of a UTF-8 sequence to get the number of trailing bytes that are supposed to follow it

πŸ’œ Detailed Description πŸ’œ

Base functions to initialize and manipulate any input stream.

like, that's the whole point of this file, bestie β€” it's the base-layer glow-up that every input stream gets handed. 🫢


πŸ”₯ Function Documentation πŸ”₯

🫢 void antlr38BitConsume (pANTLR3_INT_STREAM is) [static]

Consume the next character in an 8 bit input stream. πŸ“

Parameters

  • input β€” input stream context pointer

References ANTLR3_INPUT_STREAM_struct::charPositionInLine, ANTLR3_INPUT_STREAM_struct::currentLine, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::line, ANTLR3_INPUT_STREAM_struct::newlineChar, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3GenericSetupStream().


🫢 ANTLR3_UINT32 antlr38BitGetCharPosition (pANTLR3_INPUT_STREAM input) [static]

Return the current offset in to the current line in the input stream.

Parameters

  • input β€” input stream context pointer

Returns

  • Current line offset

References ANTLR3_INPUT_STREAM_struct::charPositionInLine.

Referenced by antlr3GenericSetupStream().


🫢 ANTLR3_UINT32 antlr38BitGetLine (pANTLR3_INPUT_STREAM input) [static]

Return the line number as understood by the 8 bit input stream.

Parameters

  • input β€” input stream context pointer

Returns

  • Line number in input stream that we believe we are working on.

References ANTLR3_INPUT_STREAM_struct::line.

Referenced by antlr3GenericSetupStream().


🫢 void * antlr38BitGetLineBuf (pANTLR3_INPUT_STREAM input) [static]

Return a pointer into the input stream that points at the start of the current input line as triggered by the end of line character installed for the stream ('

Parameters

  • input

References ANTLR3_INPUT_STREAM_struct::currentLine.

Referenced by antlr3GenericSetupStream().

bestie that description literally ends with (' and we are NOT fixing it, we are preserving it, periodt πŸ’…

🫢 pANTLR3_STRING antlr38BitGetSourceName (pANTLR3_INT_STREAM is) [static]

References ANTLR3_INT_STREAM_struct::streamName.

Referenced by antlr3GenericSetupStream().


🫢 ANTLR3_MARKER antlr38BitIndex (pANTLR3_INT_STREAM is) [static]

Calculate the current index in the output stream.

Parameters

  • input β€” input stream context pointer

References ANTLR3_INPUT_STREAM_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3GenericSetupStream().


🫢 ANTLR3_UCHAR antlr38BitLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) [static]

Return the input element assuming an 8 bit ascii input.

Parameters

  • input β€” input stream context pointer
  • la β€” 1 based offset of next input stream element

Returns

  • Next input character in internal ANTLR3 encoding (UTF32)

πŸ”— Its little friendship circle: ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, and ANTLR3_INT_STREAM_struct::super.

πŸ‘€ And it gets summoned by antlr38BitSetUcaseLA(), and antlr3GenericSetupStream().


🌸 antlr38BitLA_ucase β€” the LOUD version of LA, no cap

ANTLR3_UCHAR antlr38BitLA_ucase (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) [static]

Bestie, this one hands you the input element assuming an 8 bit input, and it always returns the UPPER CASE character. Heads up though: this is 8 bit only, so we're trusting that the toupper function will use the correct locale for 8 bits. That's the whole deal. πŸ’…

Parameters

  • input β€” Input stream context pointer
  • la β€” 1 based offset of next input stream element

Returns

Next input character in internal ANTLR3 encoding (UTF32)

References

ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, and ANTLR3_INT_STREAM_struct::super.

Referenced by

antlr38BitSetUcaseLA().


✨ antlr38BitLT β€” peek, but make it ascii

void * antlr38BitLT (pANTLR3_INPUT_STREAM input, ANTLR3_INT32 lt) [static]

Return the input element assuming an 8 bit ascii input. Simple as that, girlypop. πŸ¦‹

Parameters

  • input β€” Input stream context pointer
  • lt β€” 1 based offset of next input stream element

Returns

Next input character in internal ANTLR3 encoding (UTF32)

References

ANTLR3_INT_STREAM_struct::_LA, ANTLR3_FUNC_PTR, and ANTLR3_INPUT_STREAM_struct::istream.

Referenced by

antlr3GenericSetupStream().


πŸŽ€ antlr38BitMark β€” drop a pin πŸ“

ANTLR3_MARKER antlr38BitMark (pANTLR3_INT_STREAM is) [static]

Mark the current input point in an 8Bit 8 bit stream such as a file stream, where all the input is available in the buffer. Like bookmarking a spot in a fic you're absolutely devouring. πŸ”₯

Parameters

  • is β€” Input stream context pointer

References

ANTLR3_VECTOR_struct::add, ANTLR3_INPUT_STREAM_struct::charPositionInLine, ANTLR3_LEX_STATE_struct::charPositionInLine, ANTLR3_VECTOR_struct::count, ANTLR3_INPUT_STREAM_struct::currentLine, ANTLR3_LEX_STATE_struct::currentLine, ANTLR3_VECTOR_struct::get, ANTLR3_INT_STREAM_struct::lastMarker, ANTLR3_INPUT_STREAM_struct::line, ANTLR3_LEX_STATE_struct::line, ANTLR3_INPUT_STREAM_struct::markDepth, ANTLR3_INPUT_STREAM_struct::markers, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_LEX_STATE_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.

Referenced by

antlr3GenericSetupStream().


πŸ’œ antlr38BitRelease β€” let that mark go, bestie

void antlr38BitRelease (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) [static]

Rewind the lexer input to the state specified by the supplied mark.

Parameters

  • input β€” Input stream context pointer

Remarks

Assumes 8 Bit input stream.

References

mark(), ANTLR3_INPUT_STREAM_struct::markDepth, and ANTLR3_INT_STREAM_struct::super.

Referenced by

antlr3GenericSetupStream().


🌈 antlr38BitReuse β€” glow-up for your stream

void antlr38BitReuse (pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name) [static]

Install a new source code in to a working input stream so that the input stream can be reused. It's giving recycling, it's giving sustainable queen. πŸ‘‘

References

ANTLR3_FALSE, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::fileName, ANTLR3_INPUT_STREAM_struct::isAllocated, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_STRING_FACTORY_struct::newStr, ANTLR3_INPUT_STREAM_struct::reset, ANTLR3_STRING_struct::set, size(), ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::streamName, and ANTLR3_INPUT_STREAM_struct::strFactory.

Referenced by

antlr3GenericSetupStream().


🫢 antlr38BitRewind β€” take it back to the mark

void antlr38BitRewind (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) [static]

Rewind the lexer input to the state specified by the supplied mark.

Parameters

  • input β€” Input stream context pointer

Remarks

Assumes 8 Bit input stream.

References

antlr38BitSeek(), ANTLR3_INPUT_STREAM_struct::charPositionInLine, ANTLR3_LEX_STATE_struct::charPositionInLine, ANTLR3_INPUT_STREAM_struct::currentLine, ANTLR3_LEX_STATE_struct::currentLine, ANTLR3_VECTOR_struct::get, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_INPUT_STREAM_struct::line, ANTLR3_LEX_STATE_struct::line, mark(), ANTLR3_INPUT_STREAM_struct::markers, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_LEX_STATE_struct::nextChar, ANTLR3_INT_STREAM_struct::release, and ANTLR3_INT_STREAM_struct::super.

Referenced by

antlr3GenericSetupStream().


πŸ“ antlr38BitRewindLast β€” back to the last pin

void antlr38BitRewindLast (pANTLR3_INT_STREAM is) [static]

Rewind the lexer input to the state specified by the last produced mark.

Parameters

  • input β€” Input stream context pointer

Remarks

Assumes 8 Bit input stream.

References

ANTLR3_INT_STREAM_struct::lastMarker, and ANTLR3_INT_STREAM_struct::rewind.

Referenced by

antlr3GenericSetupStream().


🧚 antlr38BitSeek β€” jump to the seekPoint, periodt

void antlr38BitSeek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) [static]

Rewind the lexer input to the state specified by the supplied mark.

Parameters

  • input β€” Input stream context pointer

Remarks

Assumes 8 Bit input stream.

References

ANTLR3_FUNC_PTR, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.

Referenced by

antlr38BitRewind(), and antlr3GenericSetupStream().


⭐ antlr38BitSetCharPosition β€” set the vibe of your column

void antlr38BitSetCharPosition (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 position) [static]

Set the current offset in the current line to be a particular setting.

Parameters

  • input β€” Input stream context pointer
  • position β€” New setting for current offset.

Remarks

This does not set the actual pointers in the input stream, it is purely for reporting purposes and so on as per antlr38BitSetLine(). So like, it's cosmetic, it's for the ~aesthetic~ of your error messages. πŸ’…

References

ANTLR3_INPUT_STREAM_struct::charPositionInLine.

Referenced by

antlr3GenericSetupStream().


πŸ‘‘ antlr38BitSetLine β€” tell the stream what line it's on

void antlr38BitSetLine (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 line) [static]

Set the current line number as understood by the input stream.

Parameters

  • input β€” Input stream context pointer
  • line β€” Line number to tell the input stream we are on

Remarks

This function does not change any pointers, it just allows the programmer to set the line number according to some external criterion, such as finding a lexed directive like: #nnn "file.c" for instance, such that error reporting and so on in is in sync with some original source format. Basically: gaslight your input stream into thinking it's somewhere else, but for a good reason. πŸ™ˆ

References

ANTLR3_INPUT_STREAM_struct::line.

Referenced by

antlr3GenericSetupStream().


πŸ’– antlr38BitSetNewLineChar β€” pick your newline trigger

void antlr38BitSetNewLineChar (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 newlineChar) [static]

Set the newline trigger character in the input stream to the supplied parameter.

Parameters

  • input β€” Input stream context pointer
  • newlineChar β€” Character to set to be the newline trigger.

Remarks

  • The supplied newLineChar is in UTF32 encoding (which means ASCII and latin1 etc are the same encodings), but the input stream catered to by this function is 8 bit only, so it is up to the programmer to ensure that the character supplied is valid. No pressure bestie, but like... check it. 😭

References

ANTLR3_INPUT_STREAM_struct::newlineChar.

Referenced by

antlr3GenericSetupStream().


πŸ’€ antlr38BitSetUcaseLA β€” flip the ucase switch

void antlr38BitSetUcaseLA (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN flag) [static]

References

ANTLR3_INT_STREAM_struct::_LA, antlr38BitLA(), antlr38BitLA_ucase(), and ANTLR3_INPUT_STREAM_struct::istream.

Referenced by

antlr3GenericSetupStream().


πŸ”₯ antlr38BitSetupStream β€” the main character assembles the squad

void antlr38BitSetupStream (pANTLR3_INPUT_STREAM input)

Common function to setup function interface for an 8 bit input stream. This is the one that hooks everything up. ✨

Parameters

  • input β€” Input stream context pointer

Remarks

  • Many of the 8 bit 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 8Bit handler then override just those functions that would not work for the particular input encoding, such as consume for instance. So like β€” steal the whole fit, then swap out the pieces that don't fit your body. Slay. πŸ’…

References

antlr3StringFactoryNew(), ANTLR3_INPUT_STREAM_struct::encoding, and ANTLR3_INPUT_STREAM_struct::strFactory.

Referenced by

setupInputStream().


πŸŽ€ antlr38BitSize β€” how big is this thing

ANTLR3_UINT32 antlr38BitSize (pANTLR3_INPUT_STREAM input) [static]

Return the size of the current input stream, as an 8Bit file which in this case is the total input. Other implementations may provide more sophisticated implementations to deal with non-recoverable streams and so on. This one keeps it simple, and honestly? Iconic of it.

Parameters

  • input β€” Input stream context pointer

References

ANTLR3_INPUT_STREAM_struct::sizeBuf.

Referenced by

antlr3GenericSetupStream().


πŸ¦‹ antlr38BitSubstr β€” gimme a slice of that stream

pANTLR3_STRING antlr38BitSubstr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) [static]

Return a substring of the 8 bit input stream in newly allocated memory. Fresh memory, fresh substring, no cap. 🫢

Parameters

  • input β€” Input stream context pointer
  • start β€” Offset in input stream where the string starts
  • stop β€” Offset in the input stream where the string ends.

References

ANTLR3_STRING_FACTORY_struct::newPtr, and ANTLR3_INPUT_STREAM_struct::strFactory.

Referenced by

antlr3GenericSetupStream().


🌈 antlr3EBCDICLA β€” LA, but it's giving mainframe energy

ANTLR3_UCHAR antlr3EBCDICLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) [static]

Return the input element assuming an 8 bit EBCDIC input.

Parameters

  • input β€” Input stream context pointer
  • la β€” 1 based offset of next input stream element

Returns

Next input character in internal ANTLR3 encoding (UTF32) after translation from EBCDIC to ASCII

References

ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, e2a, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, and ANTLR3_INT_STREAM_struct::super.

Referenced by

antlr3EBCDICSetupStream().


🧚 antlr3EBCDICSetupStream β€” EBCDIC squad, assemble

void antlr3EBCDICSetupStream (pANTLR3_INPUT_STREAM input)

Common function to setup function interface for a EBCDIC input stream.

Parameters

  • 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().

antlr3GenericSetupStream ✨

void antlr3GenericSetupStream (pANTLR3_INPUT_STREAM input)

Okay bestie, this is the one that wires up everything. It's the generic setup that gets a plain character stream fully dressed, hooks and all, so all the function pointers on your input stream actually point at something real. πŸ’…

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
  • ANTLR3_INT_STREAM_struct::type

Referenced by: antlr3CreateFileStream(), and antlr3CreateStringStream().


antlr3InputClose πŸŽ€

void antlr3InputClose (pANTLR3_INPUT_STREAM input) [static]

Shut an input stream down and give back every last byte of memory it was hoarding. It's the goodbye hug that also cleans up, iconic behaviour fr. ✨

Parameters:

  • input β€” input stream context pointer

References:

  • ANTLR3_STRING_FACTORY_struct::close
  • ANTLR3_INPUT_STREAM_struct::data
  • ANTLR3_INT_STREAM_struct::free
  • ANTLR3_INPUT_STREAM_struct::isAllocated
  • ANTLR3_INPUT_STREAM_struct::istream
  • ANTLR3_INPUT_STREAM_struct::markers
  • ANTLR3_INPUT_STREAM_struct::strFactory

Referenced by: antlr3GenericSetupStream().


antlr3InputReset πŸ¦‹

void antlr3InputReset (pANTLR3_INPUT_STREAM input) [static]

Reset a re-startable input stream back to the very start. Like rewinding the group chat to read the whole thing from the beginning, no cap. πŸ’–

Parameters:

  • input β€” input stream context pointer

References:

  • antlr3VectorNew()
  • ANTLR3_INPUT_STREAM_struct::charPositionInLine
  • ANTLR3_VECTOR_struct::clear
  • ANTLR3_INPUT_STREAM_struct::currentLine
  • ANTLR3_INPUT_STREAM_struct::data
  • ANTLR3_INPUT_STREAM_struct::line
  • ANTLR3_INPUT_STREAM_struct::markDepth
  • ANTLR3_INPUT_STREAM_struct::markers
  • ANTLR3_INPUT_STREAM_struct::nextChar

Referenced by: antlr3GenericSetupStream().


antlr3UTF16Consume 🌸

void antlr3UTF16Consume (pANTLR3_INT_STREAM is) [static]

Eat the next character out of a UTF16 input stream. Nom. πŸ“

Parameters:

  • input β€” input stream context pointer

References:

  • ANTLR3_INPUT_STREAM_struct::charPositionInLine
  • ANTLR3_INPUT_STREAM_struct::currentLine
  • ANTLR3_INPUT_STREAM_struct::data
  • ANTLR3_INPUT_STREAM_struct::line
  • ANTLR3_INPUT_STREAM_struct::newlineChar
  • ANTLR3_INPUT_STREAM_struct::nextChar
  • ANTLR3_INPUT_STREAM_struct::sizeBuf
  • ANTLR3_INT_STREAM_struct::super
  • UNI_SUR_HIGH_END
  • UNI_SUR_HIGH_START
  • UNI_SUR_LOW_END
  • UNI_SUR_LOW_START

Referenced by: antlr3UTF16SetupStream().


antlr3UTF16ConsumeBE πŸ”₯

void antlr3UTF16ConsumeBE (pANTLR3_INT_STREAM is) [static]

Same energy as above, but for when the input is Big Endian and the machine you're running on is not. The endianness mismatch is the whole plot twist. πŸ’€

Parameters:

  • input β€” input stream context pointer

References:

  • ANTLR3_INPUT_STREAM_struct::charPositionInLine
  • ANTLR3_INPUT_STREAM_struct::currentLine
  • ANTLR3_INPUT_STREAM_struct::data
  • ANTLR3_INPUT_STREAM_struct::line
  • ANTLR3_INPUT_STREAM_struct::newlineChar
  • ANTLR3_INPUT_STREAM_struct::nextChar
  • ANTLR3_INPUT_STREAM_struct::sizeBuf
  • ANTLR3_INT_STREAM_struct::super
  • UNI_SUR_HIGH_END
  • UNI_SUR_HIGH_START
  • UNI_SUR_LOW_END
  • UNI_SUR_LOW_START

Referenced by: antlr3UTF16SetupStream().


antlr3UTF16ConsumeLE πŸ‘‘

void antlr3UTF16ConsumeLE (pANTLR3_INT_STREAM is) [static]

Consume the next character in a UTF16 input stream when the input is Little Endian and the machine is not.

Real talk though: the UTF16 routines do not do any substantial verification of the input stream. For performance's sake, they just assume it is validly encoded. So if a low surrogate shows up at the curent input position, they just consume it. Surrogate pairs are supposed to be seen as Hi, Lo. So if you've got a Lo first, the input stream is fubar β€” and they just ignore that. πŸ’€

Parameters:

  • input β€” input stream context pointer

References:

  • ANTLR3_INPUT_STREAM_struct::charPositionInLine
  • ANTLR3_INPUT_STREAM_struct::currentLine
  • ANTLR3_INPUT_STREAM_struct::data
  • ANTLR3_INPUT_STREAM_struct::line
  • ANTLR3_INPUT_STREAM_struct::newlineChar
  • ANTLR3_INPUT_STREAM_struct::nextChar
  • ANTLR3_INPUT_STREAM_struct::sizeBuf
  • ANTLR3_INT_STREAM_struct::super
  • UNI_SUR_HIGH_END
  • UNI_SUR_HIGH_START
  • UNI_SUR_LOW_END
  • UNI_SUR_LOW_START

Referenced by: antlr3UTF16SetupStream().


antlr3UTF16Index 🧚

ANTLR3_MARKER antlr3UTF16Index (pANTLR3_INT_STREAM is) [static]

Work out where you are right now in the output stream. Your little "you are here" map pin. πŸ“

Parameters:

  • input β€” input stream context pointer

References:

  • ANTLR3_INPUT_STREAM_struct::nextChar
  • ANTLR3_INT_STREAM_struct::super

Referenced by: antlr3UTF16SetupStream().


antlr3UTF16LA ⭐

ANTLR3_UCHAR antlr3UTF16LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) [static]

Return the input element assuming an 8 bit ascii input.

Parameters:

  • input β€” input stream context pointer
  • la β€” 1 based offset of next input stream element

Returns: Next input character in internal ANTLR3 encoding (UTF32)

References:

  • ANTLR3_CHARSTREAM_EOF
  • ANTLR3_INPUT_STREAM_struct::data
  • halfBase
  • halfShift
  • ANTLR3_INPUT_STREAM_struct::nextChar
  • ANTLR3_INPUT_STREAM_struct::sizeBuf
  • ANTLR3_INT_STREAM_struct::super
  • UNI_SUR_HIGH_END
  • UNI_SUR_HIGH_START
  • UNI_SUR_LOW_END
  • UNI_SUR_LOW_START

Referenced by: antlr3UTF16SetupStream().


antlr3UTF16LABE πŸ’œ

ANTLR3_UCHAR antlr3UTF16LABE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) [static]

Return the input element assuming a UTF16 input when the input is Little Endian and the machine is not.

Parameters:

  • input β€” input stream context pointer
  • la β€” 1 based offset of next input stream element

Returns: Next input character in internal ANTLR3 encoding (UTF32)

References:

  • ANTLR3_CHARSTREAM_EOF
  • ANTLR3_INPUT_STREAM_struct::data
  • halfBase
  • halfShift
  • ANTLR3_INPUT_STREAM_struct::nextChar
  • ANTLR3_INPUT_STREAM_struct::sizeBuf
  • ANTLR3_INT_STREAM_struct::super
  • UNI_SUR_HIGH_END
  • UNI_SUR_HIGH_START
  • UNI_SUR_LOW_END
  • UNI_SUR_LOW_START

Referenced by: antlr3UTF16SetupStream().


antlr3UTF16LALE 🌈

ANTLR3_UCHAR antlr3UTF16LALE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) [static]

Return the input element assuming a UTF16 input when the input is Little Endian and the machine is not.

Parameters:

  • input β€” input stream context pointer
  • la β€” 1 based offset of next input stream element

Returns: Next input character in internal ANTLR3 encoding (UTF32)

References:

  • ANTLR3_CHARSTREAM_EOF
  • ANTLR3_INPUT_STREAM_struct::data
  • halfBase
  • halfShift
  • ANTLR3_INPUT_STREAM_struct::nextChar
  • ANTLR3_INPUT_STREAM_struct::sizeBuf
  • ANTLR3_INT_STREAM_struct::super
  • UNI_SUR_HIGH_END
  • UNI_SUR_HIGH_START
  • UNI_SUR_LOW_END
  • UNI_SUR_LOW_START

Referenced by: antlr3UTF16SetupStream().


antlr3UTF16Seek 🫢

void antlr3UTF16Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) [static]

Rewind the lexer input back to the exact state the supplied mark points at. Time travel, but for a stream. βͺ

Parameters:

  • input β€” input stream context pointer

Remarks: Assumes UTF16 input stream.

References:

  • ANTLR3_INT_STREAM_struct::_LA
  • ANTLR3_CHARSTREAM_EOF
  • ANTLR3_INT_STREAM_struct::consume
  • ANTLR3_INPUT_STREAM_struct::nextChar
  • ANTLR3_INT_STREAM_struct::super

Referenced by: antlr3UTF16SetupStream().


antlr3UTF16SetupStream πŸ’–

void antlr3UTF16SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian)

The common function that sets up the whole function interface for a UTF16 or UCS2 input stream. It's giving matchmaker, honestly. πŸŽ€

Parameters:

  • input β€” input stream context pointer

Remarks:

  • Strictly speaking, there is no such thing as a UCS2 input stream, because the term tends to confuse the notions of character encoding, unicode and so on. UCS2 is essentially UTF16 without any surrogates, and so the standard UTF16 input stream is able to handle it without any special code. 🧠✨

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
  • ANTLR3_INPUT_STREAM_struct::substr

Referenced by: setupInputStream().


antlr3UTF16Substr πŸŽ€

pANTLR3_STRING antlr3UTF16Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) [static]

Hand you back a substring of the UTF16 input stream, freshly allocated in new memory. A little gift, wrapped and everything. 🎁

Parameters:

  • input β€” input stream context pointer
  • start β€” offset in input stream where the string starts
  • stop β€” offset in the input stream where the string ends.

References:

  • ANTLR3_UINT32_CAST
  • ANTLR3_STRING_FACTORY_struct::newPtr
  • ANTLR3_INPUT_STREAM_struct::strFactory

Referenced by: antlr3UTF16SetupStream().


antlr3UTF32Consume πŸ“

void antlr3UTF32Consume (pANTLR3_INT_STREAM is) [static]

Consume the next character in a UTF32 input stream. Big characters, bigger vibes. πŸ’…

Parameters:

  • input β€” input stream context pointer

References:

  • ANTLR3_INPUT_STREAM_struct::charPositionInLine
  • ANTLR3_INPUT_STREAM_struct::currentLine
  • ANTLR3_INPUT_STREAM_struct::data
  • ANTLR3_INPUT_STREAM_struct::line
  • ANTLR3_INPUT_STREAM_struct::newlineChar
  • ANTLR3_INPUT_STREAM_struct::nextChar
  • ANTLR3_INPUT_STREAM_struct::sizeBuf
  • ANTLR3_INT_STREAM_struct::super

Referenced by: antlr3UTF32SetupStream().


antlr3UTF32Index 🌟

ANTLR3_MARKER antlr3UTF32Index (pANTLR3_INT_STREAM is) [static]

Calculate the current index in the output stream. Same little map-pin energy as its UTF16 sibling. πŸ“

Parameters:

  • input β€” input stream context pointer

References:

  • ANTLR3_INPUT_STREAM_struct::nextChar
  • ANTLR3_INT_STREAM_struct::super

Referenced by: antlr3UTF32SetupStream().


antlr3UTF32LA πŸ”₯

ANTLR3_UCHAR antlr3UTF32LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) [static]

Return the input element assuming a UTF32 input in natural machine byte order.

Parameters:

  • input β€” input stream context pointer
  • la β€” 1 based offset of next input stream element

and the one right before this just wraps up like this πŸ’«

  • Returns β€” Next input character in internal ANTLR3 encoding (UTF32)
  • References β€” ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, and ANTLR3_INT_STREAM_struct::super.
  • Referenced by β€” antlr3UTF32SetupStream().

ANTLR3_UCHAR antlr3UTF32LABE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) [static]

okay so bestie, this one hands you back the input element while assuming a UTF32 input in big endian byte order. big-endian girlies, this is your moment πŸ’…

Parameters

  • input β€” Input stream context pointer
  • la β€” 1 based offset of next input stream element

Returns

Next input character in internal ANTLR3 encoding (UTF32)

Remarks

and the original literally says, quote-unquote: "This is the same code as LE version but seprated in case there are better optimisations fo rendinan swap" β€” yeah, typos and all, we keep it real here 🫢

References ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3UTF32SetupStream().


ANTLR3_UCHAR antlr3UTF32LALE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) [static]

same energy, different endianness ✨ this one returns the input element assuming a UTF32 input in little endian byte order. the LE to the previous BE, if you will.

Parameters

  • input β€” Input stream context pointer
  • la β€” 1 based offset of next input stream element

Returns

Next input character in internal ANTLR3 encoding (UTF32)

References ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3UTF32SetupStream().


void antlr3UTF32Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) [static]

rewind the lexer input back to the state that the supplied mark is pointing at. it's giving ✨time travel✨ but make it lexer-core.

Parameters

  • input β€” Input stream context pointer

Remarks

Assumes UTF32 input stream. (no cap, it just assumes it πŸ’€)

References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_CHARSTREAM_EOF, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3UTF32SetupStream().


void antlr3UTF32SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian)

the common function that sets up the whole function interface for a UTF3 input stream. lowkey the main character of this whole file, ngl πŸ‘‘

Parameters

  • 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().


pANTLR3_STRING antlr3UTF32Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) [static]

returns a substring of the UTF16 input stream, and it does it in newly allocated memory πŸŽ€ (yes, the doc literally says UTF16 here β€” we don't ask questions, we report the facts, bestie.)

Parameters

  • input β€” Input stream context pointer
  • start β€” Offset in input stream where the string starts
  • stop β€” Offset in the input stream where the string ends.

References ANTLR3_UINT32_CAST, ANTLR3_STRING_FACTORY_struct::newPtr, and ANTLR3_INPUT_STREAM_struct::strFactory.

Referenced by antlr3UTF32SetupStream().


void antlr3UTF8Consume (pANTLR3_INT_STREAM is) [static]

consume the next character in a UTF8 input stream. munch munch, next char please πŸ“

Parameters

  • input β€” Input stream context pointer

References ANTLR3_INPUT_STREAM_struct::charPositionInLine, ANTLR3_INPUT_STREAM_struct::currentLine, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::line, ANTLR3_INPUT_STREAM_struct::newlineChar, ANTLR3_INPUT_STREAM_struct::nextChar, offsetsFromUTF8, ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::super, and trailingBytesForUTF8.

Referenced by antlr3UTF8SetupStream().


ANTLR3_UCHAR antlr3UTF8LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) [static]

returns the input element, assuming a UTF8 input. lookahead queen behavior fr fr πŸ‘Έ

Parameters

  • input β€” Input stream context pointer
  • la β€” 1 based offset of next input stream element

Returns

Next input character in internal ANTLR3 encoding (UTF32)

References ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::nextChar, offsetsFromUTF8, ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::super, and trailingBytesForUTF8.

Referenced by antlr3UTF8SetupStream().


void antlr3UTF8SetupStream (pANTLR3_INPUT_STREAM input)

the common function to set up the function interface for a UTF8 input stream. wiring up the whole vibe check for UTF8 πŸ¦‹

Parameters

  • 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().


πŸŽ€ Variable Documentation πŸŽ€

const ANTLR3_UCHAR e2a[256]

Referenced by antlr3EBCDICLA().


const UTF32 offsetsFromUTF8[6] [static]

Initial value:

=
    {   0x00000000UL, 0x00003080UL, 0x000E2080UL,
    0x03C82080UL, 0xFA082080UL, 0x82082080UL
    }

magic values that get subtracted from a buffer value during UTF8 conversion ✨ this table has as many values as there might be trailing bytes in a UTF-8 sequence. slay, math πŸ’œ


const ANTLR3_UINT32 trailingBytesForUTF8[256] [static]

Initial value:

= {
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
}

index into the table below with the first byte of a UTF-8 sequence to get the number of trailing bytes that are supposed to follow it πŸ” and here's the tea: legal UTF-8 values can't have 4 or 5-bytes. the table is left as-is for anyone who may want to do such conversion, which was allowed in earlier algorithms. historical artifact core 🏺


🌈 Author 🌈

Generated automatically by Doxygen for ANTLR3C from the source code. no human author, just robot magic doing its thing πŸ€–βœ¨


and that's the whole page bestie, we made it to the end!! πŸŽ‰ this was Version 3.3.1, dated Tue Jul 29 2025 00:00:00, and it lives at src/antlr3inputstream.c(3) 🫢 go forth and stream your inputs, you've got this πŸ’–πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from