   how to implement a rule-based modeling system
  Hi.I am lerning to write an L-system like program that can load user-provided "rules", and generate street networks from these rules. I have read some academic papers on it, and have had a look at Procedural's  CityEngine. In cityEngine the rules loook like this:Lot-->   extrude(height) EnvelopeEnvelope-->   case geometry.isRectangular(10); 50% : Tower 25% : UShape else: LShape   else 50% : LShape else: TowerLShape -->...... The questions are 1) how to parse rules like above provided in a txt file. 2) and what's the general pattern to apply "rules".. . could you give me some advices on it. or tell me what books, or open-source implementation I can refer to ?Thanks   