kjosib / booze-tools

Booze Tools will become the complete programming-language development workbench, all written in Python 3.9 (for now).
MIT License
14 stars 1 forks source link

Optional Enforced Conventions #33

Open kjosib opened 4 years ago

kjosib commented 4 years ago

By default BoozeTools assumes you know what you are doing.

For example, any symbol that's the left hand side of a production rule is non-terminal and any symbol mentioned but never given production rules is considered terminal.

In real-world grammars it's common to use a convention such as lower-case for (non-)terminals. This is originally for reader convenience, but the computer could also check that lower-case symbols actually have definitions, and upper-case ones don't (or vice-versa). The obvious problem is that this divides the world into at least two camps, each of which thinks the other is loony.

One idea is a %nonterm pragma which accepts either lower or upper as argument and specifies which letter case goes with one or the other. But what of camel case? Underlines? Case-insensitive orthography? The answer to these things is to wait and see if anyone complains.