[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: custom error messages
From: |
Christian Schoenebeck |
Subject: |
Re: RFC: custom error messages |
Date: |
Sat, 18 Jan 2020 14:41:35 +0100 |
On Freitag, 17. Januar 2020 08:54:47 CET Akim Demaille wrote:
> >> Please, do not use "rule" when you mean "nonterminal symbol". It
> >> seems to confuse some people.
> >
> > I knew I'll get that ticking-off. :) "nonterminal symbol" is too long for
> > always using it, and most people know the semantic of "rule" in the
> > context of grammars. Invent a better, non ambiguous short term as
> > alternative then. ;-)
> There must be some confusion here: yes, most people know what a rule
> is, and it's definitely not the same as a nonterminal symbol.
>
> exp: exp '+' '0' | '0'
>
> There is one nonterminal (exp), two terminals ('+' and '0') and two
> rules ("exp: exp '+' '0'" and "exp: '0'").
>
> There are synonyms:
> - token, terminal, terminal symbol, letter
> - variable, nonterminal, nonterminal symbol
> - rule, production, production rule
>
> but in no universe "exp" is a rule. It's a symbol. Make it an NT
> if you want it to be short, but don't call it a "rule".
No confusion. Of course I understand you, especially if there are several
rules producing a certain non-terminal etc., and I will try to avoid that in
your environment, but TBH I still find that picky, sorry. :)
There is always fuzziness in human language. People who ever got in touch with
formal language theory usually know all the semantical details that you just
described. But if I'd try to always use very exact terms in every aspect &
context of my daily human language, that'll be extremely inefficient:
-function- -> function name
-Linux- -> GNU/Linux
-he- -> (s)he
-shock- -> psychological trauma [vs. anaphylactic shock]
-weed- [bot.] -> [non existent]
-linear- [math.] -> _affine_ (-linear) transformation
...
Best regards,
Christian Schoenebeck
- [PATCH 06/12] tests: compute verbose error messages from the custom ones, (continued)
- [PATCH 06/12] tests: compute verbose error messages from the custom ones, Akim Demaille, 2020/01/16
- [PATCH 05/12] yacc.c: check custom error messages, Akim Demaille, 2020/01/16
- [PATCH 07/12] yacc.c: isolate yyexpected_tokens, Akim Demaille, 2020/01/16
- [PATCH 08/12] yacc.c: let custom error messages see the location, Akim Demaille, 2020/01/16
- [PATCH 09/12] yacc.c: check custom error messages with parse-params, Akim Demaille, 2020/01/16
- [PATCH 10/12] tests: a clearer test for parse-params, Akim Demaille, 2020/01/16
- [PATCH 12/12] yacc.c: portability to G++ 4.8, Akim Demaille, 2020/01/16
- [PATCH 11/12] yacc.c: pass the parse-params to yyreport_syntax_error, Akim Demaille, 2020/01/16
- Re: RFC: custom error messages, Christian Schoenebeck, 2020/01/16
- Re: RFC: custom error messages, Akim Demaille, 2020/01/17
- Re: RFC: custom error messages,
Christian Schoenebeck <=
Re: RFC: custom error messages, Rici Lake, 2020/01/06
Re: RFC: custom error messages, Adrian Vogelsgesang, 2020/01/08