Quantcast

Has anyone looked at KMizu's YAPP or PEGEX?

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

Has anyone looked at KMizu's YAPP or PEGEX?

Eric L

What is enticing to me about Parboiled is the ability to use Parboiled Scala from IMain (works so far).
Gives the power of dynamic PEG like LPEG to the Java world without requiring Lua.

Parser generators provide a layer of code that can be a pain to compile, manage, and debug (e.g. ANTLR).

However, it's best to contrast technologies, and so I've also looked at YAPP & PEGEX as well.
Has anyone else used these?

Thanks!

http://github.com/kmizu/yapp
http://github.com/kmizu/pegex

Example PEGEX Grammar.

Document       = prolog Element Misc* EOT ;
prolog       = XMLDecl? Misc* ;
XMLDecl     = "<?xml" VersionInfo EncodingDecl? S? "?>" ;
VersionInfo = S "version" Eq ("'" VersionNum "'"
                 / "\"" VersionNum "\""
                 ) ;
Eq             = S? "=" S? ;
VersionNum   = ([a-zA-Z0-9_.:] / "-")+ ;
Misc         = COMMENT / S ;
EncodingDecl = S "encoding" Eq ("'" EncName "'"
                 / "\"" EncName "\""
                 ) ;
EncName     = [A-Za-z] ([A-Za-z0-9._] / "-")* ;
S              = (" " / "\t" / "\r" / "\n")+ ;
LETTER         = [a-zA-Z] ;
DIGIT          = [0-9] ;
NAME_CHAR      = LETTER / DIGIT / "." / "-" / "_" / ":" ;
NAME           = (LETTER / "_" / ":") NAME_CHAR* ;
ENTITY_REF     = "&" NAME ";" ;
CHAR_REF     = "&#x" [0-9a-fA-F]+ ";" / "&#" [0-9]+ ";" ;
REFERENCE   = ENTITY_REF / CHAR_REF ;
EOT            = !_ ;
COMMENT     = "" ;
ATT_VALUE   = "\"" (![<&"] . / REFERENCE)* "\""
                                 / "'"  (![<&'] . / REFERENCE)* "'" ;
CHAR_DATA   = (![<&] .)+ ;
Attribute      = NAME S? "=" S? ATT_VALUE ;
Element        = "<" n:NAME (S Attribute)* S? (
                   ">" Content  "</" <n> S? ">"
                 / "/>"
                 ) ;
Content        = (COMMENT / Element / REFERENCE / CHAR_DATA)* ;
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Has anyone looked at KMizu's YAPP or PEGEX?

mathias
Administrator
Eric,

I hadn't seen YAPP or PEGEX before, thanks for the link!
YAPP seems to support some interesting things, like automatic insertion of CUT markers, something that is also planned for parboiled (https://github.com/sirthias/parboiled/issues/19).

However, for some reason interest in YAPP and PEGEX seems to be low so far (judging from the number of github watchers), maybe it needs to be promoted a bit more.

The differences between YAPP and parboiled as I seen them on first sight:
- external (YAPP) vs. internal (parboiled) DSL for grammar spec
- unclear whether and how YAPP supports parser actions and AST creation
- unclear in what way YAPP reports input errors
- YAPP doesnt support error recovery

Cheers,
Mathias

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

On 27.07.2011, at 16:32, Eric L [via parboiled users] wrote:

>
> What is enticing to me about Parboiled is the ability to use Parboiled Scala from IMain (works so far).
> Gives the power of dynamic PEG like LPEG to the Java world without requiring Lua.
>
> Parser generators provide a layer of code that can be a pain to compile, manage, and debug (e.g. ANTLR).
>
> However, it's best to contrast technologies, and so I've also looked at YAPP & PEGEX as well.
> Has anyone else used these?
>
> Thanks!
>
> http://github.com/kmizu/yapp
> http://github.com/kmizu/pegex
>
> Example PEGEX Grammar.
>
> Document       = prolog Element Misc* EOT ;
> prolog       = XMLDecl? Misc* ;
> XMLDecl     = "<?xml" VersionInfo EncodingDecl? S? "?>" ;
> VersionInfo = S "version" Eq ("'" VersionNum "'"
>                  / "\"" VersionNum "\""
>                  ) ;
> Eq             = S? "=" S? ;
> VersionNum   = ([a-zA-Z0-9_.:] / "-")+ ;
> Misc         = COMMENT / S ;
> EncodingDecl = S "encoding" Eq ("'" EncName "'"
>                  / "\"" EncName "\""
>                  ) ;
> EncName     = [A-Za-z] ([A-Za-z0-9._] / "-")* ;
> S              = (" " / "\t" / "\r" / "\n")+ ;
> LETTER         = [a-zA-Z] ;
> DIGIT          = [0-9] ;
> NAME_CHAR      = LETTER / DIGIT / "." / "-" / "_" / ":" ;
> NAME           = (LETTER / "_" / ":") NAME_CHAR* ;
> ENTITY_REF     = "&" NAME ";" ;
> CHAR_REF     = "&#x" [0-9a-fA-F]+ ";" / "&#" [0-9]+ ";" ;
> REFERENCE   = ENTITY_REF / CHAR_REF ;
> EOT            = !_ ;
> COMMENT     = "" ;
> ATT_VALUE   = "\"" (![<&"] . / REFERENCE)* "\""
>                                  / "'"  (![<&'] . / REFERENCE)* "'" ;
> CHAR_DATA   = (![<&] .)+ ;
> Attribute      = NAME S? "=" S? ATT_VALUE ;
> Element        = "<" n:NAME (S Attribute)* S? (
>                    ">" Content  "</" <n> S? ">"
>                  / "/>"
>                  ) ;
> Content        = (COMMENT / Element / REFERENCE / CHAR_DATA)* ;
>
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/Has-anyone-looked-at-KMizu-s-YAPP-or-PEGEX-tp3203618p3203618.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, click here.

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

Re: Has anyone looked at KMizu's YAPP or PEGEX?

Eric L

Mathias,

Thanks for the quick contrast.

I assert that Mathias (you) are the main reason Parboiled is so alive, as measured by development and support.
Much like Terrence is why ANTLR is still alive, even though it's open source and has a huge body of work around it.

I'll further state that someone investing in a benevolent dictatorship as most OSS projects are, are investing in it's ruler.
In that case, I'll hazard a bet that Parboiled will benefit from your governance for a sufficient time as to risk investing in software architectures leveraging Parboiled.

Thanks!
-Eric
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Has anyone looked at KMizu's YAPP or PEGEX?

mathias
Administrator
Eric,

I'll do what I can with regard to support and further development.
However, I find that many people choose to build something with clearly scoped OSS projects such as parboiled as long as these "just work". If the last stable release simply does what its supposed to do and makes a task at hand easier the risk is limited. Even if the "ruler" should give up on the project at some point in the future you still have something that works and, in the unlikely event that things start breaking after that point, you have access to the code. If that doesn't suffice it's much easier to replace parboiled with a substitute (like ANTLR) than it is to replace something like Spring with an another framework similarly close the very core of your applications architecture.

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

On 09.08.2011, at 20:22, Eric L [via parboiled users] wrote:

>
> Mathias,
>
> Thanks for the quick contrast.
>
> I assert that Mathias (you) are the main reason Parboiled is so alive, as measured by development and support.
> Much like Terrence is why ANTLR is still alive, even though it's open source and has a huge body of work around it.
>
> I'll further state that someone investing in a benevolent dictatorship as most OSS projects are, are investing in it's ruler.
> In that case, I'll hazard a bet that Parboiled will benefit from your governance for a sufficient time as to risk investing in software architectures leveraging Parboiled.
>
> Thanks!
> -Eric
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/Has-anyone-looked-at-KMizu-s-YAPP-or-PEGEX-tp3203618p3239885.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, click here.

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

Re: Has anyone looked at KMizu's YAPP or PEGEX?

Eric L
Parsing is a core feature for some domains, and so an important component of those architectures and implementations.

For those of us building libraries of parsers, moving between grammars requires re-encoding all the parsers.

So, moving from Parboiled-flavored PEG to ANTLR is not likely to be a free or easy endeavor.

Companies need to have 3+ year horizons and thus need equal longevity support.
This is the business model for Redhat/JBoss/(now Oracle?)/etc.

T. Parr has a 'buy my time' PayPal button (don't know what that's profited him).
I have purchased his book, which is something.

Hey, maybe Mathias has a book in his future? :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Has anyone looked at KMizu's YAPP or PEGEX?

mathias
Administrator
Eric,

seeing that ANTLRs origins lie somewhere in the mid-90s I certainly wouldn't like to put parboiled anywhere near ANTLR with regard to commitment, long-time support and general presence. So, if you really are looking at parboiled from the perspective of a commercial application with 3+ year support horizon and in a domain where the parser is at the core of the  system I'm not sure you really should be using it.

My point was that parboiled is more targeted at the majority of applications that do _not_ fall into this category, and it being an open source project with a very small community that basically hinges upon one sole person many times isn't a real show stopper, if the technical benefits outweigh this drawback.

I'll think about the book though... (but probably it'll more be a "booklet" :)

Cheers,
Mathias

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

On 24.08.2011, at 20:40, Eric L [via parboiled users] wrote:

>
> Parsing is a core feature for some domains, and so an important component of those architectures and implementations.
>
> For those of us building libraries of parsers, between grammars requires re-encoding all the parsers.
>
> So, moving from Parboiled-flavored PEG to ANTLR is not likely to be a free or easy endeavor.
>
> Companies need to have 3+ year horizons and thus need equal longevity support.
> This is the business model for Redhat/JBoss/(now Oracle?)/etc.
>
> T. Parr has a 'buy my time' PayPal button (don't know what that's profited him).
> I have purchased his book, which is something.
>
> Hey, maybe Mathias has a book in his future? :)
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/Has-anyone-looked-at-KMizu-s-YAPP-or-PEGEX-tp3203618p3281782.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, click here.

Loading...