mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-14 13:42:50 -06:00
Build cfgm files using the nondeterministic conversion. Allow coercions in cfgm rule functions and remove the name.
This commit is contained in:
@@ -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 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user