You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Alexei Fedotov <al...@gmail.com> on 2008/03/29 15:28:36 UTC

What should we choose for Harmony: JavaCC or AntLR? Was: Google Summer of Code and Harmony

Hello, Aleksey,

This is a good question indeed. Currently both popular parser
generators, i.e. JavaCC and ANTLR, are used in Harmony. We have to
decide which one is the preferable one for your project and overall. I
believe people who have some experience may help us to decide what
suits RTF parser and Harmony better. For your application you may just
note that you are collecting arguments to choose one generator from
two to be most applicable for Harmony instead of naming the only one,
and list the arguments you have already collected.

The licensing of both generators is acceptable. I have heard recent
talks about incompatible change of AntLR license, and cannot confirm
that. It seems that AntLR 3.0 uses conventional BSD license [1].
JavaCC has a proprietary origin [2], but Sun does not claim its rights
for this generator.

There was a conflict between ANTLR from our boot class path and the
one from Dacapo benchmark. I don't think this should be a problem for
RTF parser: one can load classes into another class loader. Vladimir
Beliaev, Paulex and Alexey Varlamov have to say more about this [3].
>From the other side people said that ANTLR provides more
understandable syntax that JavaCC [4], and AFAIK your mentor devoted
his university studies to ANTLR.

Alexei, all, do you have a parser generator preference?

[1] http://www.antlr.org/license.html
[2] http://markmail.org/message/v62n2jt7hvb234fi
[3] http://markmail.org/message/ja64toonfbo26yz5
[4] http://www.theserverside.com/news/thread.tss?thread_id=45464#233154



On Sat, Mar 29, 2008 at 2:01 AM, Aleksey Lagoshin <ay...@gmail.com> wrote:
> Thanks for links and additional information.
>
>  I noticed that CSS parser is created by JavaCC. As far as I know there is
>  another one parser generator - ANTLR. So the question is: which tool is more
>
>  preferred/better JavaCC or ANTLR?
>
>
>  2008/3/28, Tim Ellison <t....@gmail.com>:
>
>
> >
>  > Alexei Fedotov wrote:
>  > > Hello Aleksey,
>  > > That's great that you appeared on the list. That is nice to chat on
>  > > GTalk, but the list is preferred. People tend to think thoroughly
>  > > before sending their letters, so the communication become more
>  > > thoughtful and transparent. Please, don't hesitate to ask questions on
>  > > the list: UK guys provide us an object lesson in English courtesy
>  > > here.
>  >
>  >
>  > LOL, yeah, not like those brash American-types ;-)
>  >
>  >
>  > > I'm happy that you are ok with RTF editor task. From mentor's FAQ it
>  > > reads that getting two dependent projects accepted is harder than
>  > > different projects.
>  >
>  >
>  > I think we just need the grammar, look at [1] for the CSS grammar.
>  >
>  > We already looked at one [2] contribution for RTF but the license does
>  > not allow us to incorporate it into Harmony.  We need an equivalent to
>  > that (but don't derive it from this version).
>  >
>  > [1]
>  >
>  > http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSGrammar.jj?view=markup
>  > [2] http://issues.apache.org/jira/browse/HARMONY-3898
>  >
>  >
>  > Regards,
>  >
>  > Tim
>  >
>
>
>
>  --
>  Thanks,
>  Aleksey
>



-- 
With best regards,
Alexei

Re: What should we choose for Harmony: JavaCC or AntLR? Was: Google Summer of Code and Harmony

Posted by Aleksey Lagoshin <ay...@gmail.com>.
Thanks for all your answers.

Jin, thanks for the information about LPG. I'll try to find necessary
information to make a decision on what parser generator is more suitable for
RTF task. And of course I'll improve my knowledge about compilers.

Thanks again.


2008/3/30, Jin Mingjian <ji...@gmail.com>:
>
> How about LPG?(LALR Parser Generator[1])
>
> LPG is ANTLR/JavaCC like tools, it has been uesd for the former of
> JDT, CDT, MDT.OCL, WTP projects et. al. in Eclipse platform. So do not
> doubt its capability.
>
> The license is EPL. It's just the friend of  APL^_^ LPG has a runtime
> dependence lib, but you can modify and embed the runtime into your
> code for the EPL license.
>
> In fact, all parser generators are similar. The baisc part of parser
> is trivial. But, of course, to making the best use of parser
> generator, you should be familiar with the  compiler principle
> relatives first. A tool is just a tool.
>
> lastly, there is a initial editor support in eclipse platform now, if
> you like to try, see imp project[2].
>
>
> [1] http://sourceforge.net/projects/lpg/
> [2] http://www.eclipse.org/imp/
>



-- 
Thanks,
Aleksey

Re: What should we choose for Harmony: JavaCC or AntLR? Was: Google Summer of Code and Harmony

Posted by Jin Mingjian <ji...@gmail.com>.
How about LPG?(LALR Parser Generator[1])

LPG is ANTLR/JavaCC like tools, it has been uesd for the former of
JDT, CDT, MDT.OCL, WTP projects et. al. in Eclipse platform. So do not
doubt its capability.

The license is EPL. It's just the friend of  APL^_^ LPG has a runtime
dependence lib, but you can modify and embed the runtime into your
code for the EPL license.

In fact, all parser generators are similar. The baisc part of parser
is trivial. But, of course, to making the best use of parser
generator, you should be familiar with the  compiler principle
relatives first. A tool is just a tool.

lastly, there is a initial editor support in eclipse platform now, if
you like to try, see imp project[2].


[1] http://sourceforge.net/projects/lpg/
[2] http://www.eclipse.org/imp/

Re: What should we choose for Harmony: JavaCC or AntLR? Was: Google Summer of Code and Harmony

Posted by Alexei Fedotov <al...@gmail.com>.
I wonder in which case we would get more maintainable code: with an
external parser generator or with a hand-made parser?

On Sun, Mar 30, 2008 at 3:20 AM, Nathan Beyer <nb...@gmail.com> wrote:
> I'm not suggesting the creation of a tool/library to replace
>  ANTLR/JavaCC, I'm suggest that we just write custom parsers as needed
>  - not a parser generator. Parser generators aren't magic, but if
>  anyone perceives them as such, I'd definitely suggest that they spend
>  a few weeks of their life understanding the basics of parsers.
>
>  -Nathan
>
>
>
>  On Sat, Mar 29, 2008 at 5:13 PM, Alexei Zakharov
>  <al...@gmail.com> wrote:
>  > I agree that we should try to avoid extra dependencies. At the same
>  >  time I afraid if we try to develop everything from scratch we can
>  >  finally find ourselves developing our own version of ANTLR. Personally
>  >  I prefer to create grammar and use helper tools in all cases where
>  >  input language has non-trivial syntax. I simply have no idea how to
>  >  handle it without a grammar.  But I still can imagine the language for
>  >  that the creation of custom-made parser looks more preferable.
>  >
>  >  BTW I don't think there is a great need to answer this question right
>  >  now. IMHO Aleksey may schedule  a couple of weeks for investigating
>  >  this subject (and add this point to his proposal). By the way, besides
>  >  ANTLR and JavaCC I saw references to JFlex [1] in HTML parser's
>  >  sources. As far as I understand it does not add any extra jars to
>  >  classlib's dependencies but  instead utilizes some classes
>  >  (java_cup.runtime.*) that currently are part of xalan.jar.
>  >
>  >  [1] http://www.jflex.de/
>  >
>  >  Regards,
>  >  Alexei
>  >
>  >  2008/3/29, Nathan Beyer <nb...@gmail.com>:
>  >
>  >
>  > > Neither would be my preference. Parser generators have their value,
>  >  >  but low-level frameworks, containers and runtimes should avoid as many
>  >  >  dependencies as possible, and these are just convenience tools, which
>  >  >  I think are only useful as temporary solutions for Harmony.
>  >  >
>  >  >  As for RTF in particular, I believe you'll spend just as much time
>  >  >  working out a grammar and helper methods for a parser generator as you
>  >  >  would implementing a custom parser. RTF is a nasty, nasty thing.
>  >  >
>  >  >
>  >  >  -Nathan
>  >  >
>  >  >
>  >  >  On Sat, Mar 29, 2008 at 9:28 AM, Alexei Fedotov
>  >  >  <al...@gmail.com> wrote:
>  >  >  > Hello, Aleksey,
>  >  >  >
>  >  >  >  This is a good question indeed. Currently both popular parser
>  >  >  >  generators, i.e. JavaCC and ANTLR, are used in Harmony. We have to
>  >  >  >  decide which one is the preferable one for your project and overall. I
>  >  >  >  believe people who have some experience may help us to decide what
>  >  >  >  suits RTF parser and Harmony better. For your application you may just
>  >  >  >  note that you are collecting arguments to choose one generator from
>  >  >  >  two to be most applicable for Harmony instead of naming the only one,
>  >  >  >  and list the arguments you have already collected.
>  >  >  >
>  >  >  >  The licensing of both generators is acceptable. I have heard recent
>  >  >  >  talks about incompatible change of AntLR license, and cannot confirm
>  >  >  >  that. It seems that AntLR 3.0 uses conventional BSD license [1].
>  >  >  >  JavaCC has a proprietary origin [2], but Sun does not claim its rights
>  >  >  >  for this generator.
>  >  >  >
>  >  >  >  There was a conflict between ANTLR from our boot class path and the
>  >  >  >  one from Dacapo benchmark. I don't think this should be a problem for
>  >  >  >  RTF parser: one can load classes into another class loader. Vladimir
>  >  >  >  Beliaev, Paulex and Alexey Varlamov have to say more about this [3].
>  >  >  >  From the other side people said that ANTLR provides more
>  >  >  >  understandable syntax that JavaCC [4], and AFAIK your mentor devoted
>  >  >  >  his university studies to ANTLR.
>  >  >  >
>  >  >  >  Alexei, all, do you have a parser generator preference?
>  >  >  >
>  >  >  >  [1] http://www.antlr.org/license.html
>  >  >  >  [2] http://markmail.org/message/v62n2jt7hvb234fi
>  >  >  >  [3] http://markmail.org/message/ja64toonfbo26yz5
>  >  >  >  [4] http://www.theserverside.com/news/thread.tss?thread_id=45464#233154
>  >  >  >
>  >  >  >
>  >  >  >
>  >  >  >  On Sat, Mar 29, 2008 at 2:01 AM, Aleksey Lagoshin <ay...@gmail.com> wrote:
>  >  >  >  > Thanks for links and additional information.
>  >  >  >  >
>  >  >  >  >  I noticed that CSS parser is created by JavaCC. As far as I know there is
>  >  >  >  >  another one parser generator - ANTLR. So the question is: which tool is more
>  >  >  >  >
>  >  >  >  >  preferred/better JavaCC or ANTLR?
>  >  >  >  >
>  >  >  >  >
>  >  >  >  >  2008/3/28, Tim Ellison <t....@gmail.com>:
>  >  >  >  >
>  >  >  >  >
>  >  >  >  > >
>  >  >  >  >  > Alexei Fedotov wrote:
>  >  >  >  >  > > Hello Aleksey,
>  >  >  >  >  > > That's great that you appeared on the list. That is nice to chat on
>  >  >  >  >  > > GTalk, but the list is preferred. People tend to think thoroughly
>  >  >  >  >  > > before sending their letters, so the communication become more
>  >  >  >  >  > > thoughtful and transparent. Please, don't hesitate to ask questions on
>  >  >  >  >  > > the list: UK guys provide us an object lesson in English courtesy
>  >  >  >  >  > > here.
>  >  >  >  >  >
>  >  >  >  >  >
>  >  >  >  >  > LOL, yeah, not like those brash American-types ;-)
>  >  >  >  >  >
>  >  >  >  >  >
>  >  >  >  >  > > I'm happy that you are ok with RTF editor task. From mentor's FAQ it
>  >  >  >  >  > > reads that getting two dependent projects accepted is harder than
>  >  >  >  >  > > different projects.
>  >  >  >  >  >
>  >  >  >  >  >
>  >  >  >  >  > I think we just need the grammar, look at [1] for the CSS grammar.
>  >  >  >  >  >
>  >  >  >  >  > We already looked at one [2] contribution for RTF but the license does
>  >  >  >  >  > not allow us to incorporate it into Harmony.  We need an equivalent to
>  >  >  >  >  > that (but don't derive it from this version).
>  >  >  >  >  >
>  >  >  >  >  > [1]
>  >  >  >  >  >
>  >  >  >  >  > http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSGrammar.jj?view=markup
>  >  >  >  >  > [2] http://issues.apache.org/jira/browse/HARMONY-3898
>  >  >  >  >  >
>  >  >  >  >  >
>  >  >  >  >  > Regards,
>  >  >  >  >  >
>  >  >  >  >  > Tim
>  >  >  >  >  >
>  >  >  >  >
>  >  >  >  >
>  >  >  >  >
>  >  >  >  >  --
>  >  >  >  >  Thanks,
>  >  >  >  >  Aleksey
>  >  >  >  >
>  >  >  >
>  >  >  >
>  >  >  >
>  >  >  >  --
>  >  >  >  With best regards,
>  >  >  >  Alexei
>  >  >  >
>  >  >
>  >
>



-- 
With best regards,
Alexei

Re: What should we choose for Harmony: JavaCC or AntLR? Was: Google Summer of Code and Harmony

Posted by Nathan Beyer <nb...@gmail.com>.
I'm not suggesting the creation of a tool/library to replace
ANTLR/JavaCC, I'm suggest that we just write custom parsers as needed
- not a parser generator. Parser generators aren't magic, but if
anyone perceives them as such, I'd definitely suggest that they spend
a few weeks of their life understanding the basics of parsers.

-Nathan

On Sat, Mar 29, 2008 at 5:13 PM, Alexei Zakharov
<al...@gmail.com> wrote:
> I agree that we should try to avoid extra dependencies. At the same
>  time I afraid if we try to develop everything from scratch we can
>  finally find ourselves developing our own version of ANTLR. Personally
>  I prefer to create grammar and use helper tools in all cases where
>  input language has non-trivial syntax. I simply have no idea how to
>  handle it without a grammar.  But I still can imagine the language for
>  that the creation of custom-made parser looks more preferable.
>
>  BTW I don't think there is a great need to answer this question right
>  now. IMHO Aleksey may schedule  a couple of weeks for investigating
>  this subject (and add this point to his proposal). By the way, besides
>  ANTLR and JavaCC I saw references to JFlex [1] in HTML parser's
>  sources. As far as I understand it does not add any extra jars to
>  classlib's dependencies but  instead utilizes some classes
>  (java_cup.runtime.*) that currently are part of xalan.jar.
>
>  [1] http://www.jflex.de/
>
>  Regards,
>  Alexei
>
>  2008/3/29, Nathan Beyer <nb...@gmail.com>:
>
>
> > Neither would be my preference. Parser generators have their value,
>  >  but low-level frameworks, containers and runtimes should avoid as many
>  >  dependencies as possible, and these are just convenience tools, which
>  >  I think are only useful as temporary solutions for Harmony.
>  >
>  >  As for RTF in particular, I believe you'll spend just as much time
>  >  working out a grammar and helper methods for a parser generator as you
>  >  would implementing a custom parser. RTF is a nasty, nasty thing.
>  >
>  >
>  >  -Nathan
>  >
>  >
>  >  On Sat, Mar 29, 2008 at 9:28 AM, Alexei Fedotov
>  >  <al...@gmail.com> wrote:
>  >  > Hello, Aleksey,
>  >  >
>  >  >  This is a good question indeed. Currently both popular parser
>  >  >  generators, i.e. JavaCC and ANTLR, are used in Harmony. We have to
>  >  >  decide which one is the preferable one for your project and overall. I
>  >  >  believe people who have some experience may help us to decide what
>  >  >  suits RTF parser and Harmony better. For your application you may just
>  >  >  note that you are collecting arguments to choose one generator from
>  >  >  two to be most applicable for Harmony instead of naming the only one,
>  >  >  and list the arguments you have already collected.
>  >  >
>  >  >  The licensing of both generators is acceptable. I have heard recent
>  >  >  talks about incompatible change of AntLR license, and cannot confirm
>  >  >  that. It seems that AntLR 3.0 uses conventional BSD license [1].
>  >  >  JavaCC has a proprietary origin [2], but Sun does not claim its rights
>  >  >  for this generator.
>  >  >
>  >  >  There was a conflict between ANTLR from our boot class path and the
>  >  >  one from Dacapo benchmark. I don't think this should be a problem for
>  >  >  RTF parser: one can load classes into another class loader. Vladimir
>  >  >  Beliaev, Paulex and Alexey Varlamov have to say more about this [3].
>  >  >  From the other side people said that ANTLR provides more
>  >  >  understandable syntax that JavaCC [4], and AFAIK your mentor devoted
>  >  >  his university studies to ANTLR.
>  >  >
>  >  >  Alexei, all, do you have a parser generator preference?
>  >  >
>  >  >  [1] http://www.antlr.org/license.html
>  >  >  [2] http://markmail.org/message/v62n2jt7hvb234fi
>  >  >  [3] http://markmail.org/message/ja64toonfbo26yz5
>  >  >  [4] http://www.theserverside.com/news/thread.tss?thread_id=45464#233154
>  >  >
>  >  >
>  >  >
>  >  >  On Sat, Mar 29, 2008 at 2:01 AM, Aleksey Lagoshin <ay...@gmail.com> wrote:
>  >  >  > Thanks for links and additional information.
>  >  >  >
>  >  >  >  I noticed that CSS parser is created by JavaCC. As far as I know there is
>  >  >  >  another one parser generator - ANTLR. So the question is: which tool is more
>  >  >  >
>  >  >  >  preferred/better JavaCC or ANTLR?
>  >  >  >
>  >  >  >
>  >  >  >  2008/3/28, Tim Ellison <t....@gmail.com>:
>  >  >  >
>  >  >  >
>  >  >  > >
>  >  >  >  > Alexei Fedotov wrote:
>  >  >  >  > > Hello Aleksey,
>  >  >  >  > > That's great that you appeared on the list. That is nice to chat on
>  >  >  >  > > GTalk, but the list is preferred. People tend to think thoroughly
>  >  >  >  > > before sending their letters, so the communication become more
>  >  >  >  > > thoughtful and transparent. Please, don't hesitate to ask questions on
>  >  >  >  > > the list: UK guys provide us an object lesson in English courtesy
>  >  >  >  > > here.
>  >  >  >  >
>  >  >  >  >
>  >  >  >  > LOL, yeah, not like those brash American-types ;-)
>  >  >  >  >
>  >  >  >  >
>  >  >  >  > > I'm happy that you are ok with RTF editor task. From mentor's FAQ it
>  >  >  >  > > reads that getting two dependent projects accepted is harder than
>  >  >  >  > > different projects.
>  >  >  >  >
>  >  >  >  >
>  >  >  >  > I think we just need the grammar, look at [1] for the CSS grammar.
>  >  >  >  >
>  >  >  >  > We already looked at one [2] contribution for RTF but the license does
>  >  >  >  > not allow us to incorporate it into Harmony.  We need an equivalent to
>  >  >  >  > that (but don't derive it from this version).
>  >  >  >  >
>  >  >  >  > [1]
>  >  >  >  >
>  >  >  >  > http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSGrammar.jj?view=markup
>  >  >  >  > [2] http://issues.apache.org/jira/browse/HARMONY-3898
>  >  >  >  >
>  >  >  >  >
>  >  >  >  > Regards,
>  >  >  >  >
>  >  >  >  > Tim
>  >  >  >  >
>  >  >  >
>  >  >  >
>  >  >  >
>  >  >  >  --
>  >  >  >  Thanks,
>  >  >  >  Aleksey
>  >  >  >
>  >  >
>  >  >
>  >  >
>  >  >  --
>  >  >  With best regards,
>  >  >  Alexei
>  >  >
>  >
>

Re: What should we choose for Harmony: JavaCC or AntLR? Was: Google Summer of Code and Harmony

Posted by Alexei Zakharov <al...@gmail.com>.
I agree that we should try to avoid extra dependencies. At the same
time I afraid if we try to develop everything from scratch we can
finally find ourselves developing our own version of ANTLR. Personally
I prefer to create grammar and use helper tools in all cases where
input language has non-trivial syntax. I simply have no idea how to
handle it without a grammar.  But I still can imagine the language for
that the creation of custom-made parser looks more preferable.

BTW I don't think there is a great need to answer this question right
now. IMHO Aleksey may schedule  a couple of weeks for investigating
this subject (and add this point to his proposal). By the way, besides
ANTLR and JavaCC I saw references to JFlex [1] in HTML parser's
sources. As far as I understand it does not add any extra jars to
classlib's dependencies but  instead utilizes some classes
(java_cup.runtime.*) that currently are part of xalan.jar.

[1] http://www.jflex.de/

Regards,
Alexei

2008/3/29, Nathan Beyer <nb...@gmail.com>:
> Neither would be my preference. Parser generators have their value,
>  but low-level frameworks, containers and runtimes should avoid as many
>  dependencies as possible, and these are just convenience tools, which
>  I think are only useful as temporary solutions for Harmony.
>
>  As for RTF in particular, I believe you'll spend just as much time
>  working out a grammar and helper methods for a parser generator as you
>  would implementing a custom parser. RTF is a nasty, nasty thing.
>
>
>  -Nathan
>
>
>  On Sat, Mar 29, 2008 at 9:28 AM, Alexei Fedotov
>  <al...@gmail.com> wrote:
>  > Hello, Aleksey,
>  >
>  >  This is a good question indeed. Currently both popular parser
>  >  generators, i.e. JavaCC and ANTLR, are used in Harmony. We have to
>  >  decide which one is the preferable one for your project and overall. I
>  >  believe people who have some experience may help us to decide what
>  >  suits RTF parser and Harmony better. For your application you may just
>  >  note that you are collecting arguments to choose one generator from
>  >  two to be most applicable for Harmony instead of naming the only one,
>  >  and list the arguments you have already collected.
>  >
>  >  The licensing of both generators is acceptable. I have heard recent
>  >  talks about incompatible change of AntLR license, and cannot confirm
>  >  that. It seems that AntLR 3.0 uses conventional BSD license [1].
>  >  JavaCC has a proprietary origin [2], but Sun does not claim its rights
>  >  for this generator.
>  >
>  >  There was a conflict between ANTLR from our boot class path and the
>  >  one from Dacapo benchmark. I don't think this should be a problem for
>  >  RTF parser: one can load classes into another class loader. Vladimir
>  >  Beliaev, Paulex and Alexey Varlamov have to say more about this [3].
>  >  From the other side people said that ANTLR provides more
>  >  understandable syntax that JavaCC [4], and AFAIK your mentor devoted
>  >  his university studies to ANTLR.
>  >
>  >  Alexei, all, do you have a parser generator preference?
>  >
>  >  [1] http://www.antlr.org/license.html
>  >  [2] http://markmail.org/message/v62n2jt7hvb234fi
>  >  [3] http://markmail.org/message/ja64toonfbo26yz5
>  >  [4] http://www.theserverside.com/news/thread.tss?thread_id=45464#233154
>  >
>  >
>  >
>  >  On Sat, Mar 29, 2008 at 2:01 AM, Aleksey Lagoshin <ay...@gmail.com> wrote:
>  >  > Thanks for links and additional information.
>  >  >
>  >  >  I noticed that CSS parser is created by JavaCC. As far as I know there is
>  >  >  another one parser generator - ANTLR. So the question is: which tool is more
>  >  >
>  >  >  preferred/better JavaCC or ANTLR?
>  >  >
>  >  >
>  >  >  2008/3/28, Tim Ellison <t....@gmail.com>:
>  >  >
>  >  >
>  >  > >
>  >  >  > Alexei Fedotov wrote:
>  >  >  > > Hello Aleksey,
>  >  >  > > That's great that you appeared on the list. That is nice to chat on
>  >  >  > > GTalk, but the list is preferred. People tend to think thoroughly
>  >  >  > > before sending their letters, so the communication become more
>  >  >  > > thoughtful and transparent. Please, don't hesitate to ask questions on
>  >  >  > > the list: UK guys provide us an object lesson in English courtesy
>  >  >  > > here.
>  >  >  >
>  >  >  >
>  >  >  > LOL, yeah, not like those brash American-types ;-)
>  >  >  >
>  >  >  >
>  >  >  > > I'm happy that you are ok with RTF editor task. From mentor's FAQ it
>  >  >  > > reads that getting two dependent projects accepted is harder than
>  >  >  > > different projects.
>  >  >  >
>  >  >  >
>  >  >  > I think we just need the grammar, look at [1] for the CSS grammar.
>  >  >  >
>  >  >  > We already looked at one [2] contribution for RTF but the license does
>  >  >  > not allow us to incorporate it into Harmony.  We need an equivalent to
>  >  >  > that (but don't derive it from this version).
>  >  >  >
>  >  >  > [1]
>  >  >  >
>  >  >  > http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSGrammar.jj?view=markup
>  >  >  > [2] http://issues.apache.org/jira/browse/HARMONY-3898
>  >  >  >
>  >  >  >
>  >  >  > Regards,
>  >  >  >
>  >  >  > Tim
>  >  >  >
>  >  >
>  >  >
>  >  >
>  >  >  --
>  >  >  Thanks,
>  >  >  Aleksey
>  >  >
>  >
>  >
>  >
>  >  --
>  >  With best regards,
>  >  Alexei
>  >
>

Re: What should we choose for Harmony: JavaCC or AntLR? Was: Google Summer of Code and Harmony

Posted by Nathan Beyer <nb...@gmail.com>.
Neither would be my preference. Parser generators have their value,
but low-level frameworks, containers and runtimes should avoid as many
dependencies as possible, and these are just convenience tools, which
I think are only useful as temporary solutions for Harmony.

As for RTF in particular, I believe you'll spend just as much time
working out a grammar and helper methods for a parser generator as you
would implementing a custom parser. RTF is a nasty, nasty thing.

-Nathan

On Sat, Mar 29, 2008 at 9:28 AM, Alexei Fedotov
<al...@gmail.com> wrote:
> Hello, Aleksey,
>
>  This is a good question indeed. Currently both popular parser
>  generators, i.e. JavaCC and ANTLR, are used in Harmony. We have to
>  decide which one is the preferable one for your project and overall. I
>  believe people who have some experience may help us to decide what
>  suits RTF parser and Harmony better. For your application you may just
>  note that you are collecting arguments to choose one generator from
>  two to be most applicable for Harmony instead of naming the only one,
>  and list the arguments you have already collected.
>
>  The licensing of both generators is acceptable. I have heard recent
>  talks about incompatible change of AntLR license, and cannot confirm
>  that. It seems that AntLR 3.0 uses conventional BSD license [1].
>  JavaCC has a proprietary origin [2], but Sun does not claim its rights
>  for this generator.
>
>  There was a conflict between ANTLR from our boot class path and the
>  one from Dacapo benchmark. I don't think this should be a problem for
>  RTF parser: one can load classes into another class loader. Vladimir
>  Beliaev, Paulex and Alexey Varlamov have to say more about this [3].
>  From the other side people said that ANTLR provides more
>  understandable syntax that JavaCC [4], and AFAIK your mentor devoted
>  his university studies to ANTLR.
>
>  Alexei, all, do you have a parser generator preference?
>
>  [1] http://www.antlr.org/license.html
>  [2] http://markmail.org/message/v62n2jt7hvb234fi
>  [3] http://markmail.org/message/ja64toonfbo26yz5
>  [4] http://www.theserverside.com/news/thread.tss?thread_id=45464#233154
>
>
>
>  On Sat, Mar 29, 2008 at 2:01 AM, Aleksey Lagoshin <ay...@gmail.com> wrote:
>  > Thanks for links and additional information.
>  >
>  >  I noticed that CSS parser is created by JavaCC. As far as I know there is
>  >  another one parser generator - ANTLR. So the question is: which tool is more
>  >
>  >  preferred/better JavaCC or ANTLR?
>  >
>  >
>  >  2008/3/28, Tim Ellison <t....@gmail.com>:
>  >
>  >
>  > >
>  >  > Alexei Fedotov wrote:
>  >  > > Hello Aleksey,
>  >  > > That's great that you appeared on the list. That is nice to chat on
>  >  > > GTalk, but the list is preferred. People tend to think thoroughly
>  >  > > before sending their letters, so the communication become more
>  >  > > thoughtful and transparent. Please, don't hesitate to ask questions on
>  >  > > the list: UK guys provide us an object lesson in English courtesy
>  >  > > here.
>  >  >
>  >  >
>  >  > LOL, yeah, not like those brash American-types ;-)
>  >  >
>  >  >
>  >  > > I'm happy that you are ok with RTF editor task. From mentor's FAQ it
>  >  > > reads that getting two dependent projects accepted is harder than
>  >  > > different projects.
>  >  >
>  >  >
>  >  > I think we just need the grammar, look at [1] for the CSS grammar.
>  >  >
>  >  > We already looked at one [2] contribution for RTF but the license does
>  >  > not allow us to incorporate it into Harmony.  We need an equivalent to
>  >  > that (but don't derive it from this version).
>  >  >
>  >  > [1]
>  >  >
>  >  > http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSGrammar.jj?view=markup
>  >  > [2] http://issues.apache.org/jira/browse/HARMONY-3898
>  >  >
>  >  >
>  >  > Regards,
>  >  >
>  >  > Tim
>  >  >
>  >
>  >
>  >
>  >  --
>  >  Thanks,
>  >  Aleksey
>  >
>
>
>
>  --
>  With best regards,
>  Alexei
>

Re: What should we choose for Harmony: JavaCC or AntLR? Was: Google Summer of Code and Harmony

Posted by Gregory Shimansky <gs...@apache.org>.
On 29 March 2008 Alexei Fedotov wrote:
> Hello, Aleksey,
>
> This is a good question indeed. Currently both popular parser
> generators, i.e. JavaCC and ANTLR, are used in Harmony. We have to
> decide which one is the preferable one for your project and overall. I
> believe people who have some experience may help us to decide what
> suits RTF parser and Harmony better. For your application you may just
> note that you are collecting arguments to choose one generator from
> two to be most applicable for Harmony instead of naming the only one,
> and list the arguments you have already collected.
>
> The licensing of both generators is acceptable. I have heard recent
> talks about incompatible change of AntLR license, and cannot confirm
> that. It seems that AntLR 3.0 uses conventional BSD license [1].
> JavaCC has a proprietary origin [2], but Sun does not claim its rights
> for this generator.
>
> There was a conflict between ANTLR from our boot class path and the
> one from Dacapo benchmark. I don't think this should be a problem for
> RTF parser: one can load classes into another class loader. Vladimir

IMHO it is an ugly kludge and should be avoided. At least it is bad for 
performance if you call all of the methods through reflection to reach 
classes loaded by non-bootstrap classloader.

> Beliaev, Paulex and Alexey Varlamov have to say more about this [3].
> From the other side people said that ANTLR provides more
> understandable syntax that JavaCC [4], and AFAIK your mentor devoted
> his university studies to ANTLR.
>
> Alexei, all, do you have a parser generator preference?
>
> [1] http://www.antlr.org/license.html
> [2] http://markmail.org/message/v62n2jt7hvb234fi
> [3] http://markmail.org/message/ja64toonfbo26yz5
> [4] http://www.theserverside.com/news/thread.tss?thread_id=45464#233154
>
> On Sat, Mar 29, 2008 at 2:01 AM, Aleksey Lagoshin <ay...@gmail.com> 
wrote:
> > Thanks for links and additional information.
> >
> >  I noticed that CSS parser is created by JavaCC. As far as I know there
> > is another one parser generator - ANTLR. So the question is: which tool
> > is more
> >
> >  preferred/better JavaCC or ANTLR?
> >
> >  2008/3/28, Tim Ellison <t....@gmail.com>:
> >  > Alexei Fedotov wrote:
> >  > > Hello Aleksey,
> >  > > That's great that you appeared on the list. That is nice to chat on
> >  > > GTalk, but the list is preferred. People tend to think thoroughly
> >  > > before sending their letters, so the communication become more
> >  > > thoughtful and transparent. Please, don't hesitate to ask questions
> >  > > on the list: UK guys provide us an object lesson in English courtesy
> >  > > here.
> >  >
> >  > LOL, yeah, not like those brash American-types ;-)
> >  >
> >  > > I'm happy that you are ok with RTF editor task. From mentor's FAQ it
> >  > > reads that getting two dependent projects accepted is harder than
> >  > > different projects.
> >  >
> >  > I think we just need the grammar, look at [1] for the CSS grammar.
> >  >
> >  > We already looked at one [2] contribution for RTF but the license does
> >  > not allow us to incorporate it into Harmony.  We need an equivalent to
> >  > that (but don't derive it from this version).
> >  >
> >  > [1]
> >  >
> >  > http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/s
> >  >wing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparse
> >  >r/CSSGrammar.jj?view=markup [2]
> >  > http://issues.apache.org/jira/browse/HARMONY-3898
> >  >
> >  >
> >  > Regards,
> >  >
> >  > Tim
> >
> >  --
> >  Thanks,
> >  Aleksey



-- 
Gregory