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