You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by sangeeta lal <sa...@gmail.com> on 2016/05/19 14:52:08 UTC

Regarding files generated by "JJTree"

Dear Dev Team,


I am Sangeeta. I am a PhD Scholar in the area of automated software
engineering. I am currently studying source code of Apache Tomcat project.
While studying the source code. I noticed a folder in Apache Tomcat project
consisting of 58 files having following line written in them:


"/* *Generated By:JJTree: Do not edit this line. AstLambdaExpression.java
Version 4.3 */"*


Can anyone please explain me little about the meaning of this line? Are all
such files  generated by this tool have no contribution from the human
developers?

I highly appreciate your help!

Thanks You
Sangeeta

-- 
Regards...
Sangeeta
Assistant Professor
CSE Department @JIIT Noida

Re: Regarding files generated by "JJTree"

Posted by Mark Thomas <ma...@apache.org>.
On 20/05/2016 12:23, Martin Grigorov wrote:
> Hi,
> 
> I guess your question is related to
> http://markmail.org/message/kw4erakv272hsy3o where someone else already
> told you about JavaCC.
> AFAIK JavaCC is the only tool used by Tomcat that generates classes.

Martin is correct.

Note: There was a brief time where we looked at using a JavaCC based
parser for HTTP headers but the performance was poor.

> The number of classes depends on the parser rules so it could be N today
> and M tomorrow.

Indeed. It is unlikely to change in any given major version once there
is a stable release since the El specification won't change but
occasionally, bug fixes do change the parser rules.

> Just grep the sources for this header and use the returned number.

+1.

Mark


> 
> 
> On Fri, May 20, 2016 at 12:01 PM, sangeeta lal <sa...@gmail.com>
> wrote:
> 
>> Dear Sir,
>>
>> *Thanks for your reply!*
>>
>> Could you please tell me,  if there is any listing about all the  auto-
>> generated files. I have manually identified 59 files in the folder "
>> *tomcat\java\org\apache\el\parser*" which are auto generated.
>>
>> I have following two questions:
>>
>> 1. Can tomcat project have auto-generated files in some other folder also?
>> 2. Is the "JavaCC" only tool which is used to auto-generate the files ? or
>> there are some other tools as well?
>>
>>
>> I highly *appreciate your help* and time!
>>
>> Thank You
>> Sangeeta
>>
>> On Fri, May 20, 2016 at 3:14 PM, Martin Grigorov <mg...@apache.org>
>> wrote:
>>
>>> Hello Sangeeta,
>>>
>>> Yes, those files are auto-generated by a tool: https://javacc.java.net/.
>>>
>>>
>>> On Fri, May 20, 2016 at 11:41 AM, sangeeta lal <sa...@gmail.com>
>>> wrote:
>>>
>>>> Dear Dev Team,
>>>>
>>>> Can anyone please give me little information about these files?
>>>>
>>>> Thank You
>>>>
>>>> On Thu, May 19, 2016 at 8:22 PM, sangeeta lal <sangeeta.69b1@gmail.com
>>>
>>>> wrote:
>>>>
>>>>>
>>>>> Dear Dev Team,
>>>>>
>>>>>
>>>>> I am Sangeeta. I am a PhD Scholar in the area of automated software
>>>>> engineering. I am currently studying source code of Apache Tomcat
>>>> project.
>>>>> While studying the source code. I noticed a folder in Apache Tomcat
>>>> project
>>>>> consisting of 58 files having following line written in them:
>>>>>
>>>>>
>>>>> "/* *Generated By:JJTree: Do not edit this line.
>>> AstLambdaExpression.java
>>>>> Version 4.3 */"*
>>>>>
>>>>>
>>>>> Can anyone please explain me little about the meaning of this line?
>> Are
>>>>> all such files  generated by this tool have no contribution from the
>>>> human
>>>>> developers?
>>>>>
>>>>> I highly appreciate your help!
>>>>>
>>>>> Thanks You
>>>>> Sangeeta
>>>>>
>>>>> --
>>>>> Regards...
>>>>> Sangeeta
>>>>> Assistant Professor
>>>>> CSE Department @JIIT Noida
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Regards...
>>>> Sangeeta
>>>> Assistant Professor
>>>> CSE Department @JIIT Noida
>>>>
>>>
>>
>>
>>
>> --
>> Regards...
>> Sangeeta
>> Assistant Professor
>> CSE Department @JIIT Noida
>>
> 


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


Re: Regarding files generated by "JJTree"

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I guess your question is related to
http://markmail.org/message/kw4erakv272hsy3o where someone else already
told you about JavaCC.
AFAIK JavaCC is the only tool used by Tomcat that generates classes.
The number of classes depends on the parser rules so it could be N today
and M tomorrow.
Just grep the sources for this header and use the returned number.


On Fri, May 20, 2016 at 12:01 PM, sangeeta lal <sa...@gmail.com>
wrote:

> Dear Sir,
>
> *Thanks for your reply!*
>
> Could you please tell me,  if there is any listing about all the  auto-
> generated files. I have manually identified 59 files in the folder "
> *tomcat\java\org\apache\el\parser*" which are auto generated.
>
> I have following two questions:
>
> 1. Can tomcat project have auto-generated files in some other folder also?
> 2. Is the "JavaCC" only tool which is used to auto-generate the files ? or
> there are some other tools as well?
>
>
> I highly *appreciate your help* and time!
>
> Thank You
> Sangeeta
>
> On Fri, May 20, 2016 at 3:14 PM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Hello Sangeeta,
> >
> > Yes, those files are auto-generated by a tool: https://javacc.java.net/.
> >
> >
> > On Fri, May 20, 2016 at 11:41 AM, sangeeta lal <sa...@gmail.com>
> > wrote:
> >
> > > Dear Dev Team,
> > >
> > > Can anyone please give me little information about these files?
> > >
> > > Thank You
> > >
> > > On Thu, May 19, 2016 at 8:22 PM, sangeeta lal <sangeeta.69b1@gmail.com
> >
> > > wrote:
> > >
> > > >
> > > > Dear Dev Team,
> > > >
> > > >
> > > > I am Sangeeta. I am a PhD Scholar in the area of automated software
> > > > engineering. I am currently studying source code of Apache Tomcat
> > > project.
> > > > While studying the source code. I noticed a folder in Apache Tomcat
> > > project
> > > > consisting of 58 files having following line written in them:
> > > >
> > > >
> > > > "/* *Generated By:JJTree: Do not edit this line.
> > AstLambdaExpression.java
> > > > Version 4.3 */"*
> > > >
> > > >
> > > > Can anyone please explain me little about the meaning of this line?
> Are
> > > > all such files  generated by this tool have no contribution from the
> > > human
> > > > developers?
> > > >
> > > > I highly appreciate your help!
> > > >
> > > > Thanks You
> > > > Sangeeta
> > > >
> > > > --
> > > > Regards...
> > > > Sangeeta
> > > > Assistant Professor
> > > > CSE Department @JIIT Noida
> > > >
> > > >
> > >
> > >
> > > --
> > > Regards...
> > > Sangeeta
> > > Assistant Professor
> > > CSE Department @JIIT Noida
> > >
> >
>
>
>
> --
> Regards...
> Sangeeta
> Assistant Professor
> CSE Department @JIIT Noida
>

Re: Regarding files generated by "JJTree"

Posted by sangeeta lal <sa...@gmail.com>.
Dear Martin, Mark, Konstantin and dev team,

I highly appreciate you inputs and time. Its a great help for my project.



Thank You
Sangeeta

On Fri, May 20, 2016 at 5:38 PM, Konstantin Kolinko <kn...@gmail.com>
wrote:

> 2016-05-20 13:01 GMT+03:00 sangeeta lal <sa...@gmail.com>:
> > Dear Sir,
> >
> > *Thanks for your reply!*
> >
> > Could you please tell me,  if there is any listing about all the  auto-
> > generated files. I have manually identified 59 files in the folder "
> > *tomcat\java\org\apache\el\parser*" which are auto generated.
>
> ELParser.jjt is the source.
>
> ELParser.java was generated.
> Some helper classes (Node.java, SimpleNode.java, ..) are generated /
> provided by the tool.
>
> The Ast* files - a stub was generated, but the rest is written by a
> human developer.
>
> ELParser.html is a report from generation tool.
>
>
> Java CC site has a manual, with examples.
> https://javacc.java.net/doc/docindex.html
> https://javacc.java.net/doc/JJTree.html
>
> In short, JavaCC is a lexical parser that can perform some Java code
> when some lexical element is encountered. Coupling it with JJTree
> turns that Java code into code that produces a tree of Node elements.
>
> The behaviour of those nodes it then programmed by a human.  My
> understanding is that by default those Ast classes have only a
> constructor, but no other methods.  Some methods are declared in
> SimpleNode class and can be overridden in specific classes, e.g.
> AstIdentifier overrides setImage().
>
> Some of default classes were edited by adding additional methods. E.g.
> methods with an EvaluationContext argument in SimpleNode class were
> added.
>
>
> > I have following two questions:
> >
> > 1. Can tomcat project have auto-generated files in some other folder
> also?
> > 2. Is the "JavaCC" only tool which is used to auto-generate the files ?
> or
> > there are some other tools as well?
> >
>
> There are some classes from other projects that are preprocessed (by
> renaming the packages) and recompiled.
>
> All versions of Tomcat do so for Apache Commons Logging library when
> it is built as an "extras" package.
>
> See <target name="extras-commons-logging" in build.xml. It is just
> textual replacement, with
>
>     <replace
> dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/main/java/org/apache/commons"
>         encoding="ISO-8859-1">
>       <replacefilter token="org.apache.commons"
>             value="org.apache.juli" />
>     </replace>
>
>
>
> Older versions of Tomcat also did so for Apache Commons Pool and
> Apache Commons DBCP libraries, but Tomcat 8.0 and later has an own
> copy of those libraries in it source tree.
>
>
> This is about *.java files. There is also documentation (xml -> html),
> javadoc (java -> html).
>
>
> The mailing list rules:
> http://tomcat.apache.org/lists.html#tomcat-users
> -> 6. Top-posting is bad.
>
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>


-- 
Regards...
Sangeeta
Assistant Professor
CSE Department @JIIT Noida

Re: Regarding files generated by "JJTree"

Posted by Konstantin Kolinko <kn...@gmail.com>.
2016-05-20 13:01 GMT+03:00 sangeeta lal <sa...@gmail.com>:
> Dear Sir,
>
> *Thanks for your reply!*
>
> Could you please tell me,  if there is any listing about all the  auto-
> generated files. I have manually identified 59 files in the folder "
> *tomcat\java\org\apache\el\parser*" which are auto generated.

ELParser.jjt is the source.

ELParser.java was generated.
Some helper classes (Node.java, SimpleNode.java, ..) are generated /
provided by the tool.

The Ast* files - a stub was generated, but the rest is written by a
human developer.

ELParser.html is a report from generation tool.


Java CC site has a manual, with examples.
https://javacc.java.net/doc/docindex.html
https://javacc.java.net/doc/JJTree.html

In short, JavaCC is a lexical parser that can perform some Java code
when some lexical element is encountered. Coupling it with JJTree
turns that Java code into code that produces a tree of Node elements.

The behaviour of those nodes it then programmed by a human.  My
understanding is that by default those Ast classes have only a
constructor, but no other methods.  Some methods are declared in
SimpleNode class and can be overridden in specific classes, e.g.
AstIdentifier overrides setImage().

Some of default classes were edited by adding additional methods. E.g.
methods with an EvaluationContext argument in SimpleNode class were
added.


> I have following two questions:
>
> 1. Can tomcat project have auto-generated files in some other folder also?
> 2. Is the "JavaCC" only tool which is used to auto-generate the files ? or
> there are some other tools as well?
>

There are some classes from other projects that are preprocessed (by
renaming the packages) and recompiled.

All versions of Tomcat do so for Apache Commons Logging library when
it is built as an "extras" package.

See <target name="extras-commons-logging" in build.xml. It is just
textual replacement, with

    <replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/main/java/org/apache/commons"
        encoding="ISO-8859-1">
      <replacefilter token="org.apache.commons"
            value="org.apache.juli" />
    </replace>



Older versions of Tomcat also did so for Apache Commons Pool and
Apache Commons DBCP libraries, but Tomcat 8.0 and later has an own
copy of those libraries in it source tree.


This is about *.java files. There is also documentation (xml -> html),
javadoc (java -> html).


The mailing list rules:
http://tomcat.apache.org/lists.html#tomcat-users
-> 6. Top-posting is bad.


Best regards,
Konstantin Kolinko

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


Re: Regarding files generated by "JJTree"

Posted by sangeeta lal <sa...@gmail.com>.
Dear Sir,

*Thanks for your reply!*

Could you please tell me,  if there is any listing about all the  auto-
generated files. I have manually identified 59 files in the folder "
*tomcat\java\org\apache\el\parser*" which are auto generated.

I have following two questions:

1. Can tomcat project have auto-generated files in some other folder also?
2. Is the "JavaCC" only tool which is used to auto-generate the files ? or
there are some other tools as well?


I highly *appreciate your help* and time!

Thank You
Sangeeta

On Fri, May 20, 2016 at 3:14 PM, Martin Grigorov <mg...@apache.org>
wrote:

> Hello Sangeeta,
>
> Yes, those files are auto-generated by a tool: https://javacc.java.net/.
>
>
> On Fri, May 20, 2016 at 11:41 AM, sangeeta lal <sa...@gmail.com>
> wrote:
>
> > Dear Dev Team,
> >
> > Can anyone please give me little information about these files?
> >
> > Thank You
> >
> > On Thu, May 19, 2016 at 8:22 PM, sangeeta lal <sa...@gmail.com>
> > wrote:
> >
> > >
> > > Dear Dev Team,
> > >
> > >
> > > I am Sangeeta. I am a PhD Scholar in the area of automated software
> > > engineering. I am currently studying source code of Apache Tomcat
> > project.
> > > While studying the source code. I noticed a folder in Apache Tomcat
> > project
> > > consisting of 58 files having following line written in them:
> > >
> > >
> > > "/* *Generated By:JJTree: Do not edit this line.
> AstLambdaExpression.java
> > > Version 4.3 */"*
> > >
> > >
> > > Can anyone please explain me little about the meaning of this line? Are
> > > all such files  generated by this tool have no contribution from the
> > human
> > > developers?
> > >
> > > I highly appreciate your help!
> > >
> > > Thanks You
> > > Sangeeta
> > >
> > > --
> > > Regards...
> > > Sangeeta
> > > Assistant Professor
> > > CSE Department @JIIT Noida
> > >
> > >
> >
> >
> > --
> > Regards...
> > Sangeeta
> > Assistant Professor
> > CSE Department @JIIT Noida
> >
>



-- 
Regards...
Sangeeta
Assistant Professor
CSE Department @JIIT Noida

Re: Regarding files generated by "JJTree"

Posted by Martin Grigorov <mg...@apache.org>.
Hello Sangeeta,

Yes, those files are auto-generated by a tool: https://javacc.java.net/.


On Fri, May 20, 2016 at 11:41 AM, sangeeta lal <sa...@gmail.com>
wrote:

> Dear Dev Team,
>
> Can anyone please give me little information about these files?
>
> Thank You
>
> On Thu, May 19, 2016 at 8:22 PM, sangeeta lal <sa...@gmail.com>
> wrote:
>
> >
> > Dear Dev Team,
> >
> >
> > I am Sangeeta. I am a PhD Scholar in the area of automated software
> > engineering. I am currently studying source code of Apache Tomcat
> project.
> > While studying the source code. I noticed a folder in Apache Tomcat
> project
> > consisting of 58 files having following line written in them:
> >
> >
> > "/* *Generated By:JJTree: Do not edit this line. AstLambdaExpression.java
> > Version 4.3 */"*
> >
> >
> > Can anyone please explain me little about the meaning of this line? Are
> > all such files  generated by this tool have no contribution from the
> human
> > developers?
> >
> > I highly appreciate your help!
> >
> > Thanks You
> > Sangeeta
> >
> > --
> > Regards...
> > Sangeeta
> > Assistant Professor
> > CSE Department @JIIT Noida
> >
> >
>
>
> --
> Regards...
> Sangeeta
> Assistant Professor
> CSE Department @JIIT Noida
>

Re: Regarding files generated by "JJTree"

Posted by sangeeta lal <sa...@gmail.com>.
Dear Dev Team,

Can anyone please give me little information about these files?

Thank You

On Thu, May 19, 2016 at 8:22 PM, sangeeta lal <sa...@gmail.com>
wrote:

>
> Dear Dev Team,
>
>
> I am Sangeeta. I am a PhD Scholar in the area of automated software
> engineering. I am currently studying source code of Apache Tomcat project.
> While studying the source code. I noticed a folder in Apache Tomcat project
> consisting of 58 files having following line written in them:
>
>
> "/* *Generated By:JJTree: Do not edit this line. AstLambdaExpression.java
> Version 4.3 */"*
>
>
> Can anyone please explain me little about the meaning of this line? Are
> all such files  generated by this tool have no contribution from the human
> developers?
>
> I highly appreciate your help!
>
> Thanks You
> Sangeeta
>
> --
> Regards...
> Sangeeta
> Assistant Professor
> CSE Department @JIIT Noida
>
>


-- 
Regards...
Sangeeta
Assistant Professor
CSE Department @JIIT Noida