mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-28 22:12:51 -06:00
Updated to latest CFG specification from gfc2java
This commit is contained in:
@@ -132,7 +132,8 @@ instance Print Symbol where
|
||||
TermS str -> prPrec i 0 (concatD [prt 0 str])
|
||||
|
||||
prtList es = case es of
|
||||
[] -> (concatD [])
|
||||
[] -> (concatD [doc (showString ".")])
|
||||
[x] -> (concatD [prt 0 x])
|
||||
x:xs -> (concatD [prt 0 x , prt 0 xs])
|
||||
|
||||
instance Print Name where
|
||||
@@ -142,23 +143,51 @@ instance Print Name where
|
||||
|
||||
instance Print Category where
|
||||
prt i e = case e of
|
||||
Category identparam id params -> prPrec i 0 (concatD [prt 0 identparam , doc (showString ".") , prt 0 id , prt 0 params])
|
||||
Category identparam id projs -> prPrec i 0 (concatD [prt 0 identparam , doc (showString ".") , prt 0 id , prt 0 projs])
|
||||
|
||||
|
||||
instance Print IdentParam where
|
||||
prt i e = case e of
|
||||
IdentParam id params -> prPrec i 0 (concatD [prt 0 id , doc (showString "{") , prt 0 params , doc (showString "}")])
|
||||
IdentParam id fields -> prPrec i 0 (concatD [prt 0 id , doc (showString "{") , prt 0 fields , doc (showString "}")])
|
||||
|
||||
prtList es = case es of
|
||||
[] -> (concatD [])
|
||||
x:xs -> (concatD [prt 0 x , doc (showString "/") , prt 0 xs])
|
||||
|
||||
instance Print Param where
|
||||
instance Print Field where
|
||||
prt i e = case e of
|
||||
Param id -> prPrec i 0 (concatD [doc (showString "!") , prt 0 id])
|
||||
Field keyvalue -> prPrec i 0 (concatD [doc (showString ".") , prt 0 keyvalue])
|
||||
|
||||
prtList es = case es of
|
||||
[] -> (concatD [])
|
||||
x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs])
|
||||
|
||||
instance Print Proj where
|
||||
prt i e = case e of
|
||||
Proj param -> prPrec i 0 (concatD [doc (showString "!") , prt 0 param])
|
||||
|
||||
prtList es = case es of
|
||||
[] -> (concatD [])
|
||||
x:xs -> (concatD [prt 0 x , prt 0 xs])
|
||||
|
||||
instance Print KeyValue where
|
||||
prt i e = case e of
|
||||
KeyValue id param -> prPrec i 0 (concatD [prt 0 id , doc (showString "=") , prt 0 param])
|
||||
|
||||
prtList es = case es of
|
||||
[] -> (concatD [])
|
||||
[x] -> (concatD [prt 0 x])
|
||||
x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs])
|
||||
|
||||
instance Print Param where
|
||||
prt i e = case e of
|
||||
ParamSimple id -> prPrec i 0 (concatD [prt 0 id])
|
||||
ParamPatt id params -> prPrec i 0 (concatD [prt 0 id , doc (showString "(") , prt 0 params , doc (showString ")")])
|
||||
ParamRec keyvalues -> prPrec i 0 (concatD [doc (showString "{") , prt 0 keyvalues , doc (showString "}")])
|
||||
|
||||
prtList es = case es of
|
||||
[] -> (concatD [])
|
||||
[x] -> (concatD [prt 0 x])
|
||||
x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user