mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 01:03:04 +00:00
formatting changes.
* tests/calc.at: Formatting changes.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2010-04-13 Akim Demaille <demaille@gostai.com>
|
||||||
|
|
||||||
|
formatting changes.
|
||||||
|
* tests/calc.at: Formatting changes.
|
||||||
|
|
||||||
2010-04-13 Akim Demaille <demaille@gostai.com>
|
2010-04-13 Akim Demaille <demaille@gostai.com>
|
||||||
|
|
||||||
lalr1.cc: remove useless forward declaration.
|
lalr1.cc: remove useless forward declaration.
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ int
|
|||||||
}
|
}
|
||||||
|
|
||||||
]AT_LOCATION_IF([
|
]AT_LOCATION_IF([
|
||||||
AT_LOC.first_column = AT_LOC.last_column;
|
AT_LOC.first_column = AT_LOC.last_column;
|
||||||
AT_LOC.first_line = AT_LOC.last_line;
|
AT_LOC.first_line = AT_LOC.last_line;
|
||||||
])[
|
])[
|
||||||
|
|
||||||
@@ -158,7 +158,8 @@ AT_DATA_GRAMMAR([calc.y],
|
|||||||
]$4
|
]$4
|
||||||
AT_SKEL_CC_IF(
|
AT_SKEL_CC_IF(
|
||||||
[%define global_tokens_and_yystype])[
|
[%define global_tokens_and_yystype])[
|
||||||
%code requires {
|
%code requires
|
||||||
|
{
|
||||||
/* Exercise pre-prologue dependency to %union. */
|
/* Exercise pre-prologue dependency to %union. */
|
||||||
typedef int semantic_value;
|
typedef int semantic_value;
|
||||||
}
|
}
|
||||||
@@ -169,7 +170,8 @@ typedef int semantic_value;
|
|||||||
semantic_value ival;
|
semantic_value ival;
|
||||||
};
|
};
|
||||||
|
|
||||||
%code provides {
|
%code provides
|
||||||
|
{
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
/* The input. */
|
/* The input. */
|
||||||
extern FILE *input;]AT_SKEL_CC_IF([[
|
extern FILE *input;]AT_SKEL_CC_IF([[
|
||||||
@@ -182,7 +184,8 @@ extern FILE *input;]AT_SKEL_CC_IF([[
|
|||||||
#define last_column end.column]])[
|
#define last_column end.column]])[
|
||||||
}
|
}
|
||||||
|
|
||||||
%code {
|
%code
|
||||||
|
{
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#if HAVE_UNISTD_H
|
#if HAVE_UNISTD_H
|
||||||
@@ -271,6 +274,7 @@ AT_NAME_PREFIX::parser::error (AT_LOCATION_IF([const location& l, ])const std::s
|
|||||||
std::cerr << AT_LOCATION_IF([l << ": " << ])m << std::endl;
|
std::cerr << AT_LOCATION_IF([l << ": " << ])m << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A C++ yyparse that simulates the C signature. */
|
||||||
int
|
int
|
||||||
yyparse (AT_PARAM_IF([semantic_value *result, int *count]))
|
yyparse (AT_PARAM_IF([semantic_value *result, int *count]))
|
||||||
{
|
{
|
||||||
@@ -281,7 +285,8 @@ yyparse (AT_PARAM_IF([semantic_value *result, int *count]))
|
|||||||
return parser.parse ();
|
return parser.parse ();
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[static void
|
[/* A C error reporting function. */
|
||||||
|
static void
|
||||||
yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *llocp, ])
|
yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *llocp, ])
|
||||||
AT_PARAM_IF([semantic_value *result, int *count, ])
|
AT_PARAM_IF([semantic_value *result, int *count, ])
|
||||||
const char *s)
|
const char *s)
|
||||||
@@ -314,6 +319,7 @@ power (int base, int exponent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* A C main function. */
|
||||||
int
|
int
|
||||||
main (int argc, const char **argv)
|
main (int argc, const char **argv)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user