Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Perl not BNF-able??

by Anonymous Monk
on Jul 04, 2005 at 16:03 UTC ( #472267=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl not BNF-able??
in thread Perl not BNF-able??

Yes, the context-free idea isn't a logical necessity for expressing in BNF, because that alone can be conquered by expressing the different context types as alternative BNF definitions.
How so? Could you give a BNF snippet that would express how to generate a forward declaration of a subroutine that matches the signature of the actual subroutine definition?
Rather, the most compelling arguments that have been made in reply here come from those perl syntax elements which overpower the nearby context, such as (amongst other examples given by various people) the e-regexp modifier.
The /e regexp modifier? In which way does that "overpower" nearby context? Couldn't that construct be parsed with the following BNF snippet:
non-a-slash: # string that doesn't contain a non escaped slash SUBSTITION: non-eval-substition | eval-substitution non-eval-substitution: 's' '/' not-a-slash '/' not-a-slash '/' non-e-modifiers +(*) eval-substitution: 's' '/' not-a-slash '/' slashless-code '/' e-modifiers( +*) non-e-modifiers: 'x' | 's' | 'm' | 'g' | 'x' | 'i' e-modifiers: 'e' | non-e-modifiers
Assuming you could create BNF for Perl code (and then you can create BNF for Perl code that doesn't contain a slash).

Grammars expressed in BNF can be parsed with recursive decent parsers (which do not have a fixed lookahead) - and if you can create a parser for all other Perl constructs, I can parse the difference between s/// and s///e.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://472267]
help
Chatterbox?
[hippo]: But APR.pm is under vendor_perl in your error message so you are mixing up modules installed from the packager and by hand. That's rarely a good plan.
[vedagiri89]: the prm is..works fine if i run file directly..not working if i run through apache http file
[hippo]: Environments differ.
[vedagiri89]: so, how to fix that differ
[choroba]: option one is install everything from the vendor
[choroba]: option two is install everything by hand
[choroba]: option three is mixed the two, but know well what you're doing
[vedagiri89]: right..let me check

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2018-06-19 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (113 votes). Check out past polls.

    Notices?