By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,507 Members | 1,183 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,507 IT Pros & Developers. It's quick & easy.

yacc/lex or bison/flex in visual studio?

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.