"Sorry, young man, but it's Turtles all the way down!" Execute a Lindenmayer System

A Lindenmayer System (or L-system) is related to Thue and Post systems, and is used in botanical modeling and fractal generation.

An L-system is described by string-rewriting where a symbol from the symbol-alphabet is mapped to a replacement sequence of symbols. A collection of these mappings constitutes the L-system proper.

The graphical output method as devised by Prusinkiewicz interprets the resulting sequence after the mappings have been applied to an initial sequence for a specified number of iterations, as Turtle-Drawing commands: forward, backward, left, right, that kind of stuff. This may require extra code to control the scale of the drawing as different iteration counts may produce drastically differently-sized images.

Your task is to execute an L-system in the fewest number of characters. Your program must be able to render both the Dragon Curve and the Branching Stems from the Wikipedia page by providing appropriate input (file, command-line, but external to the source, please).

 

This is code golf.

Edit: Here are some examples I've posted around town. answer to SO/rotate-to-north {Where I first discovered the L-system}, answer to SO/how-to-program-a-fractal, answer to SO/recursion-in-postscript, comp.lang.postscript discussion/recital, postscript l-system collection, codegolf.SE/draw-a-sierpinski-triangle {origin of the competition between myself and thomasW}.
Mathematica 200 198 188 171 168 

Spaces added for clarity:

f[i_, b_, h_, j_, r_, n_] :=
 (a = h; p = j; s = k = {}; t = Flatten;
  (Switch[#,
      6, s = {a, p, s},
      8, {a, p, s} = s,
      _C, k = {k, Line@{p, p += {Cos@a, Sin@a}}}];
     If[# &lt; 9, a += I^# b ]) &amp; /@ t@Nest[# /. r &amp;, i, n];
  Graphics@t@k)


Where:


  i : Initial state;
  b : rotation angle
  h : initial angle
  j : initial position
  r : production rules
  n : iterations  


Production rules grammar:


  2 = Turn Left (-);
  4 = Turn Right (+);
  6 = Push and Turn Left  ("[");
  8 = Pop  and Turn Right ("]");
  C[i] = Draw (Any number of symbols)
  Any other symbol = Do Nothing, just use it in producing next state (Any number of symbols)    


The {2,4,6,8} sequence is there because I'm using I^n (I = imaginary unit) to make turns.

Examples:

f[{C[1], X}, Pi/2, 0, {0, 0}, {X -&gt; {X, 4, Y, C[1]}, Y -&gt; {C[1], X, 2, Y}}, 10]




f[{C@1}, Pi/2, 0, {0,0}, {C@1-&gt;{C@1, 2, C@1, 4, C@1, 4, C@1, 2, C@1}}, 6]




f[{C[1]}, Pi/4, Pi/2, {0, 0}, {C[2] -&gt; {C[2], C[2]}, C[1] -&gt; {C[2], 6, C[1], 8, C[1]}}, 10]




f[{C[1]}, Pi/3, 0, {0, 0}, {C@1 -&gt; {C@2, 4, C@1, 4, C@2}, C@2 -&gt; {C@1, 2, C@2, 2, C@1}}, 10]




f[{X},5/36 Pi, Pi/3, {0,0},{X-&gt;{C@1, 4, 6, 6, X, 8, 2, X, 8, 2, C@1, 6, 2, C@1, X, 8, 4, X},
                            C@1-&gt;{C@1, C@1}}, 6]