Questions tagged [grammar]
64 questions
9
votes
3 answers
Does it make sense to use "ys" instead of "ies" in identifiers to ease find-and-replace functionality?
Although grammatically incorrect, when writing identifiers for functions, variables etc. does it make sense to simply append an "s" to plurals of words ending in Y? My reason for this would be that if you need to find-and-replace, for example,…
SHNC
- 117
3
votes
3 answers
What makes one language any better than another when both are designed for the same goals?
I'm in the process of creating a grammar for a scripting language but as I'm working on it I started to wonder what makes a language good in the first place. I know the goals for my script but there are always 1000 different ways to go about doing…
Justin808
- 139
2
votes
1 answer
Inferring programmatically terminals and non-terminals in context-free grammars?
I'm trying to compute the FIRST and FOLLOW sets of a CFG (using Python).
To do this I need to recognise terminals and non-terminals. I can (as a human) read them, but I was wondering if there was computational logic for inferring terminals and…
mavavilj
- 485
- 4
- 13
0
votes
1 answer
About grammar, Chomsky hierarchy and obj file format
Considering the Wavefront obj file format where this syntax fits in the Chomsky hierarchy and why ? I'm also not sure if PEG grammars are being considered in the kind of classification made by Chomsky and if an obj is a real example of a PEG grammar…
user2485710
- 231