ContentsIndex
LSystem.Parse
Description
Functions for parsing L-System rules.
Synopsis
rule :: String -> Rule
axiom :: String -> Axiom
data Token
= TCommand String
| TNum Float
| TVar String
| TEquals
tokenise :: String -> [Token]
parseRule :: [Token] -> Rule
parseCommands :: [Token] -> ([Command], [Token])
parseCommand :: [Token] -> (Command, [Token])
parseCommand2 :: [Token] -> (Command, [Token])
Documentation
rule :: String -> Rule
A rule contains a left and right hand side separated by an '='
axiom :: String -> Axiom
An axiom is just a list of commands.
data Token
Basic lexemes.
Constructors
TCommand String
TNum Float
TVar String
TEquals
show/hide Instances
Eq Token
Show Token
tokenise :: String -> [Token]
Convert a string into a list of tokens.
parseRule :: [Token] -> Rule
Parse a rule. rule : commands '=' commands
parseCommands :: [Token] -> ([Command], [Token])
parseCommand :: [Token] -> (Command, [Token])
parseCommand2 :: [Token] -> (Command, [Token])
Produced by Haddock version 0.7