Module ParsePos

Handling parse positions

Author: Jasper Sikorra - jsi@informatik.uni-kiel.de

Version: January 2014

Summary of exported operations:

tw :: Int  Deterministic 
unknown_fname :: String  Deterministic 
setPos :: String -> Int -> Int -> Int -> Pos  Deterministic 
Construct a new position
initPos :: String -> Pos  Deterministic 
Construct the initial position
getFilename :: Pos -> String  Deterministic 
setFilename :: Pos -> String -> Pos  Deterministic 
getAbs :: Pos -> Int  Deterministic 
setAbs :: Pos -> Int -> Pos  Deterministic 
moveAbs :: Pos -> Int -> Pos  Deterministic 
getLn :: Pos -> Int  Deterministic 
setLn :: Pos -> Int -> Pos  Deterministic 
moveLn :: Pos -> Int -> Pos  Deterministic 
getCol :: Pos -> Int  Deterministic 
setCol :: Pos -> Int -> Pos  Deterministic 
moveCol :: Pos -> Int -> Pos  Deterministic 
lnDifference :: Pos -> Pos -> Int  Deterministic 
The difference in lines between two positions
colDifference :: Pos -> Pos -> Int  Deterministic 
The difference in columns between two positions
absDifference :: Pos -> Pos -> Int  Deterministic 
The absolute difference between two positions
fullDifference :: Pos -> Pos -> (Int,Int)  Deterministic 
The line and column difference between two positions
movePosByChar :: Pos -> Char -> Pos  Deterministic 
Move the position one character
movePosByString :: Pos -> String -> Pos  Deterministic 
Move the position multiple characters
toSimplePos :: Pos -> (Int,Int)  Deterministic 
Convert to SimplePos
fromSimplePos :: (Int,Int) -> Pos  Deterministic 
Convert from SimplePos
fromSimplePosWithFname :: (Int,Int) -> String -> Pos  Deterministic 
Convert from SimplePos with Filename

Exported datatypes:


Filename

Type synonym: Filename = String


Absolute

Type synonym: Absolute = Int


Line

Type synonym: Line = Int


Column

Type synonym: Column = Int


SimplePos

Type synonym: SimplePos = (Int,Int)


Pos

The Pos data type contains the name of the file, the absolute, where every character is counted as 1 (newlines, tabs too) (starting with 0), the line (starting with 1) and the column (starting with 1) of the character's position.

Constructors:


Exported operations:

tw :: Int  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

unknown_fname :: String  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

setPos :: String -> Int -> Int -> Int -> Pos  Deterministic 

Construct a new position

Further infos:
  • solution complete, i.e., able to compute all solutions

initPos :: String -> Pos  Deterministic 

Construct the initial position

Further infos:
  • solution complete, i.e., able to compute all solutions

getFilename :: Pos -> String  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

setFilename :: Pos -> String -> Pos  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

getAbs :: Pos -> Int  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

setAbs :: Pos -> Int -> Pos  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

moveAbs :: Pos -> Int -> Pos  Deterministic 

getLn :: Pos -> Int  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

setLn :: Pos -> Int -> Pos  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

moveLn :: Pos -> Int -> Pos  Deterministic 

getCol :: Pos -> Int  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

setCol :: Pos -> Int -> Pos  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

moveCol :: Pos -> Int -> Pos  Deterministic 

lnDifference :: Pos -> Pos -> Int  Deterministic 

The difference in lines between two positions

colDifference :: Pos -> Pos -> Int  Deterministic 

The difference in columns between two positions

absDifference :: Pos -> Pos -> Int  Deterministic 

The absolute difference between two positions

fullDifference :: Pos -> Pos -> (Int,Int)  Deterministic 

The line and column difference between two positions

movePosByChar :: Pos -> Char -> Pos  Deterministic 

Move the position one character

movePosByString :: Pos -> String -> Pos  Deterministic 

Move the position multiple characters

toSimplePos :: Pos -> (Int,Int)  Deterministic 

Convert to SimplePos

Further infos:
  • solution complete, i.e., able to compute all solutions

fromSimplePos :: (Int,Int) -> Pos  Deterministic 

Convert from SimplePos

fromSimplePosWithFname :: (Int,Int) -> String -> Pos  Deterministic 

Convert from SimplePos with Filename