有没有治愈的preprocessor布鲁斯? [英] Is there any cure for the preprocessor blues?

查看:113
本文介绍了有没有治愈的preprocessor布鲁斯?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以踢的preprocessor吐在我的特定情况下的 -E 选项输出。对于产生code此preprocessor输出杀气。比如我有一个4GL应用程序和Informix转换成该 C 这反过来又被吐出到一个可怕的丑陋的烂摊子。

I know that I can kick the the preprocessor to spit out output with the -E option in my particular circumstance. For generated code this preprocessor output is murderous. For example I have a 4gl application and Informix converts this into C which in turn gets spit out to a horrible ugly mess.

我要的是一个编辑器,让我到指定P. $ pprocessor值生效什么$,并显示我只有相关code。我在Vim的匹配 #IFDEF 一些非常基本的工作和 #ENDIF ,而code是百病更先进的结构,比如是的#ifndef #如果的#else 。更糟糕的是,该结构在逻辑上是比较复杂的,我不认为我的Vim的脚本技能足以让我得到我想要出来的东西。例如:

What I want is an editor that will allow me to specify what preprocessor values are in effect and show me only the relevant code. I have something very basic working in Vim matching #ifdef and #endif, but the code is riddled with more advanced constructs such is #ifndef, #if, and #else. To make matters worse, the constructs are logically more complex, and I don't think my Vim scripting skills are adequate for me to get what I want out of it. For example:

#if DLEVEL > 5
    #define SIGNAL  1
    #if STACKUSE == 1
        #define STACK   200
    #else
        #define STACK   100
    #endif
#else
    #define SIGNAL  0
    #if STACKUSE == 1
        #define STACK   100
    #else
        #define STACK   50
    #endif
#endif
#if DLEVEL == 0
    #define STACK 0
#elif DLEVEL == 1
    #define STACK 100
#elif DLEVEL > 5
    display( debugptr );
#else
    #define STACK 200
#endif

包括限定前pression评估,如果我想解决它。这已经是一个解决问题!如果你有Vim的建议或其他的人,请让我知道。

Includes defining an expression evaluator if I want to tackle it. This has to be a solved problem! If you have Vim suggestions or other ones please let me know.

推荐答案

Eclipse的 CDT 编辑器做根据声明是积极的宏pretty抓好突出code。您可能要检查它。

The Eclipse CDT editor does a pretty good job highlighting code based on the macros you declare to be active. You may want to check it out.

这篇关于有没有治愈的preprocessor布鲁斯?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆