예제 #1
0
ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM
antlr3RewriteRuleTokenStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_UINT8 description, void * oneElement)
{
    pANTLR3_REWRITE_RULE_TOKEN_STREAM	stream;

    /* First job is to create the memory we need.
     */
    stream	= antlr3RewriteRuleElementStreamNewAEE(adaptor, description, oneElement);

    /* Install the token based overrides
     */
    stream->dup	    = dupTok;
    stream->toTree  = toTreeToken;

    /* No nextNode implementation for a token rewrite stream */
    return stream;
}
ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM 
antlr3RewriteRuleNODEStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement)
{
	pANTLR3_REWRITE_RULE_NODE_STREAM	stream;

	// First job is to create the memory we need.
	//
	stream	= antlr3RewriteRuleElementStreamNewAEE(adaptor, rec, description, oneElement);

	// Install the node based overrides
	//
	stream->dup			= dupTreeNode;
	stream->toTree		= toTreeNode;
	stream->nextNode	= nextNodeNode;
    stream->free        = freeNodeRS;

	return stream;
}
ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM 
antlr3RewriteRuleTOKENStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement)
{
	pANTLR3_REWRITE_RULE_TOKEN_STREAM	stream;

	// First job is to create the memory we need.
	//
	stream	= antlr3RewriteRuleElementStreamNewAEE(adaptor, rec, description, oneElement);

	// Install the token based overrides
	//
	stream->dup			= dupTok;
	stream->nextNode	= nextNodeToken;

	// No nextNode implementation for a token rewrite stream
	//
	return stream;
}
예제 #4
0
ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM
antlr3RewriteRuleSubtreeStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_UINT8 description, void * oneElement)
{
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM	stream;

    /* First job is to create the memory we need.
     */
    stream	= antlr3RewriteRuleElementStreamNewAEE(adaptor, description, oneElement);

    if (stream == (pANTLR3_REWRITE_RULE_SUBTREE_STREAM)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM))
    {
        return stream;
    }

    /* Install the token based overrides
     */
    stream->dup		= dupTree;
    stream->toTree	= toTreeTree;
    stream->nextNode	= nextNode;

    return stream;
}