// // File GRPRN.RF // // Project: GR // $use StdIO; $func PrintSetLoop e.TkList = ; $func PrintSetRest e.TkList = ; PrintGrammar (e.Tokens) (e.Rules) = , , , ; PrintSet e.TkList = ; PrintSetLoop { s1 s2 s3 s4 s5 v.Rest = , = ; s1 s2 s3 s4 s5 = ; e.Rest = ; }; PrintSetRest { s1 v.Rest = ; s1 = ; = ; }; PrintRules { $l e (sN e.Rules) e, , \{ e.Rules : $l eL (e.Rhs) eR, { eL : = ":"; = "|";} :: s.Prefix, , $fail; , $fail; }, $fail; e; }; PrintRhs { = ; $l e (s.Tag s.Sym) e, , $fail; e = ; }; PrintAnnSym (e.Nullable) s.Sym = { e.Nullable : e s.Sym e = ; = ; }, ; PrintAnnRhs (e.Nullable) (e.Rhs) = e.Rhs : { = ; $l e (s.Tag s.Sym) e, , $fail; e = ; }; PrintEnv { $l e (s.N (eV)) e, \n ">, $fail; e = ; };