简体   繁体   English

C预处理器库

[英]C preprocessor library

I have a task of developing source analysis tool for C programs, and I need to pre-process code before the analysis itself. 我有一个为C程序开发源分析工具的任务,我需要在分析之前预处理代码。 I was wondering what is the best library for this. 我想知道什么是最好的图书馆。 I need something light-weight and portable. 我需要轻巧便携的东西。

Instead of rolling out your own, why not use cpp that's part of the gcc suite: http://gcc.gnu.org/onlinedocs/gcc-4.6.1/cpp/ 为什么不使用作为gcc套件一部分的cpp而不是自己推出: 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.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM