antlr3-mismatch (3) - Linux Manuals

NAME

src/antlr3treeparser.c -

Implementation of the tree parser and overrides for the base recognizer.

SYNOPSIS


#include <antlr3treeparser.h>

Functions


ANTLR3_API void antlr3MTNExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer)
Creates a new Mismatched Tree Nde Exception and inserts in the recognizer exception stack.
ANTLR3_API pANTLR3_TREE_PARSER antlr3TreeParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state)

static void freeParser (pANTLR3_TREE_PARSER parser)

static void * getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream)

static void * getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow)

static pANTLR3_COMMON_TREE_NODE_STREAM getTreeNodeStream (pANTLR3_TREE_PARSER parser)
Return a pointer to the input stream.
static void mismatch (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow)
Override for standard base recognizer mismatch function as we have DOWN/UP nodes in the stream that have no line info, plus we want to alter the exception type.
static void setTreeNodeStream (pANTLR3_TREE_PARSER parser, pANTLR3_COMMON_TREE_NODE_STREAM input)
Set the input stream and reset the parser.

Detailed Description

Implementation of the tree parser and overrides for the base recognizer.

Function Documentation

ANTLR3_API void antlr3MTNExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer)

Creates a new Mismatched Tree Nde Exception and inserts in the recognizer exception stack. Parameters:

recognizer Context pointer for this recognizer

References ANTLR3_MISMATCHED_TREE_NODE_EXCEPTION, ANTLR3_MISMATCHED_TREE_NODE_NAME, antlr3RecognitionExceptionNew(), ANTLR3_RECOGNIZER_SHARED_STATE_struct::exception, ANTLR3_EXCEPTION_struct::name, ANTLR3_BASE_RECOGNIZER_struct::state, and ANTLR3_EXCEPTION_struct::type.

Referenced by antlr3TreeParserNewStream().

ANTLR3_API pANTLR3_TREE_PARSER antlr3TreeParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state)

Allocate tree parser memory

References ANTLR3_MALLOC, ANTLR3_TYPE_PARSER, ANTLR3_TYPE_TREE_PARSER, antlr3BaseRecognizerNew(), antlr3MTNExceptionNew(), ANTLR3_BASE_RECOGNIZER_struct::exConstruct, ANTLR3_TREE_PARSER_struct::free, freeParser(), getCurrentInputSymbol(), ANTLR3_BASE_RECOGNIZER_struct::getCurrentInputSymbol, getMissingSymbol(), ANTLR3_BASE_RECOGNIZER_struct::getMissingSymbol, getTreeNodeStream(), ANTLR3_TREE_PARSER_struct::getTreeNodeStream, mismatch(), ANTLR3_BASE_RECOGNIZER_struct::mismatch, ANTLR3_TREE_PARSER_struct::rec, setTreeNodeStream(), ANTLR3_TREE_PARSER_struct::setTreeNodeStream, ANTLR3_BASE_RECOGNIZER_struct::super, and ANTLR3_BASE_RECOGNIZER_struct::type.

static void freeParser (pANTLR3_TREE_PARSER parser) [static]

References ANTLR3_FREE, ANTLR3_RECOGNIZER_SHARED_STATE_struct::following, ANTLR3_BASE_RECOGNIZER_struct::free, ANTLR3_STACK_struct::free, ANTLR3_TREE_PARSER_struct::rec, and ANTLR3_BASE_RECOGNIZER_struct::state.

Referenced by antlr3TreeParserNewStream().

static void * getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream) [static]

References ANTLR3_TREE_NODE_STREAM_struct::_LT, ANTLR3_TREE_NODE_STREAM_struct::ctns, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3TreeParserNewStream().

static void * getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow) [static]

References ANTLR3_TREE_NODE_STREAM_struct::_LT, ANTLR3_STRING_struct::append8, ANTLR3_COMMON_TREE_struct::baseTree, ANTLR3_TREE_NODE_STREAM_struct::ctns, ANTLR3_BASE_TREE_struct::dupNode, ANTLR3_COMMON_TREE_NODE_STREAM_struct::EOF_NODE, ANTLR3_COMMON_TOKEN_struct::getText, ANTLR3_BASE_TREE_struct::getToken, ANTLR3_COMMON_TOKEN_struct::setText8, ANTLR3_BASE_RECOGNIZER_struct::state, ANTLR3_BASE_TREE_struct::super, ANTLR3_INT_STREAM_struct::super, and ANTLR3_RECOGNIZER_SHARED_STATE_struct::tokenNames.

Referenced by antlr3TreeParserNewStream().

static pANTLR3_COMMON_TREE_NODE_STREAM getTreeNodeStream (pANTLR3_TREE_PARSER parser) [static]

Return a pointer to the input stream.

References ANTLR3_TREE_PARSER_struct::ctnstream.

Referenced by antlr3TreeParserNewStream().

static void mismatch (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow) [static]

Override for standard base recognizer mismatch function as we have DOWN/UP nodes in the stream that have no line info, plus we want to alter the exception type.

References ANTLR3_BASE_RECOGNIZER_struct::exConstruct, and ANTLR3_BASE_RECOGNIZER_struct::recoverFromMismatchedToken.

Referenced by antlr3TreeParserNewStream().

static void setTreeNodeStream (pANTLR3_TREE_PARSER parser, pANTLR3_COMMON_TREE_NODE_STREAM input) [static]

Set the input stream and reset the parser.

References ANTLR3_TREE_PARSER_struct::ctnstream, ANTLR3_TREE_PARSER_struct::rec, ANTLR3_COMMON_TREE_NODE_STREAM_struct::reset, and ANTLR3_BASE_RECOGNIZER_struct::reset.

Referenced by antlr3TreeParserNewStream().

Author

Generated automatically by Doxygen for ANTLR3C from the source code.