in reply to BURL: The Orcish scripting language

So when can we expect a source filter for this BURL? :)

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.
  • Comment on Re: BURL: The Orcish scripting language

Replies are listed 'Best First'.
Re: Re: BURL: The Orcish scripting language
by rje (Deacon) on Dec 20, 2001 at 22:08 UTC
    Well, the easier filter is to convert BURL back to perl. Converting perl to BURL appears to be more difficult.

    # # būrl to perl filter # # būrl is the Orcish variety of perl. # not as expressive, and more restrictive. # # usage: # # perl -p orc2perl.pl source_file.bl > outfile.pl # s/ū/uu/; s/ā/aa/; s/ u / \# /; s/^u /\# /; s/^u$/\#/; s/ u$/ \#/; s/(uur|kuu) (.*)( \# .*)?$/for ($2) { $3/; s/gaakh (.*)( \# .*)?$/if ($1) { $2/; s/ash/} else {/; s/ghaash (.*)( \# .*)?$/} elsif ($1) { $2/; s/fulg (.*)( \# .*)?$/while ($1) { $2/; s/uluuk/for(;;) {/; s/buurz!(.*)( \# .*)?$/sleep($1); $2/; s/kuu (.*)( \# .*)?$/until ($1) { $2/; s/(nar|sha)!/};/; s/ai!/print STDERR/; s/snaga (.*)( \# .*)?$/sub $1 { $2/; s/ash/scalar/; s/bhaduur/chdir/; s/pushdug/push/; s/prakhug/pop/; s/maturz/kill/; s/dab/my/; s/mat/die/; s/baduzg/open/; s/fauth/close/; s/mog!/print;/; s/mog/print/; s/thrak/join/; s/raakh!/split;/; s/raakh/split/;
      Well, Filter::Simple is staring at you :)

      Greetz
      Beatnik
      ... Quidquid perl dictum sit, altum viditur.