[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
%union problem in 2.4 version
From: |
Cleto Martin Angelina |
Subject: |
%union problem in 2.4 version |
Date: |
Wed, 25 Mar 2009 14:11:35 +0100 |
Hi!
Recently, i'm having troubles compiling my parser, which worked in bison
2.3. The output message is:
Parser.y:42: error: ISO C++ forbids declaration of ‘Invocation’ with no type
Parser.y:42: error: expected ‘;’ before ‘*’ token
Parser.y:43: error: ISO C++ forbids declaration of ‘Parameter’ with no type
Parser.y:43: error: expected ‘;’ before ‘*’ token
Parser.y:44: error: ISO C++ forbids declaration of ‘vector’ with no type
Parser.y:44: error: invalid use of ‘::’
Parser.y:44: error: expected ‘;’ before ‘<’ token
And header's .y file is:
%{
#include <stdio.h>
#include <stdlib.h>
#include "Driver.h"
%}
%skeleton "lalr1.cc"
%require "2.4"
%debug
%defines
%define "parser_class_name" "Parser"
%define "namespace" "ipk"
// The parsing context.
%parse-param { class Driver& driver }
%locations
%initial-action
{
// Initialize the initial location.
@$.begin.filename = @$.end.filename = &driver.file;
};
%debug
%error-verbose
%name-prefix="ipk"
// Symbols.
%union
{
int ival;
std::string *sval;
bool bval;
Invocation* inv;
Parameter* par;
std::vector<Parameter>* vpar;
};
"Invocation", "Parameter", etc. are types declared at Driver.h file and
defined in Driver.cc.
I've read about that in this mailing list, but i'm really lost. I don't know
which features have changed in 2.4 version that are affecting my project.
Can anyone guide me?.
Thanks in advance,
Cleto
---------------------------
Cleto Martín Angelina
address@hidden
- %union problem in 2.4 version,
Cleto Martin Angelina <=