Hi all,
I am trying to add a imaginary Token while parsing an AST. The tricky par is 
that I need to set the text of the imaginary token or node from the result of a 
C++-Method.
How should this be made right - adding the imaginary node in the rewrite rule 
and setting the text within an action?

Here is my current rule:
step: ^(STEP stepcontents?) ->
{
pANTLR3_BASE_TREE pStep = $STEP;
pANTLR3_BASE_TREE pStepContents = (pANTLR3_BASE_TREE)pStep->getChild(pStep,0);
if(pStepContents)
{
char* code = 
createCStringPlain(ParserHelper::getCodeTranslation(CodeTranslationID(1), 
QString((char*)pStepContents->getText(pStepContents)->chars)));
pANTLR3_BASE_TREE pCode = 
(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR,STEPCODE,
(pANTLR3_UINT8) code);
pStep->addChild(pStep,pCode);
}
} 
;
T
Hx in advance


Mit freundlichem Gruß

Heiko Folkerts

-- 
_______________________________________________________

DAVID Software GmbH · Wendenring 1 · 38114 Braunschweig

Tel.: +49 531 24379-14
Fax.: +49 531 24379-79

E-Mail: mailto:[email protected]
WWW:    http://www.david-software.de

Eintragung: Amtsgericht Braunschweig, HRB 3167
Geschäftsführer: Frank Ptok 
_______________________________________________________

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to