Skip to content

Tsukuba-Programming-Lab/Ftpageh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copager2(仮)

Bin

  • Main : メインプログラム

Library

Example

記述例(app/Main.hs

main :: IO () main = do input <- getLine result <- runProcessor mkProcessor input case result of Left err -> putStrLn $ "error: " ++ show err Right sexp -> fmtPrint sexp mkProcessor :: ProcessorT IO ArithmeticToken ArithmeticRule () (SExp _ _) mkProcessor = ProcessorT setup process where setup _ = (mkSLR1 Addition, empty) process = do token <- lex events <- parse token consume events

実行

$ cabal run main (10 + 20) * 30 - Addition - Multiplication - Multiplication - Number - Addition - Addition - Multiplication - Number: 10 - Multiplication - Number: 20 - Number: 30 

About

Haskell製 再構成可能な生成系 / JSSST PPL

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published