 -- | Lookahead in the input stream at the token at the specified
 -- | positive offset, where:
 --
--- @
---   LT input 1 
--- @
+-- > LT input 1 
 --
 -- | is the current token.  Or a negative offset may be specified, where: 
 --
--- @
---   LT input (-1) 
--- @
+-- > LT input (-1) 
 --
 -- | is the previous token.
 --
--- @
---   foreign export ccall isUnsignedInt :: Ptr InputStream -> IO Bool
---   isUnsignedInt input =
---     do token1 <- lT input 1 >>= tokenGetType
---        if token1 /= UNSIGNED
---          then return False
---          else 
---          do 
---            token2 <- lT input 2 >>= tokenGetType
---            return ((token2 /= CHAR) && (token2 /= SHORT) && (token2 /= LONG))
--- @
+-- > foreign export ccall isUnsignedInt :: Ptr InputStream -> IO Bool
+-- > isUnsignedInt input =
+-- >   do token1 <- lT input 1 >>= tokenGetType
+-- >      if token1 /= UNSIGNED
+-- >        then return False
+-- >        else 
+-- >        do 
+-- >          token2 <- lT input 2 >>= tokenGetType
+-- >          return ((token2 /= CHAR) && (token2 /= SHORT) && (token2 /= LONG))
 --
 {#fun LT as lT
  { toInputStream `Ptr (InputStream)',

-- | Obtain the character position in the source code line of where the token
-- | was read, for non-imaginary tokens.
--
-- @
--   foreign export ccall saTrue :: Ptr CommonToken -> IO (StablePtr TermInfo)
--   saTrue token =
--     do
--       -- obtain the source code line and charPosition from the token
--       l <- tokenGetLine token
--       c <- tokenGetCharPositionInLine token
--       -- return the TmTrue term
--       newStablePtr (TmTrue (Info l c))
-- @
--
tokenGetCharPositionInLine :: Ptr (CommonToken) -> IO Int
tokenGetCharPositionInLine token = {#get ANTLR3_COMMON_TOKEN->charPosition#} token >>= return . cIntConv

-- | Obtain the the source code line of where the token was read, for non-imaginary tokens.
--
-- @
--   foreign export ccall saFalse :: Ptr CommonToken -> IO (StablePtr TermInfo)
--   saFalse token =
--     do
--       -- obtain the source code line and charPosition from the token
--       l <- tokenGetLine token
--       c <- tokenGetCharPositionInLine token
--       -- return the TmFalse term
--       newStablePtr (TmFalse (Info l c))
-- @
--
tokenGetLine :: Ptr (CommonToken) -> IO Int
tokenGetLine token = {#get ANTLR3_COMMON_TOKEN->line#} token >>= return . cIntConv


-- | Obtain the token name ANTLR string for the specified token.
--
-- > tokenGetAntlrString token
--
-- | For identifier tokens, the token string is interesting.  For
-- | other tokens such as operator tokens, the token string is
