ModuleBNFC-2.9.5Haskell2010
BNFC.Backend.Common.NamedVariables
- 6 types
- 6 values
- PackageBNFC-2.9.5
- Exports12
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceNamedVariables.hs
A symbol-mapping environment.
Map keywords to their token name.
Map keywords and user-defined token types to their token name.
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:
getVars [Cat "A", Cat "B", Cat "A"][("A",1),("B",0),("A",2)]
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 ";"]