 --
 -- > tokenGetAntlrString token
 --
--- | For identifier tokens, the token string is interesting.  For
--- | other tokens such as operator tokens, the token string is
--- | uninteresting, and may not be present, the token identifier enum 
--- | should be used instead.
+--   For identifier tokens, the token string is interesting.  For
+--   other tokens such as operator tokens, the token string is
+--   uninteresting, and may not be present, the token identifier enum 
+--   should be used instead.
 {#fun tokenGetAntlrString
  { toCommonToken `Ptr (CommonToken)' } -> `Ptr (AntlrString)' fromAntlrString#}
 

#endc

-- | Lookahead in the input stream at the token at the specified
-- | positive offset, where:
--
-- > LT input 1 
--
-- | is the current token.  Or a negative offset may be specified, where: 
--
-- > LT input (-1) 
--
-- | is the previous token.
--
-- > foreign export ccall isUnsignedInt :: Ptr InputStream -> IO Bool
-- > isUnsignedInt input =

    return (Just s)

-- | Obtain the token Maybe String for the specified token.
--   For identifier tokens, the token string is interesting.  For
--   other tokens such as operator tokens, the token string is
--   uninteresting, and may not be present, the token identifier enum 
--   should be used instead.
tokenGetTextMaybe :: Ptr (CommonToken) -> IO (Maybe String)
tokenGetTextMaybe c =
  tokenGetAntlrString c >>= \s ->
  fromAntlrStringToMaybeString (AntlrString s)

-- | Convert from an ANTLR string to a String.
--   Note: the peekCStringLen function does not say what will happen if the
--   c pointer is 0.
fromAntlrStringToString :: AntlrString -> IO String
fromAntlrStringToString (AntlrString x) = 
  {#get ANTLR3_STRING->chars#} x >>= \c ->
