[stringtemplate-interest] 2. Attempt: ANTLR code generation target/Stringtemplate: modifying the C-Runtime I

Udo Weik WeikEngOff at aol.com
Fri Nov 25 17:40:07 PST 2011


Hello Terence,

thanks for your answer!
I know, I know your students and the end of the year....

>> I startet to modify the C-Runtime and have a first bunch of
>> questions. Be sure, more will follow - "Eeek, what a pain!"...
>>
>> 1.<token>  in<action>
>>      I need the token of an rule in the<action>-section
>>      /** How to execute an action (when not backtracking) */
>>      execAction(action) ::=<<
>>      <if(backtracking)>
>>      <if(actions.(actionScope).synpredgate)>
>>      if (<actions.(actionScope).synpredgate>  )
>>      ...
>>      <ruleDescriptor.name>  and<ruleName>  are replaced (what is the
>>      difference?) but<token>  not. Why?
>
> So in the execAction template you want to reference<token>? What do you mean by token in a rule? you can get a tree for the rule in the Rule object:
>
> 	/** The AST representing the whole rule */
> 	public GrammarAST tree;

Attached you will find a pdf-file which explains my problem -
state-of-the-art highlighted in colour!
And then there is still the question:
   <ruleDescriptor.name> and <ruleName> what is the difference?

I asked Jim already - I just copied his template-dir, renamed the
file C.stg to CRtMod1a.stg and added my "pathfinder"-comments
beginning with //! , followed by tg__ (test grammar) or tt__
(test template). Only the *.c-file is generated, the *.h-file
is missing. Why?


Again many thanks and greetings
Udo





-------------- next part --------------
A non-text attachment was scrubbed...
Name: CRtMod1a__Test1aParser.pdf
Type: application/pdf
Size: 6296 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20111126/d7dbb360/attachment.pdf 


More information about the stringtemplate-interest mailing list