Build cfgm files using the nondeterministic conversion. Allow coercions in cfgm rule functions and remove the name.

This commit is contained in:
bringert
2005-03-21 13:27:04 +00:00
parent 96a08c9df4
commit 75d228629a
9 changed files with 312 additions and 254 deletions

View File

@@ -16,6 +16,7 @@ import ErrM
':' { PT _ (TS ":") }
'.' { PT _ (TS ".") }
'->' { PT _ (TS "->") }
'_' { PT _ (TS "_") }
'[' { PT _ (TS "[") }
']' { PT _ (TS "]") }
',' { PT _ (TS ",") }
@@ -60,7 +61,7 @@ ListFlag : {- empty -} { [] }
Rule :: { Rule }
Rule : Ident ':' Name Profile '.' Category '->' ListSymbol { Rule $1 $3 $4 $6 $8 }
Rule : Fun ':' Profile '.' Category '->' ListSymbol { Rule $1 $3 $5 $7 }
ListRule :: { [Rule] }
@@ -68,6 +69,11 @@ ListRule : {- empty -} { [] }
| ListRule Rule ';' { flip (:) $1 $2 }
Fun :: { Fun }
Fun : Ident { Cons $1 }
| '_' { Coerce }
Profile :: { Profile }
Profile : '[' ListInts ']' { Profile $2 }
@@ -99,10 +105,6 @@ ListSymbol : '.' { [] }
| Symbol ListSymbol { (:) $1 $2 }
Name :: { Name }
Name : SingleQuoteString { Name $1 }
Category :: { Category }
Category : SingleQuoteString { Category $1 }