[stringtemplate-interest] 2. Attempt: ANTLR code generation target/Stringtemplate: modifying the C-Runtime I
Udo Weik
WeikEngOff at aol.com
Thu Jan 19 08:29:45 PST 2012
Hello Terence,
> Hi Udo, IJust spent a few minutes trying to figure out exactly
> what's going on with your issue: missing<token> value, but
> without digging through all of the ANTLR templates and the code
> that injects attributes, I'm afraid I won't be able to track
> down why attribute token has no value. Sorry.
we know now that honey badger is a bad ass, but will need some
time to grow. So I must use the current version of ANTLR. Is
it possible that you now spent some time and help me to find
the problem?
Thanks in advance and greetings
Udo
>> 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
More information about the stringtemplate-interest
mailing list