<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>hi<BR>
<BR>
I am writing a basic Parser from scratch. So far I have functions;<BR><BR># removeSpaces<BR># match - which checks if a string is a substring of another<BR># orParser which combines two parser's abilities<BR># Basic pasrers like... parseInt, parseTrue, parseFalse, parseBool<BR>using the orParser on True and False.<BR><BR>What I want to do now is have a parseBinaryOp that recognises:<BR>parseBinaryOp "+" "(5 + 2) if" >>>gives>><BR> [(EInt 5, EInt 2, "if")]<BR><BR>So I think that I have to split the initial string into four parts.<BR><BR>"+" becomes op<BR>'(' becomes tokenF<BR>')' becomes tokenB<BR>"5" becomes e1<BR>"2" becomes e2<BR><BR>parseBinaryOp :: String -> String -> [(Expr, Expr, String)]<BR>parseBinaryOp op str = let (tokenF,e1,op,e2,tokenB) =<BR><BR>I am not sure how to go about separating the string for how I need it<BR>using my other functiuons.<BR> <BR>Ryan<BR><br /><hr />Are you the Quizmaster? <a href='http://specials.uk.msn.com/brainbattle' target='_new'>Play BrainBattle with a friend now!</a></body>
</html>