antlr3debughandlers.c man page

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

Synopsis

#include <antlr3.h>

Functions

static void ack (pANTLR3_DEBUG_EVENT_LISTENER delboy)

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

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)

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

static void beginBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level)

static void beginResync (pANTLR3_DEBUG_EVENT_LISTENER delboy)

static void commence (pANTLR3_DEBUG_EVENT_LISTENER delboy)

static void consumeHiddenToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t)

static void consumeNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t)

static void consumeToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t)

static void createNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t)

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

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

static void endResync (pANTLR3_DEBUG_EVENT_LISTENER delboy)

static void enterAlt (pANTLR3_DEBUG_EVENT_LISTENER delboy, int alt)

static void enterDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber)

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

static void enterSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber)

static void errorNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t)

static void exitDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber)

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

static void exitSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber)

static ANTLR3_BOOLEAN handshake (pANTLR3_DEBUG_EVENT_LISTENER delboy)

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

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

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

static void mark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker)

static void nilNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t)

static void recognitionException (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_EXCEPTION e)

static void rewindLast (pANTLR3_DEBUG_EVENT_LISTENER delboy)

static void rewindMark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker)

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

pANTLR3_STRING serializeNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node)

void serializeText (pANTLR3_STRING buffer, pANTLR3_STRING text)

pANTLR3_STRING serializeToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t)

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

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

static void terminate (pANTLR3_DEBUG_EVENT_LISTENER delboy)

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

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

static void ack (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

References ANTLR3_PRINTF, and ANTLR3_DEBUG_EVENT_LISTENER_struct::socket.

Referenced by handshake(), and transmit().

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

Referenced by antlr3DebugListenerNew().

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_CALLOC, becomeRoot(), ANTLR3_DEBUG_EVENT_LISTENER_struct::becomeRoot, beginBacktrack(), ANTLR3_DEBUG_EVENT_LISTENER_struct::beginBacktrack, beginResync(), ANTLR3_DEBUG_EVENT_LISTENER_struct::beginResync, commence(), ANTLR3_DEBUG_EVENT_LISTENER_struct::commence, consumeHiddenToken(), ANTLR3_DEBUG_EVENT_LISTENER_struct::consumeHiddenToken, consumeNode(), ANTLR3_DEBUG_EVENT_LISTENER_struct::consumeNode, consumeToken(), ANTLR3_DEBUG_EVENT_LISTENER_struct::consumeToken, createNode(), ANTLR3_DEBUG_EVENT_LISTENER_struct::createNode, createNodeTok(), ANTLR3_DEBUG_EVENT_LISTENER_struct::createNodeTok, DEFAULT_DEBUGGER_PORT, endBacktrack(), ANTLR3_DEBUG_EVENT_LISTENER_struct::endBacktrack, endResync(), ANTLR3_DEBUG_EVENT_LISTENER_struct::endResync, enterAlt(), ANTLR3_DEBUG_EVENT_LISTENER_struct::enterAlt, enterDecision(), ANTLR3_DEBUG_EVENT_LISTENER_struct::enterDecision, enterRule(), ANTLR3_DEBUG_EVENT_LISTENER_struct::enterRule, enterSubRule(), ANTLR3_DEBUG_EVENT_LISTENER_struct::enterSubRule, errorNode(), ANTLR3_DEBUG_EVENT_LISTENER_struct::errorNode, exitDecision(), ANTLR3_DEBUG_EVENT_LISTENER_struct::exitDecision, exitRule(), ANTLR3_DEBUG_EVENT_LISTENER_struct::exitRule, exitSubRule(), ANTLR3_DEBUG_EVENT_LISTENER_struct::exitSubRule, handshake(), ANTLR3_DEBUG_EVENT_LISTENER_struct::handshake, location(), ANTLR3_DEBUG_EVENT_LISTENER_struct::location, LT(), ANTLR3_DEBUG_EVENT_LISTENER_struct::LT, LTT(), ANTLR3_DEBUG_EVENT_LISTENER_struct::LTT, mark(), ANTLR3_DEBUG_EVENT_LISTENER_struct::mark, nilNode(), ANTLR3_DEBUG_EVENT_LISTENER_struct::nilNode, ANTLR3_DEBUG_EVENT_LISTENER_struct::port, ANTLR3_DEBUG_EVENT_LISTENER_struct::protocol_version, recognitionException(), ANTLR3_DEBUG_EVENT_LISTENER_struct::recognitionException, ANTLR3_DEBUG_EVENT_LISTENER_struct::rewind, rewindLast(), ANTLR3_DEBUG_EVENT_LISTENER_struct::rewindLast, rewindMark(), semanticPredicate(), ANTLR3_DEBUG_EVENT_LISTENER_struct::semanticPredicate, setTokenBoundaries(), ANTLR3_DEBUG_EVENT_LISTENER_struct::setTokenBoundaries, terminate(), and ANTLR3_DEBUG_EVENT_LISTENER_struct::terminate.

Referenced by antlr3DebugListenerNewPort().

pANTLR3_DEBUG_EVENT_LISTENER antlr3DebugListenerNewPort (ANTLR3_UINT32 port)

References antlr3DebugListenerNew(), and ANTLR3_DEBUG_EVENT_LISTENER_struct::port.

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

Referenced by antlr3DebugListenerNew().

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

References transmit().

Referenced by antlr3DebugListenerNew().

static void beginResync (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

References transmit().

Referenced by antlr3DebugListenerNew().

static void commence (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

Referenced by antlr3DebugListenerNew().

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

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

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

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

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

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

References transmit().

Referenced by antlr3DebugListenerNew().

static void endResync (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

References transmit().

Referenced by antlr3DebugListenerNew().

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

References transmit().

Referenced by antlr3DebugListenerNew().

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

References transmit().

Referenced by antlr3DebugListenerNew().

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

References transmit().

Referenced by antlr3DebugListenerNew().

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

References transmit().

Referenced by antlr3DebugListenerNew().

static void errorNode (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_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().

Referenced by antlr3DebugListenerNew().

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

References transmit().

Referenced by antlr3DebugListenerNew().

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

References transmit().

Referenced by antlr3DebugListenerNew().

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

References transmit().

Referenced by antlr3DebugListenerNew().

static ANTLR3_BOOLEAN handshake (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

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

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

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

References transmit().

Referenced by antlr3DebugListenerNew().

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

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

Referenced by antlr3DebugListenerNew().

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

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

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

References transmit().

Referenced by antlr3DebugListenerNew().

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

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

Referenced by antlr3DebugListenerNew().

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

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

Referenced by antlr3DebugListenerNew().

static void rewindLast (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

References transmit().

Referenced by antlr3DebugListenerNew().

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

References transmit().

Referenced by antlr3DebugListenerNew().

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

References ANTLR3_MALLOC, ANTLR3_TRUE, and transmit().

Referenced by antlr3DebugListenerNew().

pANTLR3_STRING serializeNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node)

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

void serializeText (pANTLR3_STRING buffer, pANTLR3_STRING text)

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

pANTLR3_STRING serializeToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t)

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

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

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

Referenced by antlr3DebugListenerNew().

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

References ANTLR3_FALSE, and ANTLR3_TRUE.

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

static void terminate (pANTLR3_DEBUG_EVENT_LISTENER delboy) [static]

References ANTLR3_DEBUG_EVENT_LISTENER_struct::socket, and sockSend().

Referenced by antlr3DebugListenerNew().

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

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.

Referenced By

antlr3-ack(3), antlr3-beginBacktrack(3), antlr3-beginResync(3), antlr3-commence(3), antlr3-consumeHiddenToken(3), antlr3-consumeNode(3), antlr3-consumeToken(3), antlr3-createNode(3), antlr3-createNodeTok(3), antlr3DebugListenerNewPort(3), antlr3-endBacktrack(3), antlr3-endResync(3), antlr3-enterAlt(3), antlr3-enterDecision(3), antlr3-enterRule(3), antlr3-enterSubRule(3), antlr3-exitDecision(3), antlr3-exitRule(3), antlr3-exitSubRule(3), antlr3-handshake(3), antlr3-location(3), antlr3-LT(3), antlr3-LTT(3), antlr3-recognitionException(3), antlr3-semanticPredicate(3), antlr3-serializeNode(3), antlr3-serializeText(3), antlr3-serializeToken(3), antlr3-sockSend(3), antlr3-terminate(3) and antlr3-transmit(3) are aliases of antlr3debughandlers.c(3).

Tue Oct 4 2016 Version 3.3.1 ANTLR3C