summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2021-08-29 16:22:16 +0200
committerAkim Demaille <akim.demaille@gmail.com>2021-08-29 16:25:38 +0200
commita7ded4284e50f2cfee83bd85fa7f49b42b7eeb69 (patch)
tree7b6a39b01d05afaf9ccf2c3b1a0a8951781637ce /examples
parenta5c55bb75855e046b042316302c25eb47fc9d6f2 (diff)
downloadbison-a7ded4284e50f2cfee83bd85fa7f49b42b7eeb69.tar.gz
style: rename stmtMerge as stmt_merge
Follow the GNU Coding Style. * doc/bison.texi, examples/c++/glr/c++-types.yy, * examples/c/glr/c++-types.y, tests/cxx-type.at: s/stmtMerge/stmt_merge/g.
Diffstat (limited to 'examples')
-rw-r--r--examples/c++/glr/c++-types.yy10
-rw-r--r--examples/c/glr/c++-types.y16
2 files changed, 13 insertions, 13 deletions
diff --git a/examples/c++/glr/c++-types.yy b/examples/c++/glr/c++-types.yy
index 1e0dea9b..fa8889de 100644
--- a/examples/c++/glr/c++-types.yy
+++ b/examples/c++/glr/c++-types.yy
@@ -45,7 +45,7 @@
#include <cstring>
static Node
- stmtMerge (const Node& x0, const Node& x1);
+ stmt_merge (const Node& x0, const Node& x1);
static yy::parser::symbol_type
yylex ();
@@ -74,9 +74,9 @@ prog : %empty
| prog stmt { std::cout << @2 << ": " << $2 << '\n'; }
;
-stmt : expr ";" %merge <stmtMerge> { $$ = $1; }
- | decl %merge <stmtMerge>
- | error ";" { $$ = Nterm ("<error>"); }
+stmt : expr ";" %merge <stmt_merge> { $$ = $1; }
+ | decl %merge <stmt_merge>
+ | error ";" { $$ = Nterm ("<error>"); }
;
expr : ID
@@ -169,7 +169,7 @@ yylex ()
}
static Node
-stmtMerge (const Node& x0, const Node& x1)
+stmt_merge (const Node& x0, const Node& x1)
{
return Nterm ("<OR>", x0, x1);
}
diff --git a/examples/c/glr/c++-types.y b/examples/c/glr/c++-types.y
index 67cadcaf..3a14d9bf 100644
--- a/examples/c/glr/c++-types.y
+++ b/examples/c/glr/c++-types.y
@@ -66,7 +66,7 @@
static void free_node (Node *);
static char *node_to_string (const Node *);
static void node_print (FILE *, const Node *);
- static Node *stmtMerge (YYSTYPE x0, YYSTYPE x1);
+ static Node *stmt_merge (YYSTYPE x0, YYSTYPE x1);
static void yyerror (YYLTYPE const * const loc, const char *msg);
static yytoken_kind_t yylex (YYSTYPE *lval, YYLTYPE *lloc);
@@ -83,9 +83,9 @@
%glr-parser
-%type <Node*> stmt expr decl declarator TYPENAME ID
-%destructor { free_node ($$); } <Node*>
-%printer { node_print (yyo, $$); } <Node*>
+%type <Node *> stmt expr decl declarator TYPENAME ID
+%destructor { free_node ($$); } <Node *>
+%printer { node_print (yyo, $$); } <Node *>
%%
@@ -100,8 +100,8 @@ prog : %empty
}
;
-stmt : expr ';' %merge <stmtMerge> { $$ = $1; }
- | decl %merge <stmtMerge>
+stmt : expr ';' %merge <stmt_merge> { $$ = $1; }
+ | decl %merge <stmt_merge>
| error ';' { $$ = new_nterm ("<error>", NULL, NULL, NULL); }
;
@@ -290,8 +290,8 @@ node_print (FILE *out, const Node *n)
}
-static Node*
-stmtMerge (YYSTYPE x0, YYSTYPE x1)
+static Node *
+stmt_merge (YYSTYPE x0, YYSTYPE x1)
{
return new_nterm ("<OR>(%s, %s)", x0.stmt, x1.stmt, NULL);
}