style: s/non-terminal/nonterminal/

I personally prefer 'non terminal', or 'non-terminal', but
'nonterminal' is the common spelling.

* data/glr.c, src/parse-gram.y, src/symtab.c, src/symtab.h,
* tests/input.at, doc/refcard.tex: here.
This commit is contained in:
Akim Demaille
2018-12-10 07:15:21 +01:00
parent b05aa7be2e
commit d68f05d75c
10 changed files with 25 additions and 25 deletions

8
TODO
View File

@@ -8,7 +8,6 @@ Several features are not available in all the backends.
* Short term
** consistency
nonterminal vs non terminal vs non-terminal
token vs terminal
** yacc.c
@@ -214,9 +213,10 @@ Provide better assistance for understanding the conflicts by providing
a sample text exhibiting the (LALR) ambiguity. See the paper from
DeRemer and Penello: they already provide the algorithm.
** Statically check for potential ambiguities in GLR grammars. See
<http://www.i3s.unice.fr/~schmitz/papers.html#expamb> for an approach.
** Statically check for potential ambiguities in GLR grammars
See <http://www.lsv.fr/~schmitz/pub/expamb.pdf> for an approach.
An Experimental Ambiguity Detection Tool Sylvain Schmitz
LORIA, INRIA Nancy - Grand Est, Nancy, France
* Extensions
** Multiple start symbols

View File

@@ -639,7 +639,7 @@ struct yyGLRState {
size_t yyposn;
union {
/** First in a chain of alternative reductions producing the
* non-terminal corresponding to this state, threaded through
* nonterminal corresponding to this state, threaded through
* yynext. */
yySemanticOption* yyfirstVal;
/** Semantic value for this state. */

View File

@@ -9947,7 +9947,7 @@ Entering state 1
This first batch shows a specific feature of this grammar: the first rule
(which is in line 34 of @file{mfcalc.y} can be reduced without even having
to look for the first token. The resulting left-hand symbol (@code{$$}) is
a valueless (@samp{()}) @code{input} non terminal (@code{nterm}).
a valueless (@samp{()}) @code{input} nonterminal (@code{nterm}).
Then the parser calls the scanner.
@example

View File

@@ -358,7 +358,7 @@ otherwise it will have the format {\tt {\it name}.tab.h}, where
In the above, {\it t} is a {\it type} defined in the {\tt \%union}
definition, {\it n} is a {\it terminal} symbol name, {\it m} is a
{\it non-terminal} symbol name, and {\it association} can be one of
{\it nonterminal} symbol name, and {\it association} can be one of
{\tt \%left}, {\tt \%right}, or {\tt \%nonassoc}.
\vskip .10truein
@@ -401,16 +401,16 @@ Rules take the form:
\vskip -\baselineskip
\beginexample
non-terminal : {\it statement} 1
| {\it statement} 2
\vdots
| {\it statement n}
;
nonterminal : {\it statement} 1
| {\it statement} 2
\vdots
| {\it statement n}
;
\endexample
Where {\it statements} can be either empty, or contain
a mixture of C code (enclosed in {\tt \{...\}}), and the
symbols that make up the non-terminal. For example:
symbols that make up the nonterminal. For example:
\vskip -\baselineskip
\beginexample

View File

@@ -2705,7 +2705,7 @@ yyreduce:
if (current_class == nterm_sym)
{
gram_error (&(yylsp[0]),
_("character literals cannot be non-terminals"));
_("character literals cannot be nonterminals"));
YYERROR;
}
(yyval.id) = symbol_get (char_name ((yyvsp[0].CHAR)), (yylsp[0]));

View File

@@ -641,7 +641,7 @@ id:
if (current_class == nterm_sym)
{
gram_error (&@1,
_("character literals cannot be non-terminals"));
_("character literals cannot be nonterminals"));
YYERROR;
}
$$ = symbol_get (char_name ($1), @1);

View File

@@ -117,7 +117,7 @@ typedef struct
/* What is the symbol labelling the transition to
TRANSITIONS->states[Num]? Can be a token (amongst which the error
token), or non terminals in case of gotos. */
token), or nonterminals in case of gotos. */
# define TRANSITION_SYMBOL(Transitions, Num) \
(Transitions->states[Num]->accessing_symbol)

View File

@@ -478,7 +478,7 @@ symbol_user_token_number_set (symbol *sym, int user_token_number, location loc)
int *user_token_numberp = &sym->content->user_token_number;
if (sym->content->class != token_sym)
complain (&loc, complaint,
_("non-terminals cannot be given an explicit number"));
_("nonterminals cannot be given an explicit number"));
else if (*user_token_numberp != USER_NUMBER_UNDEFINED
&& *user_token_numberp != user_token_number)
complain (&loc, complaint, _("redefining user token number of %s"),
@@ -614,7 +614,7 @@ symbol_make_alias (symbol *sym, symbol *str, location loc)
{
if (sym->content->class != token_sym)
complain (&loc, complaint,
_("non-terminals cannot be given a string alias"));
_("nonterminals cannot be given a string alias"));
else if (str->alias)
complain (&loc, Wother,
_("symbol %s used more than once as a literal string"), str->tag);
@@ -677,7 +677,7 @@ complain_user_token_number_redeclared (int num, symbol *first, symbol *second)
static inline bool
symbol_translation (symbol *this)
{
/* Non-terminal? */
/* Nonterminal? */
if (this->content->class == token_sym
&& !this->is_alias)
{

View File

@@ -40,7 +40,7 @@ typedef enum
{
unknown_sym, /**< Undefined. */
token_sym, /**< Terminal. */
nterm_sym /**< Non-terminal. */
nterm_sym /**< Nonterminal. */
} symbol_class;

View File

@@ -152,28 +152,28 @@ AT_BISON_CHECK([-fcaret input.y], [1], [],
[[input.y:1.1-6: warning: deprecated directive, use '%type' [-Wdeprecated]
%nterm expr "expression";
^^^^^^
input.y:1.13-24: error: non-terminals cannot be given a string alias
input.y:1.13-24: error: nonterminals cannot be given a string alias
%nterm expr "expression";
^^^^^^^^^^^^
input.y:2.1-6: warning: deprecated directive, use '%type' [-Wdeprecated]
%nterm term 123;
^^^^^^
input.y:2.13-15: error: non-terminals cannot be given an explicit number
input.y:2.13-15: error: nonterminals cannot be given an explicit number
%nterm term 123;
^^^
input.y:3.1-6: warning: deprecated directive, use '%type' [-Wdeprecated]
%nterm fact 124 "factor";
^^^^^^
input.y:3.13-15: error: non-terminals cannot be given an explicit number
input.y:3.13-15: error: nonterminals cannot be given an explicit number
%nterm fact 124 "factor";
^^^
input.y:3.17-24: error: non-terminals cannot be given a string alias
input.y:3.17-24: error: nonterminals cannot be given a string alias
%nterm fact 124 "factor";
^^^^^^^^
input.y:4.1-6: warning: deprecated directive, use '%type' [-Wdeprecated]
%nterm '+' '*';
^^^^^^
input.y:4.8-10: error: character literals cannot be non-terminals
input.y:4.8-10: error: character literals cannot be nonterminals
%nterm '+' '*';
^^^
input.y:5.1-6: warning: deprecated directive, use '%type' [-Wdeprecated]