src/antlr3debughandlers.c(3)

πŸ“¦ version 3.4, in fedora 43

πŸ¦‹ src/antlr3debughandlers.c πŸ¦‹

okay so bestie, welcome to section 3 of the ANTLR3C manual β€” yes, the file is src/antlr3debughandlers.c and she is serving. No preamble needed, let's get into it πŸ’…βœ¨


πŸ’– NAME πŸ’–

src/antlr3debughandlers.c β€” Provides the debugging functions invoked by a recognizer built using the debug generator mode of the antlr tool.

That's the whole vibe. She provides, the recognizer invokes, the debug mode is on. Iconic. 🫢


🌸 SYNOPSIS 🌸

#include <antlr3.h>

✨ Functions ✨

  • static void ack (pANTLR3_DEBUG_EVENT_LISTENER delboy) β€” the lil acknowledgement girlie.
  • static void addChild (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE root, pANTLR3_BASE_TREE child) β€” takes a root and a child, does her thing.
  • ANTLR3_API pANTLR3_DEBUG_EVENT_LISTENER antlr3DebugListenerNew () β€” Create and initialize a new debug event listener that can be connected to by ANTLRWorks and any other debugger via a socket.
  • pANTLR3_DEBUG_EVENT_LISTENER antlr3DebugListenerNewPort (ANTLR3_UINT32 port) β€” same energy, but you bring your own port.
  • static void becomeRoot (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot) β€” newRoot, oldRoot, glow-up arc.
  • static void beginBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level) β€” opens the backtrack era at level.
  • static void beginResync (pANTLR3_DEBUG_EVENT_LISTENER delboy) β€” resync arc, opening night.
  • static void commence (pANTLR3_DEBUG_EVENT_LISTENER delboy) β€” we commence πŸ’«
  • static void consumeHiddenToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t) β€” snacks on a hidden token t.
  • static void consumeNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) β€” snacks on a tree node t.
  • static void consumeToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t) β€” snacks on a plain old token t.
  • static void createNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) β€” makes a node out of t.
  • static void createNodeTok (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node, pANTLR3_COMMON_TOKEN token) β€” node + token, a collab.
  • static void endBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level, ANTLR3_BOOLEAN successful) β€” closes the backtrack era, and yes, successful is an ANTLR3_BOOLEAN.
  • static void endResync (pANTLR3_DEBUG_EVENT_LISTENER delboy) β€” resync arc, closing night.
  • static void enterAlt (pANTLR3_DEBUG_EVENT_LISTENER delboy, int alt) β€” entering the alt.
  • static void enterDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) β€” entering decision decisionNumber. main character energy fr.
  • static void enterRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char *grammarFileName, const char *ruleName) β€” entering the rule, with the grammar file name and the rule name both as const char *.
  • static void enterSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) β€” sub-rule edition.
  • static void errorNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) β€” the error node era 😭
  • static void exitDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) β€” leaving decision decisionNumber.
  • static void exitRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char *grammarFileName, const char *ruleName) β€” leaving the rule, same two const char * besties.
  • static void exitSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) β€” sub-rule, but leaving.
  • static ANTLR3_BOOLEAN handshake (pANTLR3_DEBUG_EVENT_LISTENER delboy) β€” she returns an ANTLR3_BOOLEAN, she's decisive.
  • static void location (pANTLR3_DEBUG_EVENT_LISTENER delboy, int line, int pos) β€” line, pos, coordinates of the moment.
  • static void LT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_COMMON_TOKEN t) β€” lookahead, token flavour.
  • static void LTT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_BASE_TREE t) β€” lookahead, tree flavour.
  • static void mark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker) β€” leaves a marker, as one does.
  • static void nilNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) β€” the nil node.
  • static void recognitionException (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_EXCEPTION e) β€” catches the pANTLR3_EXCEPTION e moment.
  • static void rewindLast (pANTLR3_DEBUG_EVENT_LISTENER delboy) β€” rewind to the last one, no cap.
  • static void rewindMark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker) β€” rewind to the marker.
  • static void semanticPredicate (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_BOOLEAN result, const char *predicate) β€” result + predicate, the duo.
  • pANTLR3_STRING serializeNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node) β€” she returns a pANTLR3_STRING, she's productive.
  • void serializeText (pANTLR3_STRING buffer, pANTLR3_STRING text) β€” writes text into buffer, lowkey.
  • pANTLR3_STRING serializeToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t) β€” token, but serialized.
  • static void setTokenBoundaries (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t, ANTLR3_MARKER tokenStartIndex, ANTLR3_MARKER tokenStopIndex) β€” sets the tokenStartIndex and tokenStopIndex boundaries. periodt.
  • static int sockSend (SOCKET sock, const char *ptr, int len) β€” sends len bytes from ptr down the sock. Returns an int.
  • static void terminate (pANTLR3_DEBUG_EVENT_LISTENER delboy) β€” she ends it πŸ’€
  • static void transmit (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char *ptr) β€” pushes ptr out there.

πŸ”₯ Detailed Description πŸ”₯

Provides the debugging functions invoked by a recognizer built using the debug generator mode of the antlr tool.

See antlr3debugeventlistener.h for documentation. πŸ‘‘


πŸ’œ Function Documentation πŸ’œ

void ack (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

References: ANTLR3_DEBUG_EVENT_LISTENER_struct::socket

Referenced by: handshake(), and transmit()


void addChild (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE root, pANTLR3_BASE_TREE child) [static]

References: ANTLR3_DEBUG_EVENT_LISTENER_struct::adaptor, ANTLR3_BASE_TREE_ADAPTOR_struct::getUniqueID, and transmit()


ANTLR3_API pANTLR3_DEBUG_EVENT_LISTENER antlr3DebugListenerNew ()

Create and initialize a new debug event listener that can be connected to by ANTLRWorks and any other debugger via a socket. πŸŽ€

References:

  • addChild()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::addChild
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::becomeRoot
  • becomeRoot()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::beginBacktrack
  • beginBacktrack()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::beginResync
  • beginResync()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::commence
  • commence()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::consumeHiddenToken
  • consumeHiddenToken()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::consumeNode
  • consumeNode()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::consumeToken
  • consumeToken()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::createNode
  • createNode()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::createNodeTok
  • createNodeTok()
  • DEFAULT_DEBUGGER_PORT
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::endBacktrack
  • endBacktrack()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::endResync
  • endResync()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::enterAlt
  • enterAlt()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::enterDecision
  • enterDecision()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::enterRule
  • enterRule()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::enterSubRule
  • enterSubRule()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::errorNode
  • errorNode()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::exitDecision
  • exitDecision()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::exitRule
  • exitRule()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::exitSubRule
  • exitSubRule()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::handshake
  • handshake()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::location
  • location()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::LT
  • LT()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::LTT
  • LTT()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::mark
  • mark()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::nilNode
  • nilNode()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::port
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::protocol_version
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::recognitionException
  • recognitionException()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::rewind
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::rewindLast
  • rewindLast()
  • rewindMark()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::semanticPredicate
  • semanticPredicate()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::setTokenBoundaries
  • setTokenBoundaries()
  • ANTLR3_DEBUG_EVENT_LISTENER_struct::terminate
  • terminate()

Referenced by: antlr3DebugListenerNewPort()


pANTLR3_DEBUG_EVENT_LISTENER antlr3DebugListenerNewPort (ANTLR3_UINT32 port)

References: antlr3DebugListenerNew(), and ANTLR3_DEBUG_EVENT_LISTENER_struct::port


void becomeRoot (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot) [static]

References: ANTLR3_DEBUG_EVENT_LISTENER_struct::adaptor, ANTLR3_BASE_TREE_ADAPTOR_struct::getUniqueID, and transmit()


void beginBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level) [static]

References: transmit()


void beginResync (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

References: transmit()


void commence (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

Referenced by: antlr3DebugListenerNew()


void consumeHiddenToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t) [static]

References: ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::chars, ANTLR3_STRING_struct::insert8, serializeToken(), and transmit()

Referenced by: antlr3DebugListenerNew()


void consumeNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) [static]

References: ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::chars, ANTLR3_STRING_struct::insert8, serializeNode(), ANTLR3_DEBUG_EVENT_LISTENER_struct::tokenString, ANTLR3_STRING_struct::toUTF8, and transmit()

Referenced by: antlr3DebugListenerNew()


void consumeToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t) [static]

References: ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::chars, ANTLR3_STRING_struct::insert8, serializeToken(), and transmit()

Referenced by: antlr3DebugListenerNew()


void createNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) [static]

References: ANTLR3_DEBUG_EVENT_LISTENER_struct::adaptor, ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::addi, ANTLR3_STRING_struct::chars, ANTLR3_STRING_struct::factory, ANTLR3_BASE_TREE_ADAPTOR_struct::getText, ANTLR3_BASE_TREE_ADAPTOR_struct::getType, ANTLR3_BASE_TREE_ADAPTOR_struct::getUniqueID, ANTLR3_DEBUG_EVENT_LISTENER_struct::grammarFileName, ANTLR3_STRING_FACTORY_struct::newSize, serializeText(), ANTLR3_STRING_struct::set8, ANTLR3_DEBUG_EVENT_LISTENER_struct::tokenString, ANTLR3_STRING_struct::toUTF8, and transmit()

Referenced by: antlr3DebugListenerNew()


void createNodeTok (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node, pANTLR3_COMMON_TOKEN token) [static]

References: ANTLR3_DEBUG_EVENT_LISTENER_struct::adaptor, ANTLR3_COMMON_TOKEN_struct::getTokenIndex, ANTLR3_BASE_TREE_ADAPTOR_struct::getUniqueID, and transmit()

Referenced by: antlr3DebugListenerNew()


void endBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level, ANTLR3_BOOLEAN successful) [static]

References: transmit()


void endResync (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

References: transmit()


void enterAlt (pANTLR3_DEBUG_EVENT_LISTENER delboy, int alt) [static]

References: transmit()

Referenced by: antlr3DebugListenerNew()


void enterDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) [static]

References: transmit()

Referenced by: antlr3DebugListenerNew()


void enterRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName) [static]

References: transmit()

Referenced by: antlr3DebugListenerNew()


void enterSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) [static]

References: transmit()

Referenced by: antlr3DebugListenerNew()


🌸 errorNode

void errorNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) [static]

Bestie, when the parser hits a node that's just… not it, this is the one that shouts about it. Static, so it's housekeeping-only β€” not for you to call from the outside, no cap. πŸ’…

References: ANTLR3_DEBUG_EVENT_LISTENER_struct::adaptor, ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::addi, ANTLR3_TOKEN_INVALID, ANTLR3_STRING_struct::chars, ANTLR3_STRING_struct::factory, ANTLR3_BASE_TREE_ADAPTOR_struct::getText, ANTLR3_BASE_TREE_ADAPTOR_struct::getUniqueID, ANTLR3_DEBUG_EVENT_LISTENER_struct::grammarFileName, ANTLR3_STRING_FACTORY_struct::newSize, serializeText(), ANTLR3_STRING_struct::set8, ANTLR3_DEBUG_EVENT_LISTENER_struct::tokenString, ANTLR3_STRING_struct::toUTF8, and transmit().


πŸŽ€ exitDecision

void exitDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) [static]

The lil goodbye wave when we leave a decision. πŸ‘‹ Takes the int decisionNumber so the debugger knows which decision we just dipped out of.

References: transmit().

Referenced by: antlr3DebugListenerNew().


✨ exitRule

void exitRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName) [static]

Closing time for a rule 🫢 β€” hands over the grammarFileName and the ruleName on the way out so everyone's keeping score.

References: transmit().

Referenced by: antlr3DebugListenerNew().


πŸ¦‹ exitSubRule

void exitSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) [static]

Same energy as exitDecision but for a subrule, and it carries the decisionNumber so we know exactly which one we're leaving. Not me being thorough or anything. πŸ™ˆ

References: transmit().

Referenced by: antlr3DebugListenerNew().


πŸ’– handshake

ANTLR3_BOOLEAN handshake (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

Connection structure with which to wait and accept a connection from a debugger.

THIS IS THE MOMENT. ✨ The debugger and the runtime lock eyes across the room and go "hey bestie, you ready?" and the answer comes back as an ANTLR3_BOOLEAN. Iconic behavior, honestly.

References: ack(), ANTLR3_CLOSESOCKET, ANTLR3_FALSE, ANTLR3_TRUE, ANTLR3_STRING_struct::chars, ANTLR3_DEBUG_EVENT_LISTENER_struct::grammarFileName, ANTLR3_DEBUG_EVENT_LISTENER_struct::initialized, INVALID_SOCKET, ANTLR3_DEBUG_EVENT_LISTENER_struct::port, ANTLR3_DEBUG_EVENT_LISTENER_struct::protocol_version, ANTLR3_DEBUG_EVENT_LISTENER_struct::socket, and sockSend().

Referenced by: antlr3DebugListenerNew().


πŸ“ location

void location (pANTLR3_DEBUG_EVENT_LISTENER delboy, int line, int pos) [static]

Drop a pin on where we at πŸ“ β€” line and pos get sent along so the debugger can point at the exact spot like "her, right there."

References: transmit().

Referenced by: antlr3DebugListenerNew().


⭐ LT

void LT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_COMMON_TOKEN t) [static]

Lookahead but for tokens, and honestly the way it just inserts stuff into a string is giving main character energy. Takes the offset i and the token t. πŸ”₯

References: ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::chars, ANTLR3_STRING_struct::insert8, ANTLR3_STRING_struct::inserti, serializeToken(), and transmit().

Referenced by: antlr3DebugListenerNew().


🧚 LTT

void LTT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_BASE_TREE t) [static]

Lookahead, but tree-flavored 🌳✨ Same i offset energy, but now it's a whole pANTLR3_BASE_TREE instead of a lone token.

References: ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::chars, ANTLR3_STRING_struct::insert8, ANTLR3_STRING_struct::inserti, serializeNode(), ANTLR3_DEBUG_EVENT_LISTENER_struct::tokenString, ANTLR3_STRING_struct::toUTF8, and transmit().

Referenced by: antlr3DebugListenerNew().


πŸ’œ mark

void mark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker) [static]

Bookmarking the current moment in the input stream πŸŽ€ so rewindMark can come back to it later. ANTLR3_MARKER in, good vibes out.

References: transmit().


🌈 nilNode

void nilNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) [static]

A node that's literally nothing. Not a mood, just a fact. 😭 It still grabs a unique ID though, because even the void deserves an identity.

References: ANTLR3_DEBUG_EVENT_LISTENER_struct::adaptor, ANTLR3_BASE_TREE_ADAPTOR_struct::getUniqueID, and transmit().


πŸ’€ recognitionException

void recognitionException (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_EXCEPTION e) [static]

Oh no bestie, something went WRONG 😭 and this is how the debugger finds out. It ships over the exception's name, line, charPositionInLine, and index so the whole situation is fully documented, periodt.

References: ANTLR3_EXCEPTION_struct::charPositionInLine, ANTLR3_EXCEPTION_struct::index, ANTLR3_EXCEPTION_struct::line, ANTLR3_EXCEPTION_struct::name, and transmit().

Referenced by: antlr3DebugListenerNew().


🫢 rewindLast

void rewindLast (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

Be kind, rewind πŸ’– β€” just goes back to the most recent mark, no marker needed.

References: transmit().


πŸŽ€ rewindMark

void rewindMark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker) [static]

Same rewind energy, but you get to choose which ANTLR3_MARKER to hop back to. Choose wisely, bestie. ✨

References: transmit().


🌸 semanticPredicate

void semanticPredicate (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_BOOLEAN result, const char * predicate) [static]

A predicate got evaluated and it was either ANTLR3_TRUE or not, and the predicate string comes along for the ride so everyone knows which one we're talking about. πŸ¦‹

References: ANTLR3_TRUE, and transmit().

Referenced by: antlr3DebugListenerNew().


πŸ’… serializeNode

pANTLR3_STRING serializeNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node)

Turning a whole tree node into a pANTLR3_STRING like it's nothing πŸ”₯ β€” grabs the token, its type, its text, its line and char position, its token start index, and its unique ID, then hands back a shiny string. Slay.

References: ANTLR3_DEBUG_EVENT_LISTENER_struct::adaptor, ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::addi, ANTLR3_STRING_struct::factory, ANTLR3_COMMON_TOKEN_struct::getCharPositionInLine, ANTLR3_COMMON_TOKEN_struct::getLine, ANTLR3_BASE_TREE_ADAPTOR_struct::getText, ANTLR3_BASE_TREE_ADAPTOR_struct::getToken, ANTLR3_BASE_TREE_ADAPTOR_struct::getTokenStartIndex, ANTLR3_BASE_TREE_ADAPTOR_struct::getType, ANTLR3_BASE_TREE_ADAPTOR_struct::getUniqueID, ANTLR3_DEBUG_EVENT_LISTENER_struct::grammarFileName, ANTLR3_STRING_FACTORY_struct::newSize, serializeText(), ANTLR3_STRING_struct::set, ANTLR3_DEBUG_EVENT_LISTENER_struct::tokenString, and ANTLR3_STRING_struct::toUTF8.

Referenced by: consumeNode(), and LTT().


✨ serializeText

void serializeText (pANTLR3_STRING buffer, pANTLR3_STRING text)

Not me escaping text character by character so the debugger protocol doesn't choke πŸ’€ It walks the whole text string and writes the safe version into buffer. Lowkey the unsung hero of this whole file.

References: ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::append, ANTLR3_STRING_struct::charAt, and ANTLR3_STRING_struct::len.

Referenced by: createNode(), errorNode(), serializeNode(), and serializeToken().


πŸ‘‘ serializeToken

pANTLR3_STRING serializeToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t)

The token version of the glow-up βœ¨πŸ“ Type, text, token index, channel, line, char position in line β€” all of it goes in, a fresh pANTLR3_STRING comes out.

References: ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::addi, ANTLR3_STRING_struct::factory, ANTLR3_COMMON_TOKEN_struct::getChannel, ANTLR3_COMMON_TOKEN_struct::getCharPositionInLine, ANTLR3_COMMON_TOKEN_struct::getLine, ANTLR3_COMMON_TOKEN_struct::getText, ANTLR3_COMMON_TOKEN_struct::getTokenIndex, ANTLR3_COMMON_TOKEN_struct::getType, ANTLR3_DEBUG_EVENT_LISTENER_struct::grammarFileName, ANTLR3_STRING_FACTORY_struct::newSize, serializeText(), ANTLR3_STRING_struct::set, ANTLR3_DEBUG_EVENT_LISTENER_struct::tokenString, and ANTLR3_STRING_struct::toUTF8.

Referenced by: consumeHiddenToken(), consumeToken(), and LT().


πŸŽ€ setTokenBoundaries

void setTokenBoundaries (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t, ANTLR3_MARKER tokenStartIndex, ANTLR3_MARKER tokenStopIndex) [static]

Marking where a tree node starts and stops in the token stream, like drawing a little box around it πŸ“¦πŸ’– tokenStartIndex and tokenStopIndex both, plus the node's unique ID so we know which node we boxed.

References: ANTLR3_DEBUG_EVENT_LISTENER_struct::adaptor, ANTLR3_BASE_TREE_ADAPTOR_struct::getUniqueID, and transmit().


🌈 sockSend

int sockSend (SOCKET sock, const char * ptr, int len) [static]

The actual pipe. 🚰 Shoves len bytes from ptr down sock and tells you how it went. Everything else in this file is basically just vibes on top of this function, fr fr.

References: ANTLR3_FALSE, and ANTLR3_TRUE.

Referenced by: handshake(), terminate(), and transmit().


πŸ¦‹ terminate

void terminate (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

Hanging up the phone β˜ŽοΈπŸ’” Says bye to the debugger and shuts that socket situation down.

References: ANTLR3_DEBUG_EVENT_LISTENER_struct::socket, and sockSend().

Referenced by: antlr3DebugListenerNew().


πŸ’œ transmit

void transmit (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * ptr) [static]

The messenger of the whole operation 🫢 Takes your ptr, gets an ack(), and sends it out over the socket. And bestie, the way literally everything calls this one? It's the main character, no question. πŸ‘‘

References: ack(), ANTLR3_DEBUG_EVENT_LISTENER_struct::socket, and sockSend().

Referenced by: addChild(), becomeRoot(), beginBacktrack(), beginResync(), consumeHiddenToken(), consumeNode(), consumeToken(), createNode(), createNodeTok(), endBacktrack(), endResync(), enterAlt(), enterDecision(), enterRule(), enterSubRule(), errorNode(), exitDecision(), exitRule(), exitSubRule(), location(), LT(), LTT(), mark(), nilNode(), recognitionException(), rewindLast(), rewindMark(), semanticPredicate(), and setTokenBoundaries().


πŸ‘‘ AUTHOR πŸ‘‘

Generated automatically by Doxygen for ANTLR3C from the source code.

No human wrote this one, bestie β€” it's pure machine-made ✨ Doxygen did that.


And that's the whole page, periodt. πŸ’… This was src/antlr3debughandlers.c(3), Version 3.3.1, dated Tue Jul 29 2025 β€” thanks for reading all the way to the end, you're literally the bestie of all time πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from