Hand-rolling a parser in Scheme for EBNF (already made the tokenizer!) (gist.github.com)
from ChubakPDP11@programming.dev to programming@programming.dev on 01 May 14:03
https://programming.dev/post/13505815

In the Gist, I have explained my problem, and I have provided my tokenizer as well. If you can help me with the parser, that would be great. Also if my tokenizer is not very well-structured, please tell me.

btw the tokenizer is written in extremely portable Scheme. I think Chez is the best interpreter for Scheme.

#programming

threaded - newest

cerement@slrpnk.net on 01 May 15:08 next collapse

SICP

madnificent@lemmy.world on 01 May 21:19 collapse

github.com/mu-semtech/sparql-parser contains an EBNF parser for SPARQL, an LL(1) language. You might be able to borrow code, not sure how well it translates to scheme. GitHub asked me to log in to see the gist so I’d have to have a peek later.

sparql-ast folder contains the relevant bits regarding the parsing.