You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Juancarlo A�ez <ju...@suigeneris.org> on 2002/02/27 23:38:13 UTC

[VOTE][maven][jrcs] Removing dependency on JavaCC

I originally used JavaCC as a quick way to get an RCS archive parser. But the format of those archives is so simple that a hand-written parser would be more efficient, and wouldn't be hard to do. My experience with syntax directed lexical analysis makes me think that a hand-made parser would be smaller and faster.

I propose that the dependency on JavaCC be removed from JRCS. It doesn't have to be done right away, but it should be added to the TODO list.

+1

Points in favor of JavaCC: The current parser works and is very easy to understand.

Against JavaCC: The parser cannot be modified without JavaCC, a closed-source package. Developers need the package and knowledge about it to modify the parser. If JavaCC goes away, the parser would be pure Java and undertandable and modifyiable by all.

Juanco
--
Ing. Juancarlo Añez
Modelistica
mailto:juancarlo@modelistica.com
http://www.modelistica.com
telef: (412) 222-1160
       (212) 761-5432
--- 

Re: [VOTE][maven][jrcs] Removing dependency on JavaCC

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Jason van Zyl <jv...@zenplex.com> writes:

> On Wed, 2002-02-27 at 17:38, Juancarlo Añez wrote:
> > 
>> I originally used JavaCC as a quick way to get an RCS archive parser. But the format of those archives is so simple that a hand-written parser would be more efficient, and wouldn't be hard to do. My experience with syntax directed lexical analysis makes me think that a hand-made parser would be smaller and faster.
>> 
>> I propose that the dependency on JavaCC be removed from JRCS. It doesn't have to be done right away, but it should be added to the TODO list.
>> 
>> +1
>> 
>> Points in favor of JavaCC: The current parser works and is very easy to understand.
>
> Even for simple things I really like using JavaCC because it's so well
> known. I know that a hand parser can be written but even for simple
> things I just stick with JavaCC. I just wonder if the speed gained would
> really be worth the added complexity. I leave it to you though because
> I'm probably not going to be in that package any time soon if at all.

I also prefer a generated parser (but do as you will :-).


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [VOTE][maven][jrcs] Removing dependency on JavaCC

Posted by Jason van Zyl <jv...@zenplex.com>.
On Wed, 2002-02-27 at 18:44, Jim Seach wrote:
> Jason,
> 
> Thanks, those are good points.  I've been looking at both, and was
> wondering why Jakarta projects seem to favor JavaCC.

Antlr is supposed to be great, I just never like it. It's just personal
taste. I also think that JavaCC is a bit faster and it's used for all
the sun tools like Javac and Javadoc so when the JavaCC grammars are
updated (and they weren't by webgain, a user contributed a 1.4 grammar)
you pretty much know you're ok.

The only other parser I considered was the aspectj parser which is hand
written so it will eventually be fast (jim is going for correctness
first) and it will obviously handle aspects and I'm interested in aspect
metrics too.

> Jim Seach
> 
> --- Jason van Zyl <jv...@zenplex.com> wrote:
> > On Wed, 2002-02-27 at 18:36, Jim Seach wrote:
> > > 
> > > --- Jason van Zyl <jv...@zenplex.com> wrote:
> > > > On Wed, 2002-02-27 at 17:38, Juancarlo Añez wrote:
> > >  
> > > <snip>
> > > 
> > > > > Against JavaCC: The parser cannot be modified without JavaCC, a
> > > > closed-source package. Developers need the package and knowledge
> > > > about it to modify the parser. If JavaCC goes away, the parser
> > would
> > > > be pure Java and undertandable and modifyiable by all.
> > > > 
> > > > There are ant task to make dealing with JavaCC, and if you really
> > > > want a
> > > > fun task I'll work with you on making an open source JavaCC clone
> > :-)
> > > > Now that would be fun!
> > > 
> > > Why not use Antlr (http://www.antlr.org)?  It is public domain and
> > uses
> > > an LL(k) grammar for both lexing and parsing, which allows for more
> > > powerful lexers than those based on regular expressions.
> > 
> > I never like Antlr grammars, I personally just found JavaCC made more
> > sense to me and it's what I started with because Antlr didn't, and
> > still
> > doesn't as far as I know, handle unicode properly and the Velocity
> > parser needed to deal with unicode properly. I've been using JavaCC
> > every since.
> >  
> > > Jim Seach
> > > 
> > > > 
> > > > > Juanco
> > > > > --
> > > > > Ing. Juancarlo Añez
> > > > > Modelistica
> > > > > mailto:juancarlo@modelistica.com
> > > > > http://www.modelistica.com
> > > > > telef: (412) 222-1160
> > > > >        (212) 761-5432
> > > > > --- 
> > > > -- 
> > > > jvz.
> > > > 
> > > > Jason van Zyl
> > > > jvanzyl@apache.org
> > > > 
> > > > http://tambora.zenplex.org
> > > > 
> > > > 
> > > > --
> > > > To unsubscribe, e-mail:  
> > > > <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > > <ma...@jakarta.apache.org>
> > > > 
> > > 
> > > 
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Greetings - Send FREE e-cards for every occasion!
> > > http://greetings.yahoo.com
> > > 
> > > --
> > > To unsubscribe, e-mail:  
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > -- 
> > jvz.
> > 
> > Jason van Zyl
> > jvanzyl@apache.org
> > 
> > http://tambora.zenplex.org
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Greetings - Send FREE e-cards for every occasion!
> http://greetings.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://tambora.zenplex.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [VOTE][maven][jrcs] Removing dependency on JavaCC

Posted by Jim Seach <jw...@yahoo.com>.
Jason,

Thanks, those are good points.  I've been looking at both, and was
wondering why Jakarta projects seem to favor JavaCC.

Jim Seach

--- Jason van Zyl <jv...@zenplex.com> wrote:
> On Wed, 2002-02-27 at 18:36, Jim Seach wrote:
> > 
> > --- Jason van Zyl <jv...@zenplex.com> wrote:
> > > On Wed, 2002-02-27 at 17:38, Juancarlo A�ez wrote:
> >  
> > <snip>
> > 
> > > > Against JavaCC: The parser cannot be modified without JavaCC, a
> > > closed-source package. Developers need the package and knowledge
> > > about it to modify the parser. If JavaCC goes away, the parser
> would
> > > be pure Java and undertandable and modifyiable by all.
> > > 
> > > There are ant task to make dealing with JavaCC, and if you really
> > > want a
> > > fun task I'll work with you on making an open source JavaCC clone
> :-)
> > > Now that would be fun!
> > 
> > Why not use Antlr (http://www.antlr.org)?  It is public domain and
> uses
> > an LL(k) grammar for both lexing and parsing, which allows for more
> > powerful lexers than those based on regular expressions.
> 
> I never like Antlr grammars, I personally just found JavaCC made more
> sense to me and it's what I started with because Antlr didn't, and
> still
> doesn't as far as I know, handle unicode properly and the Velocity
> parser needed to deal with unicode properly. I've been using JavaCC
> every since.
>  
> > Jim Seach
> > 
> > > 
> > > > Juanco
> > > > --
> > > > Ing. Juancarlo A�ez
> > > > Modelistica
> > > > mailto:juancarlo@modelistica.com
> > > > http://www.modelistica.com
> > > > telef: (412) 222-1160
> > > >        (212) 761-5432
> > > > --- 
> > > -- 
> > > jvz.
> > > 
> > > Jason van Zyl
> > > jvanzyl@apache.org
> > > 
> > > http://tambora.zenplex.org
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail:  
> > > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <ma...@jakarta.apache.org>
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Greetings - Send FREE e-cards for every occasion!
> > http://greetings.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> -- 
> jvz.
> 
> Jason van Zyl
> jvanzyl@apache.org
> 
> http://tambora.zenplex.org
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [VOTE][maven][jrcs] Removing dependency on JavaCC

Posted by Jason van Zyl <jv...@zenplex.com>.
On Wed, 2002-02-27 at 18:36, Jim Seach wrote:
> 
> --- Jason van Zyl <jv...@zenplex.com> wrote:
> > On Wed, 2002-02-27 at 17:38, Juancarlo Añez wrote:
>  
> <snip>
> 
> > > Against JavaCC: The parser cannot be modified without JavaCC, a
> > closed-source package. Developers need the package and knowledge
> > about it to modify the parser. If JavaCC goes away, the parser would
> > be pure Java and undertandable and modifyiable by all.
> > 
> > There are ant task to make dealing with JavaCC, and if you really
> > want a
> > fun task I'll work with you on making an open source JavaCC clone :-)
> > Now that would be fun!
> 
> Why not use Antlr (http://www.antlr.org)?  It is public domain and uses
> an LL(k) grammar for both lexing and parsing, which allows for more
> powerful lexers than those based on regular expressions.

I never like Antlr grammars, I personally just found JavaCC made more
sense to me and it's what I started with because Antlr didn't, and still
doesn't as far as I know, handle unicode properly and the Velocity
parser needed to deal with unicode properly. I've been using JavaCC
every since.
 
> Jim Seach
> 
> > 
> > > Juanco
> > > --
> > > Ing. Juancarlo Añez
> > > Modelistica
> > > mailto:juancarlo@modelistica.com
> > > http://www.modelistica.com
> > > telef: (412) 222-1160
> > >        (212) 761-5432
> > > --- 
> > -- 
> > jvz.
> > 
> > Jason van Zyl
> > jvanzyl@apache.org
> > 
> > http://tambora.zenplex.org
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Greetings - Send FREE e-cards for every occasion!
> http://greetings.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://tambora.zenplex.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JavaCC

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Daniel Rall <dl...@finemaltcoding.com> writes:

> Jim Seach <jw...@yahoo.com> writes:
>
>> On the other hand, if Jason was really serious about developing a
>> JavaCC clone, Antlr could be used as a tool or as a starting point.
>
> JavaCC has changed hands several times.  I spoke briefly with a
> respresentive WebGain representative at the last JavaOne, and it
> appeared that there may be some interest in open sourcing it.
>
> Pursuing that avenue may give some love.

Not as promising, but that doesn't mean we can't persuade some change:

http://www.webgain.com/products/java_cc/usage.html

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JavaCC

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Jim Seach <jw...@yahoo.com> writes:

> On the other hand, if Jason was really serious about developing a
> JavaCC clone, Antlr could be used as a tool or as a starting point.

JavaCC has changed hands several times.  I spoke briefly with a
respresentive WebGain representative at the last JavaOne, and it
appeared that there may be some interest in open sourcing it.

Pursuing that avenue may give some love.

Dan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [VOTE][maven][jrcs] Removing dependency on JavaCC

Posted by Jim Seach <jw...@yahoo.com>.
Juancarlo,

--- Juancarlo Anez <ju...@suigeneris.org> wrote:
> Jim,
> 
> > Why not use Antlr (http://www.antlr.org)?  It is public domain and
> uses
> > an LL(k) grammar for both lexing and parsing, which allows for more
> > powerful lexers than those based on regular expressions.
> 
> That's another option (JavaCC is also an LL(k) parser generator).

But if I understand correctly, JavaCC uses regular expressions to
describe the lexer (along with lexer states, which adds additional
capabilities), while Antlr uses a LL(k) grammar for the lexer also, so
for a simple parsing job like this one, you might only need the lexer.

> 
> Using ANTLR would only resolve the propietary-package aspect. What
> about the rest?

Jason raised some good points.  Since I am only in the investigation
stage for a potential project, I will have to consider them before
making a decision.  One of the things I like about JavaCC is that it
generates the complete code for the parser and lexer, while Antlr
requires some helper jars.  Of course, since it is open source, this
isn't a big problem.

On the other hand, if Jason was really serious about developing a
JavaCC clone, Antlr could be used as a tool or as a starting point.

> 
> Juanco

Jim Seach


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [VOTE][maven][jrcs] Removing dependency on JavaCC

Posted by Juancarlo Anez <ju...@suigeneris.org>.
Jim,

> Why not use Antlr (http://www.antlr.org)?  It is public domain and uses
> an LL(k) grammar for both lexing and parsing, which allows for more
> powerful lexers than those based on regular expressions.

That's another option (JavaCC is also an LL(k) parser generator).

Using ANTLR would only resolve the propietary-package aspect. What about the rest?

Juanco

Re: [VOTE][maven][jrcs] Removing dependency on JavaCC

Posted by Jim Seach <jw...@yahoo.com>.
--- Jason van Zyl <jv...@zenplex.com> wrote:
> On Wed, 2002-02-27 at 17:38, Juancarlo A�ez wrote:
 
<snip>

> > Against JavaCC: The parser cannot be modified without JavaCC, a
> closed-source package. Developers need the package and knowledge
> about it to modify the parser. If JavaCC goes away, the parser would
> be pure Java and undertandable and modifyiable by all.
> 
> There are ant task to make dealing with JavaCC, and if you really
> want a
> fun task I'll work with you on making an open source JavaCC clone :-)
> Now that would be fun!

Why not use Antlr (http://www.antlr.org)?  It is public domain and uses
an LL(k) grammar for both lexing and parsing, which allows for more
powerful lexers than those based on regular expressions.

Jim Seach

> 
> > Juanco
> > --
> > Ing. Juancarlo A�ez
> > Modelistica
> > mailto:juancarlo@modelistica.com
> > http://www.modelistica.com
> > telef: (412) 222-1160
> >        (212) 761-5432
> > --- 
> -- 
> jvz.
> 
> Jason van Zyl
> jvanzyl@apache.org
> 
> http://tambora.zenplex.org
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [VOTE][maven][jrcs] Removing dependency on JavaCC

Posted by Jason van Zyl <jv...@zenplex.com>.
On Wed, 2002-02-27 at 17:38, Juancarlo Añez wrote:
> 
> I originally used JavaCC as a quick way to get an RCS archive parser. But the format of those archives is so simple that a hand-written parser would be more efficient, and wouldn't be hard to do. My experience with syntax directed lexical analysis makes me think that a hand-made parser would be smaller and faster.
> 
> I propose that the dependency on JavaCC be removed from JRCS. It doesn't have to be done right away, but it should be added to the TODO list.
> 
> +1
> 
> Points in favor of JavaCC: The current parser works and is very easy to understand.

Even for simple things I really like using JavaCC because it's so well
known. I know that a hand parser can be written but even for simple
things I just stick with JavaCC. I just wonder if the speed gained would
really be worth the added complexity. I leave it to you though because
I'm probably not going to be in that package any time soon if at all.

> Against JavaCC: The parser cannot be modified without JavaCC, a closed-source package. Developers need the package and knowledge about it to modify the parser. If JavaCC goes away, the parser would be pure Java and undertandable and modifyiable by all.

There are ant task to make dealing with JavaCC, and if you really want a
fun task I'll work with you on making an open source JavaCC clone :-)
Now that would be fun!

> Juanco
> --
> Ing. Juancarlo Añez
> Modelistica
> mailto:juancarlo@modelistica.com
> http://www.modelistica.com
> telef: (412) 222-1160
>        (212) 761-5432
> --- 
-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://tambora.zenplex.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>