[Top][All Lists]

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

[PATCH 00/11] support "%define variable {value}"

From: Akim Demaille
Subject: [PATCH 00/11] support "%define variable {value}"
Date: Thu, 4 Apr 2013 17:36:17 +0200

Hi Joel, hi all,

In order to implement Joel's suggestion for api.value.type, some
preliminary work is needed to extend Bison to accept more types
of %define variable values, and to record how these values were
defined.  See

for more context, but to quote Joel:

> In general for %define, I wonder if we should continue to require quotes 
> for values that are keywords (such as variant, full, none).  For values 
> that are code in the target language, braces seem nice.  (For other 
> arbitrary values, such as file names maybe, quotes do seem appropriate.) 
> Applying that in the case of api.value.type, we'd have:
>   %define api.value.type union-directive
>   %define api.value.type union
>   %define api.value.type variant
>   %define api.value.type {int}
>   %define api.value.type {variant}

What follows is a first, incomplete, step.  It is incomplete because
there are not enough tests, the documentation is not properly updated,
and NEWS is not changed.  The options -D/-F also need to become
brace-aware, and maybe quotes aware.  The M4 code should start to
"typecheck" some of the values (e.g., it should warn for
%define api.namespace "foo" instead of {foo}).  But before going
any further, I'd like to receive opinions, obviously especially
Joel's :)

Akim Demaille (11):
  muscle: minor refactoring
  style: comment changes
  muscle: refactor
  grammar: split %union to group together related aspects
  grammar: style changes
  style: fix comments
  grammar: record the kind of %define variable values
  grammar: do not add a \n at the end of blocks of code
  api.namespace: demonstrate and use {...} values instead of "..."

 doc/bison.texi   |   8 +-
 src/getargs.c    |   4 +-
 src/muscle-tab.c | 164 +++++-----
 src/muscle-tab.h |  47 ++-
 src/parse-gram.c | 912 ++++++++++++++++++++++++++++---------------------------
 src/parse-gram.h | 150 ++++-----
 src/parse-gram.y |  89 +++---
 tests/     |   4 +-
 tests/   |   6 +-
 tests/   |  10 +-
 10 files changed, 737 insertions(+), 657 deletions(-)


reply via email to

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