Ever tried parser combinators? I guess in the end they're still recursive descend parsers but they don't feel like it
See an example here
Parser combinators are mostly a DSL for writing recursive descent parsers. But yeah, it's a subject I could have covered, especially as there's some parser combinator libraries for mainstream languages like Python.
yep. I think they work better with languages with custom infix operators though
Haskell desperately needs more operators because you can't reuse normal infix operators due to lack of polymorphism in Haskell. Python parsec just reuses +, |, <<, >> etc. Example here.
+
|
<<
>>
The only time I really needed more operators was with Ruby Z3.
Not really. All those operators work on extremely polimorphic typeclasses like Monoid,Applicative or Alternative
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Ever tried parser combinators? I guess in the end they're still recursive descend parsers but they don't feel like it
See an example here
Parser combinators are mostly a DSL for writing recursive descent parsers.
But yeah, it's a subject I could have covered, especially as there's some parser combinator libraries for mainstream languages like Python.
yep. I think they work better with languages with custom infix operators though
Haskell desperately needs more operators because you can't reuse normal infix operators due to lack of polymorphism in Haskell.
Python parsec just reuses
+,|,<<,>>etc. Example here.The only time I really needed more operators was with Ruby Z3.
Not really. All those operators work on extremely polimorphic typeclasses like Monoid,Applicative or Alternative