Regular expressions

已查看 37 次
跳至第一个未读帖子

Thomas Weigert

未读,
2015年12月13日 17:25:292015/12/13
收件人 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

未读,
2015年12月13日 19:26:192015/12/13
收件人 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

未读,
2015年12月13日 22:06:002015/12/13
收件人 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!

回复全部
回复作者
转发
0 个新帖子