in reply to Cannot get Marpa::R2 to prioritise one rule over another

Regexp::Common::net Regexp::Common::URI::RFC1035
  • Comment on Re: Cannot get Marpa::R2 to prioritise one rule over another

Replies are listed 'Best First'.
Re^2: Cannot get Marpa::R2 to prioritise one rule over another
by Anonymous Monk on Jan 21, 2021 at 20:21 UTC

    While these regex libraries are useful, I don't think I can fold them directly into a Marpa DSL definiton. From what I can tell, I can only use individial character classes, and would have to comprise a number of lexeme tokens to match the relative complexity of the IPv4 (and especially IPv6) expressions.

    In my more-specific application, I am indeed intending to validate the IPs externally -- probably with Net::IP. To that end, I may well alter the DSL just to accept NAME, and lay off the exact semantics to a subroutine with an if (is_ip4(...) { ... } elsif (is_ip6(...) { ... } else { assume_hostname(...) } flavour.

    Thanks for looking in...

    J.