cleder / parsewkt

A WKT Parser generated with grako
Other
16 stars 5 forks source link

Whitespace in the EBNF #2

Open namedgraph opened 1 year ago

namedgraph commented 1 year ago

Hi. I'm attempting to convert your WKT grammar to the W3C notation. I noticed it's missing whitespace. Given this example: POINT Z (11.4314 46.8979 948) there's space after POINT and after Z. But the relevant rules:

point_text_representation = "POINT" [ z_m ] point_text;
z_m = "ZM" | "Z" | "M";
point_text =
    empty_set |
    left_paren point right_paren;

do not allow for any whitespace?

namedgraph commented 1 year ago

Or should the whitespace in the rules such as "POINT" [ z_m ] point_text be considered significant?

cleder commented 1 year ago

It should allow for whitespace - POINT Z (1 2 3) is valid, I am not sure if whitespace is allowed between Z and M.

BTW, this is a very old repo, grako is unmaintained, https://github.com/neogeny/tatsu is the predecessor

namedgraph commented 1 year ago

I just need the grammar :)