bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using "%define location_type" c++ skeleton should exclude default lo


From: Akim Demaille
Subject: Re: Using "%define location_type" c++ skeleton should exclude default location
Date: Tue, 4 May 2010 15:15:34 +0200

Le 14 avr. 2010 à 13:19, Akim Demaille a écrit :

> I have installed a first batch of changes in 2.5 and 2.6 to this end.  I 
> think I failed to keep you in CC, please have a look at the archive (it 
> should appear in 
> http://lists.gnu.org/archive/html/bison-patches/2010-04/threads.html I guess).

For some reason, I fail to send these patches using git send-email.  I'll send 
them by hand here.  Sorry :(

The following was installed in master and 2.5.

From c499231de45a4a30aadbc17db4ceafd74c44b9c4 Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Sat, 10 Apr 2010 13:35:59 +0200
Subject: [PATCH 01/18] formatting changes.

        * tests/calc.at: Formatting changes.
---
ChangeLog     |    5 +++++
tests/calc.at |   16 +++++++++++-----
2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 51d9ac5..02fe9ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2010-04-13  Akim Demaille  <address@hidden>

+       formatting changes.
+       * tests/calc.at: Formatting changes.
+
+2010-04-13  Akim Demaille  <address@hidden>
+
        lalr1.cc: remove useless forward declaration.
        * data/lalr1.cc: Include location.hh before stack.hh.
        Remove the useless forward declarations of position and location.
diff --git a/tests/calc.at b/tests/calc.at
index 5a19a8e..61a7a1e 100644
--- a/tests/calc.at
+++ b/tests/calc.at
@@ -123,7 +123,7 @@ int
    }

]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;
])[

@@ -158,7 +158,8 @@ AT_DATA_GRAMMAR([calc.y],
]$4
AT_SKEL_CC_IF(
[%define global_tokens_and_yystype])[
-%code requires {
+%code requires
+{
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}
@@ -169,7 +170,8 @@ typedef int semantic_value;
  semantic_value ival;
};

-%code provides {
+%code provides
+{
#include <stdio.h>
/* The input.  */
extern FILE *input;]AT_SKEL_CC_IF([[
@@ -182,7 +184,8 @@ extern FILE *input;]AT_SKEL_CC_IF([[
#define last_column  end.column]])[
}

-%code {
+%code
+{
#include <stdlib.h>
#include <string.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;
}

+/* A C++ yyparse that simulates the C signature.  */
int
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 ();
}
],
-[static void
+[/* A C error reporting function.  */
+static void
yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *llocp, ])
         AT_PARAM_IF([semantic_value *result, int *count, ])
         const char *s)
@@ -314,6 +319,7 @@ power (int base, int exponent)
}


+/* A C main function.  */
int
main (int argc, const char **argv)
{
-- 
1.7.0.5






reply via email to

[Prev in Thread] Current Thread [Next in Thread]