LanX has asked for the wisdom of the Perl Monks concerning the following question:
I looked in App::a2p trying to understand how awk is translated to Perl
... but it's written in C, which is
From https://metacpan.org/source/LEONT/App-a2p-1.013/a2p.c
Question: Is there an obvious way to translate this to Perl regexes?
A result could be a parse tree, inspected by a walker to generate Perl code.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
I just realized that the real YACC/LEX rules are only available on GitHub
https://github.com/Leont/app-a2p/blob/master/a2p.y
Leon pruned this file from the CPAN version.
This makes obviously more sense than decipering the generated C-files.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: YACC rules to regex rules ?
by perlfan (Parson) on Aug 31, 2020 at 18:17 UTC | |
by LanX (Saint) on Aug 31, 2020 at 22:02 UTC | |
by LanX (Saint) on Sep 02, 2020 at 13:01 UTC | |
by tybalt89 (Monsignor) on Sep 02, 2020 at 13:24 UTC | |
by Anonymous Monk on Sep 04, 2020 at 03:03 UTC | |
A reply falls below the community's threshold of quality. You may see it by logging in. |