Quantcast

Future of Parboiled Java?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Future of Parboiled Java?

cpalm
Hi!

I'm working on a Java project that needs to tokenize ISO 29500 (the infamous Office Open XML standard) SpreadsheetML formulas. Its complex lexical ambiguities unfortunately rules out most of the popular parsing tools.
Parboiled, however, allows me to express the grammar in a way that resolves the ambiguities in a proper (or at least acceptable) way with only minor tweaks to the original grammar. So my idea was to use Parbolied for the formula tokenizer and also to replace a whole bunch of other hand-crafted parsers in my application.

Now, I read that there will be no Java support for the next version of Parboiled. Can someone elaborate a bit on what that means for Parboiled Java users? Does it mean that Parboiled is a dead end for Java apps?

If so, does anyone have any suggestions for good alternatives? I need something that works well with weird grammars like SpreadsheetML. For reference, the challenging parts of SpreadsheetML are something like:

cell-reference = name-cell-reference | A1-cell-reference | R1C1-cell-reference
name-cell-reference = (workbook-name '!')? name
A1-cell-reference = work-sheet-prefix? A1-reference (':' A1-reference)?
A1-reference = (A1-column ':' A1-column) | (A1-row ':' A1-row) | (A1-column A1-row)
A1-column = '$'? [a-zA-Z]+
A1-rol = '$'? [0-9]+
R1C1-cell-reference = work-sheet-prefix? R1C1-reference (':' R1C1-reference)?
R1C1-reference = R1C1-row-only | R1C1-column-only | (R1C1-row R1C1-column)
R1C1-row-only = ('R' [0-9]+) | ('R[' '-'? [0-9]+ ']')
R1C1-column-only = ('C' [0-9]+) | ('C[' '-'? [0-9]+ ']')
R1C1-row = 'R' | R1C1-row-only
R1C1-column = 'C' | R1C1-column-only
worksheet-prefix = ('[' workbook-name ']')? sheet-name (':' sheet-name)? '!'

name = [a-zA-Z_\\] [a-zA-Z0-9_.]*
workbook-name = [^:, ^*/+=<>%'\[\]?]+
sheet-name = [^:, ^*/+=<>%'\[\]\\?]+

Cheers,
cpalm
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Future of Parboiled Java?

mathias
Administrator
cpalm,

> Now, I read that there will be no Java support for the next version of Parboiled. Can someone elaborate a bit on what that means for Parboiled Java users? Does it mean that Parboiled is a dead end for Java apps?

It simply means that further development efforts will be dedicated to parboiled 2+.
I’ll continue to maintain parboiled 1.x, but it will not see any further feature additions etc. from my side.
For example, Java 8 lambdas present a new way of adding parser actions to a grammar but I will not be able to invest the development time for making it happen for pb1.

> If so, does anyone have any suggestions for good alternatives?

Use parboiled 2! :)
It parses with almost one order of magnitude higher speed and sports and even more powerful and flexible DSL.
Plus, it’s written in Scala. :)

Cheers,
Mathias

---
[hidden email]
http://www.parboiled.org

On 19 Mar 2014, at 16:35, cpalm [via parboiled users] <[hidden email]> wrote:

> Hi!
>
> I'm working on a Java project that needs to tokenize ISO 29500 (the infamous Office Open XML standard) SpreadsheetML formulas. Its complex lexical ambiguities unfortunately rules out most of the popular parsing tools.
> Parboiled, however, allows me to express the grammar in a way that resolves the ambiguities in a proper (or at least acceptable) way with only minor tweaks to the original grammar. So my idea was to use Parbolied for the formula tokenizer and also to replace a whole bunch of other hand-crafted parsers in my application.
>
> Now, I read that there will be no Java support for the next version of Parboiled. Can someone elaborate a bit on what that means for Parboiled Java users? Does it mean that Parboiled is a dead end for Java apps?
>
> If so, does anyone have any suggestions for good alternatives? I need something that works well with weird grammars like SpreadsheetML. For reference, the challenging parts of SpreadsheetML are something like:
>
> cell-reference = name-cell-reference | A1-cell-reference | R1C1-cell-reference
> name-cell-reference = (workbook-name '!')? name
> A1-cell-reference = work-sheet-prefix? A1-reference (':' A1-reference)?
> A1-reference = (A1-column ':' A1-column) | (A1-row ':' A1-row) | (A1-column A1-row)
> A1-column = '$'? [a-zA-Z]+
> A1-rol = '$'? [0-9]+
> R1C1-cell-reference = work-sheet-prefix? R1C1-reference (':' R1C1-reference)?
> R1C1-reference = R1C1-row-only | R1C1-column-only | (R1C1-row R1C1-column)
> R1C1-row-only = ('R' [0-9]+) | ('R[' '-'? [0-9]+ ']')
> R1C1-column-only = ('C' [0-9]+) | ('C[' '-'? [0-9]+ ']')
> R1C1-row = 'R' | R1C1-row-only
> R1C1-column = 'C' | R1C1-column-only
> worksheet-prefix = ('[' workbook-name ']')? sheet-name (':' sheet-name)? '!'
>
> name = [a-zA-Z_\\] [a-zA-Z0-9_.]*
> workbook-name = [^:, ^*/+=<>%'\[\]?]+
> sheet-name = [^:, ^*/+=<>%'\[\]\\?]+
>
> Cheers,
> cpalm
>
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/Future-of-Parboiled-Java-tp4024282.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, click here.
> NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Future of Parboiled Java?

cpalm
On 03/21/2014 09:40 AM, mathias [via parboiled users] wrote:
> > If so, does anyone have any suggestions for good alternatives?
>
> Use parboiled 2! :)
> It parses with almost one order of magnitude higher speed and sports
> and even more powerful and flexible DSL.
> Plus, it’s written in Scala. :)
OK. Are there any Java examples for parboiled 2?

Cheers,
cpalm
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Future of Parboiled Java?

mathias
Administrator
cpalm,

> OK. Are there any Java examples for parboiled 2?

No. You cannot use pb2 from Java. You’ll have to write your parser in Scala.

Cheers,
Mathias

---
[hidden email]
http://www.parboiled.org

On 22 Mar 2014, at 13:39, cpalm [via parboiled users] <[hidden email]> wrote:

> On 03/21/2014 09:40 AM, mathias [via parboiled users] wrote:
> > > If so, does anyone have any suggestions for good alternatives?
> >
> > Use parboiled 2! :)
> > It parses with almost one order of magnitude higher speed and sports
> > and even more powerful and flexible DSL.
> > Plus, it’s written in Scala. :)
> OK. Are there any Java examples for parboiled 2?
>
> Cheers,
> cpalm
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/Future-of-Parboiled-Java-tp4024282p4024284.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, click here.
> NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Future of Parboiled Java?

fschmidt
Administrator
mathias wrote
No. You cannot use pb2 from Java. You’ll have to write your parser in Scala.
I hate Scala.  So can someone suggest a Java alternative to Parboiled?  The application is a Lua interpreter I wrote using Parboiled.

https://code.google.com/p/luan-java/
fge
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Future of Parboiled Java?

fge
Hello,

On Mon, Mar 31, 2014 at 5:13 AM, fschmidt [via parboiled users]
<[hidden email]> wrote:
[...]
>
> I hate Scala.  So can someone suggest a Java alternative to Parboiled?  The
> application is a Lua interpreter I wrote using Parboiled.
>

Unfortunately, none exist which can do rules in pure Java like
Parboiled does. Antlr and JavaCC are the "obvious" ones but they
require a generation phase which parboiled doesn't.

And yes, I also mourn the "loss" of parboiled... Had I the skills to
keep parboiled alive, I'd do so!

--
Francis Galiegue, [hidden email]
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Future of Parboiled Java?

binarytemple
In reply to this post by fschmidt
javacc has worked pretty well for me in the past. It's fast and flexible.

Bryan


On Mon, Mar 31, 2014 at 4:13 AM, fschmidt [via parboiled users] <[hidden email]> wrote:
mathias wrote
No. You cannot use pb2 from Java. You’ll have to write your parser in Scala.
I hate Scala.  So can someone suggest a Java alternative to Parboiled?  The application is a Lua interpreter I wrote using Parboiled.

https://code.google.com/p/luan-java/



If you reply to this email, your message will be added to the discussion below:
http://users.parboiled.org/Future-of-Parboiled-Java-tp4024282p4024286.html
To start a new topic under parboiled users, email [hidden email]
To unsubscribe from parboiled users, click here.
NAML

fge
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Future of Parboiled Java?

fge
In reply to this post by fschmidt
fschmidt wrote
I hate Scala.  So can someone suggest a Java alternative to Parboiled?  The application is a Lua interpreter I wrote using Parboiled.

https://code.google.com/p/luan-java/
Hello,

You can use... Parboiled ;) I have decided to take the plunge and maintain version 1:

https://github.com/parboiled1/project-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Future of Parboiled Java?

fschmidt
Administrator
fge wrote
Hello,

You can use... Parboiled ;) I have decided to take the plunge and maintain version 1:

https://github.com/parboiled1/project-info
Thanks, I saw that.  I am working on another project right now that doesn't use Parboiled, but in a few months I plan to use and contribute to your Parboiled project.
Loading...