You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Antonio Petrelli <an...@gmail.com> on 2010/10/04 17:48:43 UTC

[Engine-2.0] AST nodes modified after generation?

Hi all
I am trying to remove files generated by JavaCC, to let them being
generated by the JavaCC Maven plugin.
However I notice that some AST nodes files seem to be modified after
they are generated, for example ASTReference (a complex "init"
method), ASTDirective (a setDirectiveName method), ASTEscape (a "val"
public field).
Am I right or am I missing something?

Thanks
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Re: [Engine-2.0] AST nodes modified after generation?

Posted by Raymond He <ra...@gmail.com>.
Can you show the vm source and node structure ?

2010/10/4, Antonio Petrelli <an...@gmail.com>:
> Hi all
> I am trying to remove files generated by JavaCC, to let them being
> generated by the JavaCC Maven plugin.
> However I notice that some AST nodes files seem to be modified after
> they are generated, for example ASTReference (a complex "init"
> method), ASTDirective (a setDirectiveName method), ASTEscape (a "val"
> public field).
> Am I right or am I missing something?
>
> Thanks
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>

-- 
从我的移动设备发送

*Kun He*  (or Raymond He)
A Java Programmer
Alibaba inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Re: [Engine-2.0] AST nodes modified after generation?

Posted by Will Glass-Husain <wg...@gmail.com>.
JavaCC builds those files, but they've been modified and moved to a
different package.  Hence the build script deletes the skeleton versions
when they are generated.

WILL

On Tue, Oct 5, 2010 at 2:50 AM, Antonio Petrelli <antonio.petrelli@gmail.com
> wrote:

> 2010/10/5 Claude Brisson <cl...@renegat.net>:
> > I'm not sure it is worth the effort, since tuning the grammar shouldn't
> > impact those files. And in fact, AST files are more easily changed as
> plain
> > independant files.
>
> Probably you're right. Anyway I am trying to introduce a node factory
> to see if it helps.
> And, about the effort, I am just having fun playing with it ;-)
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>

Re: [Engine-2.0] AST nodes modified after generation?

Posted by Antonio Petrelli <an...@gmail.com>.
2010/10/5 Claude Brisson <cl...@renegat.net>:
> I'm not sure it is worth the effort, since tuning the grammar shouldn't
> impact those files. And in fact, AST files are more easily changed as plain
> independant files.

Probably you're right. Anyway I am trying to introduce a node factory
to see if it helps.
And, about the effort, I am just having fun playing with it ;-)

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Re: [Engine-2.0] AST nodes modified after generation?

Posted by Claude Brisson <cl...@renegat.net>.
On 05/10/2010 10:59, Antonio Petrelli wrote:
> 2010/10/4 Nathan Bubna<nb...@gmail.com>:
>    
>> No.  Usually, after i run the 'ant parser' task, the only file i need
>> to tweak is the JJTParserState class, to re-add a need import
>> statement.   And those three classes you mentioned are not generated
>> by 'ant parser'.  Perhaps they were once, long ago, but they've been
>> hand-edited for a long time.
>>      
> In fact I read this at the end of "build.sh":
>
> <snip>
> rm -f AST*
> rm -f Node.java
> rm -f SimpleNode.java
> rm -f ParserVisitor.java
> </snip>
>
> So JJTree generates them and kills them. I will try to re-enable
> automatic generation, since it is a waste IMHO.
>    

I'm not sure it is worth the effort, since tuning the grammar shouldn't 
impact those files. And in fact, AST files are more easily changed as 
plain independant files.


   Claude

> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Re: [Engine-2.0] AST nodes modified after generation?

Posted by Antonio Petrelli <an...@gmail.com>.
2010/10/4 Nathan Bubna <nb...@gmail.com>:
> No.  Usually, after i run the 'ant parser' task, the only file i need
> to tweak is the JJTParserState class, to re-add a need import
> statement.   And those three classes you mentioned are not generated
> by 'ant parser'.  Perhaps they were once, long ago, but they've been
> hand-edited for a long time.

In fact I read this at the end of "build.sh":

<snip>
rm -f AST*
rm -f Node.java
rm -f SimpleNode.java
rm -f ParserVisitor.java
</snip>

So JJTree generates them and kills them. I will try to re-enable
automatic generation, since it is a waste IMHO.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Re: [Engine-2.0] AST nodes modified after generation?

Posted by Nathan Bubna <nb...@gmail.com>.
No.  Usually, after i run the 'ant parser' task, the only file i need
to tweak is the JJTParserState class, to re-add a need import
statement.   And those three classes you mentioned are not generated
by 'ant parser'.  Perhaps they were once, long ago, but they've been
hand-edited for a long time.

On Mon, Oct 4, 2010 at 8:48 AM, Antonio Petrelli
<an...@gmail.com> wrote:
> Hi all
> I am trying to remove files generated by JavaCC, to let them being
> generated by the JavaCC Maven plugin.
> However I notice that some AST nodes files seem to be modified after
> they are generated, for example ASTReference (a complex "init"
> method), ASTDirective (a setDirectiveName method), ASTEscape (a "val"
> public field).
> Am I right or am I missing something?
>
> Thanks
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org