rita
Class RiGrammarX

java.lang.Object
  extended by rita.RiObject
      extended by rita.RiGrammarX
All Implemented Interfaces:
processing.core.PConstants, RiGrammarIF, RiConstants

public class RiGrammarX
extends RiObject
implements RiGrammarIF

Implementation of a (probabilistic) context-free grammar (with specific literary extensions) that performs generation from user-specified grammars.

 
    RiGrammar rg = new RiGrammar(this, "mygrammar.g");
    String result = rg.expand();
    System.out.println(result);
RiTa grammar files are plain text files (generally ending with the '.g' extension and residing in the 'data' folder) that follow the format below (< and > are optional):
 
      <start> => <rule1> | <rule2> | <rule3>

      <rule2> => terminal1 | terminal2 | <rule1>  

      <rule3> => terminal3 | terminal4 \
      terminal5 | terminal6

      # this is a comment 
    }
    ...
Primary methods of interest: Other items of note: