472,971 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,971 software developers and data experts.

yacc/lex or bison/flex in visual studio?

Hi!
We are finding ourselves in a situation where we have to parse
several more or less free format text files.
In the past, on linux, we had flex and bison for generating
very fast parsers for these files.
Is there any equivalent in the visual studio world?

Lots of Greetings!
Volker
--
For email replies, please substitute the obvious.
Aug 10 '06 #1
6 15382
Volker Hetzer wrote:
Hi!
We are finding ourselves in a situation where we have to parse
several more or less free format text files.
In the past, on linux, we had flex and bison for generating
very fast parsers for these files.
Is there any equivalent in the visual studio world?
Yes, they're spelled YACC, Lex, Bison and Flex. All can be built for
Windows just as easily as for *nix. Just go download the sources & build
'em.

-cd
Aug 10 '06 #2
"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:OU**************@TK2MSFTNGP05.phx.gbl...
Volker Hetzer wrote:
>In the past, on linux, we had flex and bison for generating very fast
parsers for these files.
Is there any equivalent in the visual studio world?

Yes, they're spelled YACC, Lex, Bison and Flex. All can be built for
Windows just as easily as for *nix. Just go download the sources & build
'em.
If the goal is just to run them under Windows without needing to integrate
them into Visual Studio, then there's an even easier way to get yacc and lex
under Windows. Windows Services for Unix comes as part of MSDN, and I seem
to recall reading that anyone can download it freely.

Aug 11 '06 #3
Norman Diamond schrieb:
"Carl Daniel [VC++ MVP]"
<cp*****************************@mvps.org.nospamwr ote in message
news:OU**************@TK2MSFTNGP05.phx.gbl...
>Volker Hetzer wrote:
>>In the past, on linux, we had flex and bison for generating very fast
parsers for these files.
Is there any equivalent in the visual studio world?

Yes, they're spelled YACC, Lex, Bison and Flex. All can be built for
Windows just as easily as for *nix. Just go download the sources &
build 'em.

If the goal is just to run them under Windows without needing to
integrate them into Visual Studio, then there's an even easier way to
get yacc and lex under Windows. Windows Services for Unix comes as part
of MSDN, and I seem to recall reading that anyone can download it freely.
Uh, if possible we would like to integrate them into visual studio, a bit like
a preprocessor.
We have almost no experience using visual studio.
Is there some equivalent to Unix' make mechanism where I just define two
suffixes and the rule transforming one file into the other automatically?

Lots of Greetings!
Volker
--
For email replies, please substitute the obvious.
Aug 11 '06 #4
Volker Hetzer wrote:
Norman Diamond schrieb:
>"Carl Daniel [VC++ MVP]"
<cp*****************************@mvps.org.nospamw rote in message
news:OU**************@TK2MSFTNGP05.phx.gbl...
>>Volker Hetzer wrote:
>>>In the past, on linux, we had flex and bison for generating very
fast parsers for these files.
Is there any equivalent in the visual studio world?

Yes, they're spelled YACC, Lex, Bison and Flex. All can be built
for Windows just as easily as for *nix. Just go download the
sources &
build 'em.

If the goal is just to run them under Windows without needing to
integrate them into Visual Studio, then there's an even easier way to
get yacc and lex under Windows. Windows Services for Unix comes as
part
of MSDN, and I seem to recall reading that anyone can download it
freely.
Uh, if possible we would like to integrate them into visual studio, a
bit like a preprocessor.
We have almost no experience using visual studio.
Is there some equivalent to Unix' make mechanism where I just define
two suffixes and the rule transforming one file into the other
automatically?
Yes. Under VS 2005 you can define custom tools that the C++ project system
will use to build new file types. Some of the beta versions of VS 2005
actually included tool definitions for yacc/lex, but they don't appear to be
included in the released version, so you'll have to define them yourself.

Finding the options in the help is rather torturous, but...

In the solution explorer, right-click on your C++ project and choose "Custom
Build Rules..." from the context menu.
On the dialog that appears, click "New Rule File...".
Give your new rule file a name, like "Compile with YACC"

.... and so on. It's a bit more involved than one might hope (but it's also
pretty powerful). See

http://msdn2.microsoft.com/en-us/library/03t8bzzy.aspx

as a starting point.

-cd
Aug 11 '06 #5
Carl Daniel [VC++ MVP] schrieb:
Yes. Under VS 2005 you can define custom tools that the C++ project system
will use to build new file types. Some of the beta versions of VS 2005
actually included tool definitions for yacc/lex, but they don't appear to be
included in the released version, so you'll have to define them yourself.
Great!
As soon as we get VS2005 we will try it.

Thanks a lot!
Volker
--
For email replies, please substitute the obvious.
Aug 11 '06 #6
"Volker Hetzer" <fi****************@ieee.orgwrote in message
news:eb**********@nntp.fujitsu-siemens.com...
Carl Daniel [VC++ MVP] schrieb:
>Yes. Under VS 2005 you can define custom tools that the C++ project
system will use to build new file types. Some of the beta versions of VS
2005 actually included tool definitions for yacc/lex, but they don't
appear to be included in the released version, so you'll have to define
them yourself.
Great!
As soon as we get VS2005 we will try it.
You can also do something a little less fancy with older versions of VC -
you can define a custom build step for a file. In terms of building your
project, it's just as useful as the custom tool file, but you have to re-do
the custom build step in each new project, while you can simply re-use the
custom tool file once you've built it once.

-cd
Aug 11 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Moonlit | last post by:
Hi, I am searching for the best lex and yacc combination (or something similar) that can be used in combination with C++ and that can contain C++ code. I have the regular flex/bison port working...
8
by: pavel.orehov | last post by:
Hi, I am using flex and bizon to write HTTP parser. I am passing well flex and bison tools but can't compile their output. ================= Flex file (http_parser.lpp) ============== %{...
4
by: Rodrick Brown | last post by:
This might be off topic but can someone give me a quick run down on why tools like lexx/yacc/bison are usefull ? I know what there used for but not sure when they should be used and where ? ...
3
by: John Sasso | last post by:
In my Yacc .y file I defined: %union { int value; struct Symbol Sym; } The Symbol struct I defined in a header file I #included in the Prologue section of the .y file as:
13
by: jc | last post by:
I have written a parser using bison and flex to read ASAP2 file for CAN communications. entire development was done in an unix environment and now the code is ready to be integrated to an existing...
2
by: eng.sharif | last post by:
i want use bison and flex in visual stdio 2005 for make small compiler by use Custom Build Rules in Visual C++ 2005 "FlexBison.rules file " but when i compile "example.y" i get error...
1
by: eng.sharif | last post by:
want use bison and flex in visual stdio 2005 for make small compiler by use Custom Build Rules in Visual C++ 2005 "FlexBison.rules file " but when i compile "example.y" i get error...
2
by: Baron Samedi | last post by:
I have been looking around for an editor which edit serialised files (as created with the PHP function serialize()), but can't find one, so I have decided to code my own. I can either hand code...
1
by: cwhite | last post by:
Hi! I've included some of my classes in the union in my grammar file: %union { int int_type; char* string_type; PNode* pNode; } %type <int_type> programs %type <pNode> program
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.