help-bison
[Top][All Lists]
Advanced

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

Generated parser searching for y.tab.c


From: Paulo J. Matos
Subject: Generated parser searching for y.tab.c
Date: Thu, 30 Nov 2006 19:02:46 +0000

Hi all,

I'm defining a parser:
foo.yy:
%name-prefix="foo"
%skeleton "lalr1.cc"                          /*  -*- C++ -*- */
%require "2.1a"
%defines
%yacc

%{
...
%}

...

I have in my configure.ac:
...
# Checks for programs.
AC_LANG([C++])
AC_PROG_CXX
AC_PROG_CC
AC_PROG_YACC
AC_PROG_LEX
...

And in my Makefile.am
# Sources built
BUILT_SOURCES = position.hh location.hh stack.hh foo.h foo.cc

position.hh location.hh stack.hh foo.h foo.cc: parser/foo.yy

CLEANFILES = position.hh location.hh stack.hh foo.h foo.cc

bin_PROGRAMS = foo
foo_SOURCES = foo-lexer.ll foo-parser.yy ...

Problem is that the generated foo.cc is trying to include y.tab.h,
which should be foo.h.

It seems that automake renames the files which are output by bison to
match the prefix of the yy file. In this case, foo. However, since
bison does not know about that tries to include y.tab.h.

Any ideas on how to solve this issue?

Regards,

--
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK




reply via email to

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