ericprud / SWObjects

Semantic Web swiss army knife C++ libraries
MIT License
15 stars 4 forks source link

Question: SPARQL parsed in LALR(1) #6

Closed shinobu closed 7 years ago

shinobu commented 8 years ago

The sparqlparser files note, that they are Skeleton implementation for Bison LALR(1) parsers in C++. But the SPARQL1.1 specification at w3c only says that it can be LL(1). Is your BNF for SPARQL a reworked version to fit for LALR(1) Parsing (/Parser Generators)? Or is the original Grammar actually LALR(1) as well?

ericprud commented 7 years ago

(sorry, just noticed this) The SWObjects grammar are all generated by yacker. That basically means that the BNFs are easy to translate mechanically into LALR(1) (sometimes the translation to LL(1) is more complex, iirc).