All uses changed. Provide a definition in both C and C++.
(yytrue, yyfalse): Define even if defined (__cplusplus).
]/* Line __line__ of glr.c. */
b4_syncline([@oline@], [@ofile@])
[
]/* Line __line__ of glr.c. */
b4_syncline([@oline@], [@ofile@])
[
-#if ! defined (__cplusplus)
- typedef char bool;
-# define yytrue 1
-# define yyfalse 0
+#ifdef __cplusplus
+ typedef bool yybool;
+#else
+ typedef unsigned char yybool;
+#define yytrue 1
+#define yyfalse 0
/*-----------------.
| GCC extensions. |
/*-----------------.
| GCC extensions. |
typedef struct yyGLRStateSet yyGLRStateSet;
struct yyGLRState {
typedef struct yyGLRStateSet yyGLRStateSet;
struct yyGLRState {
- bool yyisState;
- bool yyresolved;
+ yybool yyisState;
+ yybool yyresolved;
yyStateNum yylrState;
yyGLRState* yypred;
size_t yyposn;
yyStateNum yylrState;
yyGLRState* yypred;
size_t yyposn;
};
struct yySemanticOption {
};
struct yySemanticOption {
yyRuleNum yyrule;
yyGLRState* yystate;
yySemanticOption* yynext;
yyRuleNum yyrule;
yyGLRState* yystate;
yySemanticOption* yynext;
/** True iff LR state STATE has only a default reduction (regardless
* of token). */
/** True iff LR state STATE has only a default reduction (regardless
* of token). */
yyisDefaultedState (yyStateNum yystate)
{
return yyis_pact_ninf (yypact[yystate]);
yyisDefaultedState (yyStateNum yystate)
{
return yyis_pact_ninf (yypact[yystate]);
return yydefgoto[yylhs - YYNTOKENS];
}
return yydefgoto[yylhs - YYNTOKENS];
}
yyisShiftAction (int yyaction)
{
return 0 < yyaction;
}
yyisShiftAction (int yyaction)
{
return 0 < yyaction;
}
yyisErrorAction (int yyaction)
{
return yyaction == 0;
yyisErrorAction (int yyaction)
{
return yyaction == 0;
yyn -= 1, yyp0 += 1, yyp1 += 1)
{
*yyp1 = *yyp0;
yyn -= 1, yyp0 += 1, yyp1 += 1)
{
*yyp1 = *yyp0;
{
yyGLRState* yys0 = &yyp0->yystate;
yyGLRState* yys1 = &yyp1->yystate;
{
yyGLRState* yys0 = &yyp0->yystate;
yyGLRState* yys1 = &yyp1->yystate;
*/
static inline YYRESULTTAG
yyglrReduce (yyGLRStack* yystack, size_t yyk, yyRuleNum yyrule,
*/
static inline YYRESULTTAG
yyglrReduce (yyGLRStack* yystack, size_t yyk, yyRuleNum yyrule,
- bool yyforceEval]b4_pure_formals[)
+ yybool yyforceEval]b4_pure_formals[)
{
size_t yyposn = yystack->yytops.yystates[yyk]->yyposn;
{
size_t yyposn = yystack->yytops.yystates[yyk]->yyposn;
/** True iff Y0 and Y1 represent identical options at the top level.
* That is, they represent the same rule applied to RHS symbols
* that produce the same terminal symbols. */
/** True iff Y0 and Y1 represent identical options at the top level.
* That is, they represent the same rule applied to RHS symbols
* that produce the same terminal symbols. */
yyidenticalOptions (yySemanticOption* yyy0, yySemanticOption* yyy1)
{
if (yyy0->yyrule == yyy1->yyrule)
yyidenticalOptions (yySemanticOption* yyy0, yySemanticOption* yyy1)
{
if (yyy0->yyrule == yyy1->yyrule)
for (yyp = yystack->yyitems; yyp < yystack->yynextFree; yyp += 1)
{
fprintf (stderr, "%3lu. ", (unsigned long) (yyp - yystack->yyitems));
for (yyp = yystack->yyitems; yyp < yystack->yynextFree; yyp += 1)
{
fprintf (stderr, "%3lu. ", (unsigned long) (yyp - yystack->yyitems));
{
fprintf (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
yyp->yystate.yyresolved, yyp->yystate.yylrState,
{
fprintf (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
yyp->yystate.yyresolved, yyp->yystate.yylrState,