Parsec

bison マニュアルの中間記法電卓

Parsec.Expr を使用 module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Expr import Text.ParserCombinators.Parsec.Token( TokenParser, makeTokenParser, reservedOpNames ) import qualified Text.ParserCom…

bison マニュアルの中間記法電卓

コマンドラインからの入力 module Main where import System import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token( TokenParser, makeTokenParser ) import qualified Text.ParserCombinators.Parsec.Token as P import Text.…

bison マニュアルの中間記法電卓

小数で module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token( TokenParser, makeTokenParser ) import qualified Text.ParserCombinators.Parsec.Token as P import Text.ParserCombinators.Parsec.Languag…

bison マニュアルの中間記法電卓

整数のみ module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token( TokenParser, makeTokenParser ) import qualified Text.ParserCombinators.Parsec.Token as P import Text.ParserCombinators.Parsec.Langu…

Parsec.Perm:(), ()

Prelude> :m Text.ParserCombinators.Parsec.Perm Prelude Text.ParserCombinators.Parsec.Perm> :t (<$?>) (<$?>) :: (a -> b) -> (a, Text.ParserCombinators.Parsec.Prim.GenParser tok st a) -> PermParser tok st b Prelude Text.ParserCombinators.Par…

Parsec.Perm:(), ()

Prelude> :t Text.ParserCombinators.Parsec.Perm.(<$$>) <interactive>:1:0: Not in scope: data constructor `Text.ParserCombinators.Parsec.Perm' <interactive>:1:35: Not in scope: `<$$>' Prelude> :m Text.ParserCombinators.Parsec.Perm Prelude Text.ParserCombinators.Parse</interactive></interactive>…

Parsec.Perm:permute

Prelude> :t Text.ParserCombinators.Parsec.Perm.permute Text.ParserCombinators.Parsec.Perm.permute :: Text.ParserCombinators.Parsec.Perm.PermParser tok st a -> Text.ParserCombinators.Parsec.Prim.GenParser tok st a まんま module Main where i…

Parsec.Perm:PermParser

Prelude> :m Text.ParserCombinators.Parsec.Perm Prelude Text.ParserCombinators.Parsec.Perm> :i PermParser data PermParser tok st a = Text.ParserCombinators.Parsec.Perm.Perm (Maybe a) [Text.ParserCombinators.Parsec.Perm.Branch tok st a] -- D…

Parsec.Error:mergeError

Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t mergeError mergeError :: ParseError -> ParseError -> ParseError Prelude Text.ParserCombinators.Parsec.Error> mergeError (newErrorUnknown (Text.…

Parsec.Error:setErrorMessage

Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t setErrorMessage setErrorMessage :: Message -> ParseError -> ParseError Prelude Text.ParserCombinators.Parsec.Error> setErrorMessage (SysUnExpec…

Parsec.Error:setErrorPos

Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t setErrorPos setErrorPos :: Text.ParserCombinators.Parsec.Pos.SourcePos -> ParseError -> ParseError Prelude Text.ParserCombinators.Parsec.Error>…

Parsec.Error:addErrorMessage

Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t addErrorMessage addErrorMessage :: Message -> ParseError -> ParseError Prelude Text.ParserCombinators.Parsec.Error> addErrorMessage (SysUnExpec…

Parsec.Error:newErrorUnknown

Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t newErrorUnknown newErrorUnknown :: Text.ParserCombinators.Parsec.Pos.SourcePos -> ParseError Prelude Text.ParserCombinators.Parsec.Error> (newE…

Parsec.Error:newErrorMessage

Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t newErrorMessage newErrorMessage :: Message -> Text.ParserCombinators.Parsec.Pos.SourcePos -> ParseError Prelude Text.ParserCombinators.Parsec.E…

Parsec.Error:errorIsUnknown

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t errorIsUnknown <interactive>:1:0: Not in scope: `errorIsUnknown' Prelude Text.ParserCombinators.Parsec> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombin</interactive>…

Parsec.Error:showErrorMessages

Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t showErrorMessages showErrorMessages :: String -> String -> String -> String -> String -> [Message] -> String Prelude Text.ParserCombinators.Par…

Parsec.Error:messageEq

Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t messageEq messageEq :: Message -> Message -> Bool Prelude Text.ParserCombinators.Parsec.Error> messageEq (SysUnExpect "foo") (SysUnExpect "foo"…

Parsec.Error:messageCompare

Prelude> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinators.Parsec.Error> :t messageCompare messageCompare :: Message -> Message -> Ordering Prelude Text.ParserCombinators.Parsec.Error> :t (SysUnExpect "foo") (SysUnExpec…

Parsec.Error:Message

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t Message <interactive>:1:0: Not in scope: data constructor `Message' Prelude Text.ParserCombinators.Parsec> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCom</interactive>…

Parsec.Error:errorMessages, messageString

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t errorMessages <interactive>:1:0: Not in scope: `errorMessages' Prelude Text.ParserCombinators.Parsec> :m Text.ParserCombinators.Parsec.Error Prelude Text.ParserCombinat</interactive>…

Parsec.Error:errorPos

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t errorPos errorPos :: ParseError -> SourcePos module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Text.…

Parsec.Error:ParseError

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :i ParseError data ParseError = Text.ParserCombinators.Parsec.Error.ParseError !SourcePos [Text.ParserCombinators.Parsec.Error.Message] -- Defined in Text.Par…

Parsec.Prim:setInput

module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Text.ParserCombinators.Parsec.Language lexer :: TokenParser () lexer = makeTokenParser(javaStyle) test = do { setInput "foo" ; string …

Parsec.Prim:getInput

module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Text.ParserCombinators.Parsec.Language lexer :: TokenParser () lexer = makeTokenParser(javaStyle) test = do { string "foo" ; x <- getI…

Parsec.Prim:setPosition

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t setPosition setPosition :: SourcePos -> GenParser tok st () module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Tok…

Parsec.Prim:getPosition

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t getPosition getPosition :: GenParser tok st SourcePos module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token imp…

Parsec.Prim:updateState

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t updateState updateState :: (st -> st) -> GenParser tok st () module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.To…

Parsec.Prim:setState

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t setState setState :: st -> GenParser tok st () module Main where import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Token import Tex…

Parsec.Prim:getState

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t getState getState :: forall st tok. GenParser tok st st Prelude Text.ParserCombinators.Parsec> getSate <interactive>:1: Variable not in scope: `getSate' module Main whe</interactive>…

Parsec.Prim:unexpected

Prelude> :m Text.ParserCombinators.Parsec Prelude Text.ParserCombinators.Parsec> :t unexpected unexpected :: forall a st tok. String -> GenParser tok st a Prelude Text.ParserCombinators.Parsec> parseTest (unexpected "MESSAGE") "abc" Loadin…