BenjaminSchaaf / sbnf

A BNF-style language for writing sublime-syntax files
MIT License
58 stars 6 forks source link

what type of parser is sublimetext? #22

Closed arcturus140 closed 3 years ago

arcturus140 commented 3 years ago

what type of parser is ST, do i have to write my grammar for top-down or bottom-up?

BenjaminSchaaf commented 3 years ago

It's top-down: There's a stack of contexts where each context has a set of regex matches that can push or pop the stack. ST4 also adds backtracking. Pretty sure this doesn't matter for a BNF though?

arcturus140 commented 3 years ago

It does for the parser, so I have to account for that in the grammar. The grammar doesn't care and can be written either way.