Skip to content

Tsukuba-Programming-Lab/Ftpageh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ftpageh

記述例(app/src/Arithmetic.hs

main :: IO ()
main = do
    input <- getLine
    result <- runProcessor mkProcessor input
    case result of
        Right sexp -> print sexp
        Left err -> putStrLn $ "error: " ++ show err

mkProcessor :: ProcessorT IO ArithmeticToken ArithmeticRule (SExp _ _)
mkProcessor = ProcessorT $ do
    token <- lex
    events <- parse token
    consume events

Library

Example

普通のパーサ

エラーハンドリング