help-bison
[Top][All Lists]
Advanced

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

Bison error on yacc code


From: Gordon (Jake) Jacobs
Subject: Bison error on yacc code
Date: Wed, 19 Nov 2003 11:13:07 -0800

Hi,
  I'm trying to port some 10-year-old code to a RedHat Linux8
machine. The code compiles fine on SUN using lex/yacc. I get
many compile errors on the Linux machine so I thought I would try
flex/bison. When running bison 1.35 on my yacc code, I get the following
error:
ndwi 715 % bison asmYacc.y
asmYacc.y:46: type clash (`' `token') on default action 

The top of the yacc code is included below and the error is very
near the top (highlighted) on a very basic rule. Can anyone explain the
error message in a little more detail or see why it would occur?
The same error occurs on the SUN machine using bison 1.28 too by the
way,
so it is not a platform issue, but rather a yacc compatibility issue.

Any help appreciated.
Regards,
Gordon Jacobs
Oakland, CA

/*
 *      @(#)asmYacc.y   1.6
 *      Date: 94/05/04   Time: 15:17:29
 *      Version: 1.6
 *
 */

%{

#include "asm.h"
static int panic,error;
extern int encode_keyword();

%}
%token <token> INTTOKEN KEYWORD SUBTOKEN SHFTTOKEN ENDTOKEN 
%token <character> CHARTOKEN LABELTOKEN

%type <character> Destinations

%start Asm

%union {
    int token;
    char *character;
}

%%

Asm:    Codes
        { 
          Reconcile_labels();
          Print_table(lookup, fpout);
          Print_table(lookup, fplst);
          Print_program();
          Print_ROM_CODE();
        }
        ;
Codes:  Code
        | Codes Code
        ;
Code:   Label Instruction  ENDTOKEN
        { Wrap_instr(); }
        | Instruction ENDTOKEN
        { Wrap_instr(); }
        | ENDTOKEN
        ;                 <- error occurs here, line 46
Label:  LABELTOKEN
        {  etc....




reply via email to

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