Lexer by need.

This commit is contained in:
aarne
2003-11-17 15:17:53 +00:00
parent 9d55f72d7a
commit 70c9f7b365
14 changed files with 81 additions and 24 deletions

View File

@@ -15,8 +15,9 @@ import Char (isUpper, isLower, toUpper, toLower)
-- abstract type CF.
-- Invariant: each category has all its rules grouped with it
-- also: the list is never empty (the category is just missing then)
newtype CF = CF ([(CFCat,[CFRule])], CFPredef)
newtype CF = CF ([CFRuleGroup], CFPredef)
type CFRule = (CFFun, (CFCat, [CFItem]))
type CFRuleGroup = (CFCat,[CFRule])
-- CFPredef is a hack for variable symbols and literals; normally = const []
data CFItem = CFTerm RegExp | CFNonterm CFCat deriving (Eq, Ord,Show)