Windows Vista Beta | WinVistaBeta.com - Message | calling command-line preprocessor in code?

November 20, 2008  
Subject: calling command-line preprocessor in code?
Group: microsoft.public.vstudio.general
Date: 8/13/2008 10:50:59 AM
From: navels [Email Address Protection]

I have a program that uses flex and yacc to interpret a C-like
scripting language. The first step is a system call to the command-
line compiler for preprocessing. For example:

FILE * yyin ;
yyin = _popen ("cl.exe /nologo /E myScript.c", "r") ;

and then the flex/yacc magic takes over.

This of course requires that my application run on a PC with Visual
Studio installed. I would prefer to do the preprocessor step in code
(without a system call), linking to some library which I can
reasonably assume will exist on a standard Windows (XP or later)
install.

Any suggestions? Pointers to a more appropriate forum are also
welcome.

Thanks,
Lee

Back
Subject: Re: calling command-line preprocessor in code?
Group: microsoft.public.vstudio.general
Date: 8/13/2008 3:25:04 PM
From: navels [Email Address Protection]

On Aug 13, 12:50=A0pm, navels <nav...@gmail.com> wrote:
> I have a program that uses flex and yacc to interpret a C-like
> scripting language. =A0The first step is a system call to the command-
> line compiler for preprocessing. =A0For example:
>
> =A0 FILE * yyin ;
> =A0 yyin =3D _popen ("cl.exe /nologo /E myScript.c", "r") ;
>
> and then the flex/yacc magic takes over.
>
> This of course requires that my application run on a PC with Visual
> Studio installed. =A0I would prefer to do the preprocessor step in code
> (without a system call), linking to some library which I can
> reasonably assume will exist on a standard Windows (XP or later)
> install.
>
> Any suggestions? =A0Pointers to a more appropriate forum are also
> welcome.
>
> Thanks,
> Lee

Okay, I seem to have solved this by finding a free, portable C
preprocessor library, works quite well:

http://www.freshports.org/devel/ucpp/

Lee


Back