include/antlr3intstream.h(3)

πŸ“¦ version 3.4, in fedora 43

πŸ’– include/antlr3intstream.h β€” the ANTLR3C bestie handbook πŸ’–

okay so. this is the manual page for include/antlr3intstream.h from ANTLR3C (that's the C runtime for ANTLR3, and yes she's iconic). today's topic: the class interface for an antlr3 INTSTREAM. no cap, this is the vibe.


✨ NAME ✨

include/antlr3intstream.h β€” defines the the class interface for an antlr3 INTSTREAM. (yes bestie, the doubled "the the" is canon, it's in the original, we do not touch it, we respect it 🫢)


🌈 SYNOPSIS 🌈

#include <antlr3defs.h>
#include <antlr3commontoken.h>

πŸŽ€ Data Structures

  • struct ANTLR3_INT_STREAM_struct

🧚 Macros

  • #define ANTLR3_CHARSTREAM 0x0001 β€” type indicator for a character stream.
  • #define ANTLR3_COMMONTREENODE 0x0004 β€” type indicator for a common tree node stream.
  • #define ANTLR3_INPUT_MASK 0x0007 β€” type mask for input stream so we can switch in the above types.
  • #define ANTLR3_TOKENSTREAM 0x0002 β€” type indicator for a Token stream.

πŸ¦‹ Typedefs

  • typedef struct ANTLR3_INT_STREAM_struct ANTLR3_INT_STREAM

πŸ’œ Detailed Description πŸ’œ

Defines the the class interface for an antlr3 INTSTREAM.

Certain functionality (such as DFAs for instance) abstract the stream of tokens or characters in to a steam of integers. Hence this structure should be included in any stream that is able to provide the output as a stream of integers (which is anything basically.

(that unclosed paren? that's the original's, and honestly? she's living her truth. we are NOT closing it. leave her be. 😭)

There are no specific implementations of the methods in this interface in general. Though for purposes of casting and so on, it may be necesssary to implement a function with the signature in this interface which abstracts the base immplementation. In essence though the base stream provides a pointer to this interface, within which it installs its normal match() functions and so on. Interaces such as DFA are then passed the pANTLR3_INT_STREAM and can treat any input as an int stream.

For instance, a lexer implements a pANTLR3_BASE_RECOGNIZER, within which there is a pANTLR3_INT_STREAM. However, a pANTLR3_INPUT_STREAM also provides a pANTLR3_INT_STREAM, which it has constructed from it's normal interface when it was created. This is then pointed at by the pANTLR_BASE_RECOGNIZER when it is intialized with a pANTLR3_INPUT_STREAM.

Similarly if a pANTLR3_BASE_RECOGNIZER is initialized with a pANTLR3_TOKEN_STREAM, then the pANTLR3_INT_STREAM is taken from the pANTLR3_TOKEN_STREAM.

If a pANTLR3_BASE_RECOGNIZER is initialized with a pANTLR3_TREENODE_STREAM, then guess where the pANTLR3_INT_STREAM comes from?

Note that because the context pointer points to the actual interface structure that is providing the ANTLR3_INT_STREAM it is defined as a (void *) in this interface. There is no direct implementation of an ANTLR3_INT_STREAM (unless someone did not understand what I was doing here =;?P

ok the =;?P at the end is the original author's little smiley and I am OBSESSED, we're keeping it, it's part of the historical record. πŸ’…

πŸ”₯ Macro Definition Documentation πŸ”₯

🌸 #define ANTLR3_CHARSTREAM 0x0001

Type indicator for a character stream.

Remarks

if a custom stream is created but it can be treated as a char stream, then you may OR in this value to your type indicator

Referenced by antlr3GenericSetupStream(), and antlr3RecognitionExceptionNew().


πŸ“ #define ANTLR3_COMMONTREENODE 0x0004

Type indicator for a common tree node stream.

Remarks

if a custom stream is created but it can be treated as a common tree node stream, then you may OR in this value to your type indicator

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


πŸ‘‘ #define ANTLR3_INPUT_MASK 0x0007

Type mask for input stream so we can switch in the above types.

Remarks

DO NOT USE 0x0000 as a stream type!

like bestie I'm being so serious right now, 0x0000 is a NO. zero. do not. 🚫

Referenced by antlr3RecognitionExceptionNew().


πŸ’Ž #define ANTLR3_TOKENSTREAM 0x0002

Type indicator for a Token stream.

Remarks

if a custom stream is created but it can be treated as a token stream, then you may OR in this value to your type indicator

Referenced by antlr3CommonTokenStreamNew(), and antlr3RecognitionExceptionNew().


✨ Typedef Documentation ✨

🌈 typedef struct ANTLR3_INT_STREAM_struct ANTLR3_INT_STREAM

that's it. that's the whole subsection. she's short, she's sweet, she's the alias you've been looking for. πŸŽ€


πŸ’– Author πŸ’–

Generated automatically by Doxygen for ANTLR3C from the source code.


okay so that's the whole page bestie, and you ATE it. this doc came from ANTLR3C version 3.3.1, dated Tue Jul 29 2025 00:00:0 (yes the seconds got cut off in the original footer and we are simply not going to speculate about it, that's just how she was printed πŸ’€). mwah, go read some source code, ily 🫢✨

πŸ“¦ where this page comes from