Missing Parser and ParserConstants file

View: New views
7 Messages — Rating Filter:   Alert me  

Missing Parser and ParserConstants file

by Brent Easton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am looking at using BeanShell in a project I work on, so will be active for a while. I have decided to use Beanshell2 as my base.

Is there a reason Parser.java and ParserConstants.java is missing from the BeanShell2 archive? As a copy of the latest bsh library is not included, the project will not compile cleanly within Eclipse. I've got around it merely by copying over the bsh jar file, I'm just wondering about the reasoning?

Cheers,
Brent.

Re: Missing Parser and ParserConstants file

by fschmidt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Brent Easton wrote:
Is there a reason Parser.java and ParserConstants.java is missing from the BeanShell2 archive?
These files are generated from bsh.jjt using javacc .  When bsh.jjt is changed, these files need to be regenerated.  You can find javacc.jar in beanshell2/lib and you can add that to your classpath.  Then you need to do:

java jjtree bsh.jjt
java javacc bsh.jj

Re: Missing Parser and ParserConstants file

by Brent Easton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

fschmidt wrote:
These files are generated from bsh.jjt using javacc .  When bsh.jjt is changed, these files need to be regenerated.  You can find javacc.jar in beanshell2/lib and you can add that to your classpath.  Then you need to do:

java jjtree bsh.jjt
java javacc bsh.jj
Yes, that's all very well, but as I have no need or desire to install either jjtree or javacc, those generated files should be included in the repository. If you modify bsh.jjt, you should regenerate the other files and book them in. How often is that likely to happen?

Regards,
Brent.

Re: Missing Parser and ParserConstants file

by fschmidt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Brent Easton wrote:
Yes, that's all very well, but as I have no need or desire to install either jjtree or javacc,
There is no need to install anything.  As I said, javacc.jar is in the beanshell2 tree and you just have to add it to your classpath.

those generated files should be included in the repository. If you modify bsh.jjt, you should regenerate the other files and book them in. How often is that likely to happen?
I modified bsh.jjt in about half of my recent check-ins.  If I include generated files, there is a risk that someone will edit a generated file manually and check it in, which is wrong.  It also makes it harder to review subversion changes because I would have to remember which files are generated (and there are more than just Parser and ParserConstants) and ignore those.

Re: Missing Parser and ParserConstants file

by Brent Easton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


There is no need to install anything.  As I said, javacc.jar is in the beanshell2 tree and you just have to add it to your classpath.


jjtree is not included, therefore I have to install it.

I modified bsh.jjt in about half of my recent check-ins.  
Ah, so it is for the convenience of the lead developer. This attitude has been the death of many an open-source project.

If I include generated files, there is a risk that someone will edit a generated file manually and check it in, which is wrong.  
You can't stop idiots from acting, but svn makes it easy to see what they have done and undo it. I think this is pretty unlikely.

It also makes it harder to review subversion changes because I would have to remember which files are generated (and there are more than just Parser and ParserConstants) and ignore those.
Not if you check in all of the generated files and let svn do it's thing properly.

I consider it an error to have an incomplete version of the source in svn that doesn't compile. But hey, it's your project, so good luck to you.

Brent.

Re: Missing Parser and ParserConstants file

by Brent Easton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Brent Easton wrote:
jjtree is not included, therefore I have to install it.
Ok, I finally found jjtree inside the javacc.jar.

I really don't want to have to rebuild those files everytime you change the parser. It just doesn't make sense.

B.

Re: Missing Parser and ParserConstants file

by fschmidt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Brent Easton wrote:
I modified bsh.jjt in about half of my recent check-ins.  
Ah, so it is for the convenience of the lead developer. This attitude has been the death of many an open-source project.
I don't think of myself as a lead developer.  BeanShell is just one of many tools that I use, and I don't spend more than a few hours per year on it.  I created the BeanShell2 project just so other people like me could share our fixes.

It also makes it harder to review subversion changes because I would have to remember which files are generated (and there are more than just Parser and ParserConstants) and ignore those.
Not if you check in all of the generated files and let svn do it's thing properly.
I don't see how this solves it.  If I see a change in a file, I won't know if the change was from a manual edit or from a generated file unless I remember which are the generated files.

I consider it an error to have an incomplete version of the source in svn that doesn't compile. But hey, it's your project, so good luck to you.
It does compile.  It just needs one pre-compile step using tools provided with the source.

It isn't my project.  It belongs to anyone who wants to contribute.  I think the fair thing is to go with majority opinion.  So if you want to contribute and one other person wants to contribute and also wants to include generated files in subversion, then I would accept this.
LightInTheBox - Buy quality products at wholesale price!