bug-bison
[Top][All Lists]
Advanced

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

Multiple defs in union


From: Rich Wilson
Subject: Multiple defs in union
Date: Fri, 19 Dec 2014 15:08:51 -0800

The following syntax file parse.y:
=====================================
%defines

%define api.value.type union

%token <int> NUM

%%

input: NUM
     { printf("%d\n", $1); }
    ;

%%
====================================
causes NUM to be defined multiple times.
Excerpt from parse.tab.h:
====================================
union YYSTYPE
{

#line 59 "parse.tab.h" /* yacc.c:1909  */
  /* NUM  */
  int NUM;
  /* NUM  */
  int NUM;
};
================================
This causes a compile error.
Operating system: Windows 7-64
Using cygwin-32
Bison version:
==================
$ bison --version
bison (GNU Bison) 3.0.2
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
=====================
Cygwin version designation of bison 3.0.2-1
Cygwin updated as of 12/19/2014




-- 
Rich Wilson
address@hidden
425-337-7129 (land line)
425-374-4760 (Google)


reply via email to

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