public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Michael Czapski <MCzapski@openplus.com.au>
To: "'Christopher David Hundhausen'" <chundhau@cs.uoregon.edu>,
	"gnu-win32@cygnus.com" <gnu-win32@cygnus.com>
Subject: RE: Compiling Bison-generated parsers with MS VC++?
Date: Thu, 08 Oct 1998 21:43:00 -0000	[thread overview]
Message-ID: <01BDF318.B45C3B70.MCzapski@openplus.com.au> (raw)

On Thursday, October 08, 1998 2:04 AM, Christopher David Hundhausen 
[SMTP:chundhau@cs.uoregon.edu] wrote:
> I've used VC++ (v 5.0) to successfully compile a flex-generated lexical
> analyzer (lex.yy.cpp).  I did this by using the trick of creating a dummy
> (empty)  uinstd.h file (this trick was recently suggested on this mailing
> list).
>
> The next step is to get VC++ to compile a bison-generated parser that
> makes use of MFC classes.  Does anyone have any suggestions on
> how to get this to work?  At present, my compilation results in
> the following error messages:
>
> /cygnus/b19/share/bison.simple(327) : error C2065: 'yyerror' : undeclared
> identifier
> /cygnus/b19/share/bison.simple(333) : error C2065: 'alloca' : undeclared
> identifier
> /cygnus/b19/share/bison.simple(387) : error C2065: 'yylex' : undeclared
> identifier
>
> Once I get the parser to compile, what will I need to do to get
> everything to link properly with my MFC app?  Is there a gnu-win32
> object file that I need to include in the link? Does anyone have any
> advice?
>
> Please send you responses directly to me (chundhau@cs.uoregon.edu), in
> addition to posting them to the list.
>
> Thanks in advance,
> :-)Chris
>
> -
Hello Chris,

I did a project utilizing both but I did not have a need to create a dummy 
unistd.h.

Presumably you have a yyerror in your source.l as void yyerror(char *message) ? 
 If not, you will need one, if only an empty one. Once you have the yyerror 
declare it as 'extern void yyerror(char *message)' in your source.y or a header 
file you share between your source.l and source.y, if you have one.
Similarly, declare yylex in your souce.y as extern int yylex( void ).
In so far as the alloca issue is concerned you can do a
#define YY_ALWAYS_INTERACTIVE 1
which will take care of that, although I don't see how you got that in the 
first place.  I have used bith flex and bison in a source-portable app that 
builds with MS VC++ 5.0, egcs 1.0.2 on cygwin32, Linux and OpenVMS and only 
Linux and OpenVMS had an issue with the alloca (missing that is).

That's what I did in a C environment.  Sorry, I don't grok c++, just plain c.
------------------
Cheers ...
Michael Czapski


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

             reply	other threads:[~1998-10-08 21:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-08 21:43 Michael Czapski [this message]
1998-11-30  6:10 ` RE: Compiling Bison-generated parsers with MS VC+ Daniel Gehriger
  -- strict thread matches above, loose matches on Subject: below --
1998-10-14  7:39 Compiling Bison-generated parsers with MS VC++? Steven J. Zeil
1998-10-13  0:20 Steven J. Zeil
1998-10-08 21:43 Gilles Depeyrot
1998-10-08 15:29 Kubat, Karel
1998-10-07  9:04 Christopher David Hundhausen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01BDF318.B45C3B70.MCzapski@openplus.com.au \
    --to=mczapski@openplus.com.au \
    --cc=chundhau@cs.uoregon.edu \
    --cc=gnu-win32@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).