Hacker News new | past | comments | ask | show | jobs | submit login

Writing parsers with parser combinator libraries (personally, I use FParsec on F# and pyparsing on Python) feels like this all the time. I am especially happy about one doubly-recursive, parametric parser I had to write to handle an expression grammar of this kind:

    <Expr> ::= <Reference> | <NumericLiteral> | <Expr> '+' <Expr> | ...
    <Reference> ::= <identifier> | <ArrayRef>
    <ArrayRef> ::= <identifier> '[' <Expr> ']' 
    <Varname> ::= ... (The parser is parametric in the parser for <Varname>)
... without upsetting the F# typechecker.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: