HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

ModuleBNFC-2.9.5Haskell2010

BNFC.Backend.Common.NamedVariables

  • 6 types
  • 6 values
  • PackageBNFC-2.9.5
  • Exports12
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceNamedVariables.hs
datadata SymKey
#

Constructors

Instances3Eq, Ord, Show
  • Eq SymKeyDefined in BNFC-2.9.5 · BNFC.Backend.Common.NamedVariables
  • Ord SymKeyDefined in BNFC-2.9.5 · BNFC.Backend.Common.NamedVariables
  • Show SymKeyDefined in BNFC-2.9.5 · BNFC.Backend.Common.NamedVariables
valuegetVars :: [Cat] -> [IVar]
#

Converts a list of categories into their types to be used as instance variables. If a category appears only once, it is given the number 0, if it appears more than once, its occurrences are numbered from 1. ex:

Example1 expression
getVars [Cat "A", Cat "B", Cat "A"][("A",1),("B",0),("A",2)]
valuenumVars :: [Either Cat a] -> [Either (Cat, Doc) a]
#

Anotate the right hand side of a rule with variable names for the non-terminals. >>> numVars [Left (Cat A), Right "+", Left (Cat B)] [Left (A,a_),Right "+",Left (B,b_)] >>> numVars [Left (Cat A), Left (Cat A), Right ";"] [Left (A,a_1),Left (A,a_2),Right ";"]