Robert Eaglestone > Lingua-Tolkien-BURL-0.50 > Lingua::Tolkien::BURL

Download:
Lingua-Tolkien-BURL-0.50.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.50   Source  

NAME ^

  Lingua::Tolkien::BURL -- An Orkish scripting language.

SYNOPSIS ^

   use Lingua::Tolkien::BURL;
   
   u   BURL uses the letter 'u' to denote comments.
   u   In Orkish, 'u' means 'to, towards', and thus
   u   probably implies something like 'ad hoc' for 
   u   BURL programmers, further strengthening the
   u   belief that Orcs make poor code documenters.
  
   magog This is only a test. --
   
   dab bat = shum 'a' o 'b' o 'e' -- skai 
   
   uur bat -- mogda nar!
   
   zabruuz gaakh 1 == 1 -- mog "ok" skai sha!
   
   dab myhashul!
   
   myhashuk gimb member! = 5 skai!
   
   mog myhashuk gimb member!!

   dab fugat = raakha o "a b c d e" skai

   uur fugat -- 
      mog da skai zabruuz! nar!

DESCRIPTION ^

BURL is based on perl -- in fact, it is a subset of perl, written with the Orc-programmer in mind. As such, control structures use Orkish or Black Speech instead of English; also, the rules of the scripting language are more constrained than perl. In fact, they are constrained to a format which is quite amenable to line-substitution translation into perl, strangely enough.

The most striking feature of BURL (aside from its use of Black Speech, of course) is the lopsided block delimiters nar! and sha!, which only terminate a block. BURL assumes that control structures begin all blocks (horrors!).

OVERVIEW ^

Here are the basic rules for BURL:

1. Exclamation points separate statements. So does the keyword 'skai'.

2. The double-dash separates control expressions from control blocks.

3. Blocks end with nar! or sha! (They are interchangeable).

4. û and uu are interchangeable, as are â and aa.

5. Commands may not always require whitespace separation. For example, the Perl snippet foreach (@bat) { print; } Can be written in BURL as: uur daurbat -- mogsha skai!

6. Scalar context is denoted by the suffix 'uk'. Array context is denoted by the suffix 'at'. Hash context is denoted by the suffix 'ul'.

   So, this declares a hashtable named "myhash":
   
      dab myhashul!
   
   And this accesses members of myhash:
   
      myhashuk{member};
      
   But there is also special way of indexing hashes:
   
      myhashuk gimb member!

You get the idea. Here is a (mostly) alphabetic index of the elements of BURL:

! ";"
u (Comment)
o (Comma)
at (Array context)

When found as a suffix, it serves as the array context (@). For example, 'bat' would be translated to '@b'.

uk (Scalar context)

When found as a suffix, it serves as the scalar context ($). For example, 'buk' would be translated to '$b'.

ul (Hash context)

When found as a suffix, it serves as the hash context (%). For example, 'bul' would be translated to '%b'.

adh "} else {".
ai! "print STDERR".
ash "1"
asha "scalar"
baduzg "open"
bal "2"
bhaduur "chdir"
buurz expr -- "sleep(expr); "
\bda\b "$_"
dab "my"
dho "8"
dig "4"
daur "@"
fauth "close"
fulg expr -- "while (expr) {"
gaakh expr -- "if (expr) {"
gakh "3"
ghaash expr -- "} elsif (expr) {"
gimb expr! "{expr}"
krak "5"
/^krimp/ "=pod"
krith "9"
/^krum/ "=cut"
kud "6"
kuu expr -- "until (expr) {"
lab expr! "[expr]"
mad "die"
madurz "kill"
magog expr -- "print "expr";"
mog "print"

"mog" works best with single variables. For printing messages, use "magog".

mogda "print;"
naar "0"
nar "};"
prakhug "pop"
pushdug "push"
raakh "split"
raakha "split ' '"
sha "};"
shum expr -- "(expr)" (List constructor)
skai ";"
snaga name -- "sub name {"
thag "10"
thrak "join"
udu "7"
lug "for(;;) {"
uur expr -- "for (expr) {"
zabruuz "print "\n";"

CAVEAT ^

Since the BURL filter relies upon willy-nilly string substitution, there may well be flaws in the current implementation...

AUTHOR ^

  Robert Eaglestone

COPYRIGHT ^

  Copyright 2004, Robert Eaglestone

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AVAILABILITY ^

The latest version of this library is likely to be available from CPAN.

syntax highlighting: