2011-07-26 58 views
3

我有一个任务是开发源程序分析工具C程序,并且我需要在分析本身之前预处理代码。我想知道什么是最好的图书馆。我需要轻便和便携的东西。C预处理程序库

回答

5

而是推出自己的,为什么不使用cpp这就是gcc套件的一部分:http://gcc.gnu.org/onlinedocs/gcc-4.6.1/cpp/

CPP(1)        GNU        CPP(1) 

NAME 
     cpp - The C Preprocessor 

SYNOPSIS 
     cpp [-Dmacro[=defn]...] [-Umacro] 
      [-Idir...] [-iquotedir...] 
      [-Wwarn...] 
      [-M|-MM] [-MG] [-MF filename] 
      [-MP] [-MQ target...] 
      [-MT target...] 
      [-P] [-fno-working-directory] 
      [-x language] [-std=standard] 
      infile outfile 

     Only the most useful options are listed here; see below for the 
     remainder. 

DESCRIPTION 
     The C preprocessor, often known as cpp, is a macro processor that is 
     used automatically by the C compiler to transform your program before 
     compilation. It is called a macro processor because it allows you to 
     define macros, which are brief abbreviations for longer constructs. 
+0

这也是我的基本想法,但我想知道是否有任何办法做到这一点,没有使用'cpp'。 – Kijan

+0

我想我还是想知道为什么你需要*不使用'cpp'。即 - 对于您提出的问题,存在成熟的解决方案。这个解决方案对于这项任务来说有什么不足? –

+0

我只是想知道是否有办法做到这一点,而不是'cpp',可能更有效。无论如何,我可能会使用'cpp',因为它的可移植性。 – Kijan