UMinho Haskell Libraries (1.0)ContentsIndex
Language.Gnumeric.Formula
Portability portable
Stability experimental
Maintainer Cupertino Miranda and Joost Visser
Contents
Abstract syntax
Parsers, based on Parsec.
Lexical issues.
Description
Syntax for spreadsheet formulas.
Synopsis
data Formula
= Var String
| Fun String [Formula]
| Ref CellRef (Maybe CellRef)
data CellRef = CellRef {
sheet :: String
colNr :: Int
rowNr :: Int
}
showCellRef :: CellRef -> String
addSheetName :: String -> Formula -> Formula
parseFormula :: String -> String -> String -> Formula
formula :: Parser Formula
expr :: Parser Formula
table :: OperatorTable Char () Formula
binary :: String -> Assoc -> Operator Char () Formula
prefix :: String -> Operator Char () Formula
postfix :: String -> Operator Char () Formula
term :: Parser Formula
word :: Parser String
separator :: Parser ()
sheetCellReference :: Parser CellRef
singleCellReference :: Parser CellRef
cellReference :: Parser Formula
functionApplication :: Parser Formula
lexer :: TokenParser ()
columns :: [String]
toColNr :: String -> Int
toRowNr :: String -> Int
fromColNr :: Int -> String
fromRowNr :: Int -> String
Abstract syntax
data Formula
The type of formulas.
Constructors
Var StringVariables
Fun String [Formula]Function applications
Ref CellRef (Maybe CellRef)Cell or cell block reference
Instances
Eq Formula
Show Formula
Read Formula
Term Formula
Typeable Formula
data CellRef
Type of cell references
Constructors
CellRef
sheet :: StringSheet name
colNr :: IntColumn index
rowNr :: IntRow index
Instances
Eq CellRef
Show CellRef
Read CellRef
Ord CellRef
Term CellRef
Typeable CellRef
showCellRef :: CellRef -> String
Print a cell reference to a String.
addSheetName :: String -> Formula -> Formula
Add sheetname to all CellRef elements on Formula
Parsers, based on Parsec.
parseFormula :: String -> String -> String -> Formula
Top-level invocation of parser.
formula :: Parser Formula
Formulas.
expr :: Parser Formula
Expressions.
table :: OperatorTable Char () Formula
Table to build expression grammar.
binary :: String -> Assoc -> Operator Char () Formula
Helper.
prefix :: String -> Operator Char () Formula
Helper.
postfix :: String -> Operator Char () Formula
Helper.
term :: Parser Formula
Terms (leafs of expressions).
word :: Parser String
separator :: Parser ()
sheetCellReference :: Parser CellRef
singleCellReference :: Parser CellRef
cellReference :: Parser Formula
functionApplication :: Parser Formula
Function application.
Lexical issues.
lexer :: TokenParser ()
columns :: [String]
Infinite sequence of letter combinations that identify spreadsheet columns.
toColNr :: String -> Int
Convert a column name into a column number. For instance, A becomes 0 and AA becomes 26.
toRowNr :: String -> Int
Convert a row name into a row number. For instance, 1 becomes 0 and 10 becomes 9.
fromColNr :: Int -> String
Convert a column number into a column name. Inverse of toColNr.
fromRowNr :: Int -> String
Convert a row number into a row name. Inverse of toRowNr.
Produced by Haddock version 0.6