Use more STL like names: my_class instead of MyClass.

* data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
(SemanticStack, SemanticType, StateStack, StateType)
(TokenNumberType, Stack, Slice, Traits, Parser::location)
(Parser::value): Rename as...
(location_stack, location_type, rhs_number_type, semantic_stack)
(semantic_type, state_stack, state_type, token_number_type, stack)
(slice, traits, parser::yylloc, parser::yylval): these.
* tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
This commit is contained in:
Akim Demaille
2004-12-20 13:56:38 +00:00
parent 9bec482e39
commit 99880de508
5 changed files with 131 additions and 117 deletions

View File

@@ -186,7 +186,7 @@ m4_ifval([$6], [%union
}])
[
%{
]AT_LALR1_CC_IF([typedef yy::Location YYLTYPE;
]AT_LALR1_CC_IF([typedef yy::location YYLTYPE;
m4_ifval([$6], , [#define YYSTYPE int])])
[static int yylex (]AT_LEX_FORMALS[);
]AT_LALR1_CC_IF([], [static void yyerror (const char *msg);])
@@ -311,7 +311,7 @@ yylex (]AT_LEX_FORMALS[)
]AT_LALR1_CC_IF(
[/* A C++ error reporting function. */
void
yy::Parser::error (const Location& l, const std::string& m)
yy::parser::error (const location& l, const std::string& m)
{
printf ("%d-%d: %s\n", RANGE (l), m.c_str());
}
@@ -320,7 +320,7 @@ static bool yydebug;
int
yyparse ()
{
yy::Parser parser;
yy::parser parser;
parser.set_debug_level (yydebug);
return parser.parse ();
}

View File

@@ -66,7 +66,7 @@ static int global_count = 0;
%{
static int power (int base, int exponent);
]AT_LALR1_CC_IF([typedef yy::Location YYLTYPE;],
]AT_LALR1_CC_IF([typedef yy::location YYLTYPE;],
[/* yyerror receives the location if:
- %location & %pure & %glr
- %location & %pure & %yacc & %parse-param. */
@@ -128,7 +128,7 @@ static FILE *yyin;
]AT_LALR1_CC_IF(
[/* A C++ error reporting function. */
void
yy::Parser::error (const Location& l, const std::string& m)
yy::parser::error (const location& l, const std::string& m)
{
(void) l;
std::cerr << AT_LOCATION_IF([l << ": " << ])m << std::endl;
@@ -137,7 +137,7 @@ yy::Parser::error (const Location& l, const std::string& m)
int
yyparse (AT_PARAM_IF([semantic_value *result, int *count]))
{
yy::Parser parser[]AT_PARAM_IF([ (result, count)]);
yy::parser parser[]AT_PARAM_IF([ (result, count)]);
parser.set_debug_level (!!YYDEBUG);
return parser.parse ();
}

View File

@@ -727,15 +727,15 @@ member: STRING
AT_LALR1_CC_IF(
[/* A C++ error reporting function. */
void
yy::Parser::error (const Location&, const std::string& m)
yy::parser::error (const location&, const std::string& m)
{
std::cerr << m << std::endl;
}
int
yyparse (void)
yyparse ()
{
yy::Parser parser;
yy::parser parser;
parser.set_debug_level (!!YYDEBUG);
return parser.parse ();
}