I have been thinking over the last few days that I would really like to move away from the use of the term Production, mostly using the word Rule instead.
In general, I don’t think the tendency to use words in very strange ways in computing is a very good thing. It may not be the biggest problem out there, but I feel that it can create an extra, unnecessary level of obfuscation. For example, I have a certain peeve about the word Resource. In application programming, there is this tendency to refer to just about anything that is not code (source or binary) as a “resource” – i.e. an image, a sound file, a video clip…
Surely I am not the only one who hears the word “resource” and automatically thinks of petroleum or natural gas. Likewise, the “production” brings to mind industrial products like steel and automobiles and such. Well, there’s a theatrical production as well, but that also seems to have no relationship with grammars and parsing.
Finally, I think that if we talk about grammars, it is much more natural to use the term rule. A “grammar” is basically a set of “rules”, isn’t it? In the terminology used in the JavaCC grammar itself, we have the
BNFProduction, which is a grammatical rule in BNF notation. We also have
TokenProduction, which is used on the lexical side. A
TokenProduction is a set of regular expressions.
I guess most anybody in this space knows perfectly well what a “regular expression” is, but let’s face it, even that is technical jargon. I think that, in most cases, the use of the term Pattern would be better.
So, my idea is that, on the parser side, we mostly talk about rules and on the lexer/scanner side, we mostly talk about patterns. Or occasionally, we could use the more technical term regular expression, if that makes the text more clear.
I’m wondering whether there is any case in which it would not be clearer to use the term rule (or sometimes pattern) in preference over production. I can’t think of any offhand.
I would really encourage anybody lurking to put in their two cents on this issue. Surely everybody has an opinion about this topic, no? Based on server logs, I know that there is some traffic on this site. (Not a lot, but some…) How to put it? I don’t want to sound like I’m whining or begging either, but it is harder to keep going when you don’t get hardly any feedback. It isn’t that hard to sign up on the forum and write a comment. So how about it? So why not make your voice heard?
Which terminology do you prefer for referring to these things?