From 75d228629a267da1be6c26a6fb13a14f3da0f7c2 Mon Sep 17 00:00:00 2001 From: bringert Date: Mon, 21 Mar 2005 13:27:04 +0000 Subject: Build cfgm files using the nondeterministic conversion. Allow coercions in cfgm rule functions and remove the name. --- src/GF/CFGM/ParCFG.y | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/GF/CFGM/ParCFG.y') diff --git a/src/GF/CFGM/ParCFG.y b/src/GF/CFGM/ParCFG.y index b6021bcd6..70432ecb7 100644 --- a/src/GF/CFGM/ParCFG.y +++ b/src/GF/CFGM/ParCFG.y @@ -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 } -- cgit v1.2.3