Regular expressions

37 views
Skip to first unread message

Thomas Weigert

unread,
Dec 13, 2015, 5:25:29 PM12/13/15
to marpa parser
Dear all,

I am struggling with which parts of Perl's regular expression syntax is supported in lexeme rules and which are not. For example, I was trying to write a simple rule with zero-width look ahead, but marpa does not like it:

PICSINGLEDOT ~ [.](?=\.)

The manual seems to imply that whatever is in Perl is ok, but that seems far from true.

Does anybody have any guidance to offer here?

Thanks, Th.

Jeffrey Kegler

unread,
Dec 13, 2015, 7:26:19 PM12/13/15
to Marpa Parser Mailing LIst
Marpa::R2's SLIF only supports the character class part of Perl's RE's:  https://metacpan.org/pod/distribution/Marpa-R2/pod/Scanless/DSL.pod#Character-classes

The SLIF has its own mechanisms for doing the equivalent of lookahead.  One in particular is pre-lexeme events: https://metacpan.org/pod/distribution/Marpa-R2/pod/Event.pod#Pre-lexeme-events

--
You received this message because you are subscribed to the Google Groups "marpa parser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ron Savage

unread,
Dec 13, 2015, 10:06:00 PM12/13/15
to marpa parser
Also, on Marpa's home page (http://savage.net.au/Marpa.html#Perl_Packages) you'll find various modules which use that pre-lexeme event mechanism. These are just mine; there may be others:
o GraphViz2::Marpa
o MarpaX::Demo::StringParser (used to investigate issues before incorporation into the above)
o MarpaX::Languages::Perl::PackUnpack
o Text::Balanced::Marpa
o Text::Delimited::Marpa

The World is Your Now-parsable Oyster!

Reply all
Reply to author
Forward
0 new messages