yapb-0.1.3.1: Yet Another Parser Builder (YAPB)
Safe HaskellNone
LanguageHaskell2010

CommonParserUtil

Synopsis

Documentation

data LexerSpec token Source #

Constructors

LexerSpec 

Fields

data ParserSpec token ast Source #

data AutomatonSpec token ast Source #

Constructors

AutomatonSpec 

lexing :: TokenInterface token => LexerSpec token -> String -> IO [Terminal token] Source #

lexingWithLineColumn :: TokenInterface token => LexerSpec token -> Line -> Column -> String -> IO (Line, Column, [Terminal token]) Source #

parsing :: (TokenInterface token, Typeable token, Typeable ast, Show token, Show ast) => Bool -> ParserSpec token ast -> [Terminal token] -> IO ast Source #

runAutomaton :: (TokenInterface token, Typeable token, Typeable ast, Show token, Show ast) => Bool -> AutomatonSpec token ast -> [Terminal token] -> IO ast Source #

parsingHaskell :: (TokenInterface token, Typeable token, Typeable ast, Show token, Show ast) => Bool -> ParserSpec token ast -> [Terminal token] -> Maybe token -> IO ast Source #

runAutomatonHaskell :: (TokenInterface token, Typeable token, Typeable ast, Show token, Show ast) => Bool -> AutomatonSpec token ast -> [Terminal token] -> Maybe token -> IO ast Source #

get :: Stack token ast -> Int -> ast Source #

getText :: Stack token ast -> Int -> String Source #

data LexError Source #

Constructors

LexError Int Int String 

Instances

Instances details
Show LexError Source # 
Instance details

Defined in CommonParserUtil

Exception LexError Source # 
Instance details

Defined in CommonParserUtil

data ParseError token ast where Source #

Constructors

NotFoundAction :: (TokenInterface token, Typeable token, Typeable ast, Show token, Show ast) => Terminal token -> CurrentState -> Stack token ast -> ActionTable -> GotoTable -> ProdRules -> [Terminal token] -> ParseError token ast 
NotFoundGoto :: (TokenInterface token, Typeable token, Typeable ast, Show token, Show ast) => StateOnStackTop -> LhsSymbol -> Stack token ast -> ActionTable -> GotoTable -> ProdRules -> [Terminal token] -> ParseError token ast 

Instances

Instances details
(Show token, Show ast) => Show (ParseError token ast) Source # 
Instance details

Defined in CommonParserUtil

Methods

showsPrec :: Int -> ParseError token ast -> ShowS #

show :: ParseError token ast -> String #

showList :: [ParseError token ast] -> ShowS #

(TokenInterface token, Typeable token, Show token, Typeable ast, Show ast) => Exception (ParseError token ast) Source # 
Instance details

Defined in CommonParserUtil

successfullyParsed :: IO [EmacsDataItem] Source #

Parsing programming interfaces

successfullyParsed

handleParseError :: TokenInterface token => HandleParseError token -> ParseError token ast -> IO [EmacsDataItem] Source #

handleParseError handleParseError :: TokenInterface token => Bool -> Int -> Bool -> [Terminal token] -> ParseError token ast -> IO [EmacsDataItem] handleParseError flag maxLevel isSimple terminalListAfterCursor parseError = unwrapParseError flag maxLevel isSimple terminalListAfterCursor parseError