如何获取eclipse来识别预处理语句? [英] How to get eclipse to recognize preprocessor statements?
问题描述
//#ifdef VER_X
public class Video extends FirstCanvas {
//#else
public class Video extends SecondCanvas {
// #endif
...
是否有可以解决的设置或插件这个?
编辑:也许有一点澄清:我正在寻找一些能使IDE编辑器更符合代码的东西。由于编辑器THINKS的错误,它不会让我遵循任何定义。
更多的OO方法使用单独的类,在运行时在它们之间进行选择:
public class FirstVideo extends FirstCanvas {
...
}
public class SecondVideo extends SecondCanvas {
...
}
...
video =(something?new FirstVideo ():new SecondVideo());
这不需要非标准的编译步骤来实现并且不会打开eldritch的门C / C ++预处理指令的恐怖。
I've managed to get the IDE to compile the java project correctly by modifying the config.ini, but the IDE itself is still showing errors concerning the processor statements:
//#ifdef VER_X
public class Video extends FirstCanvas {
//#else
public class Video extends SecondCanvas {
//#endif
...
Is there a setting or a plug-in that would solve this?
EDIT: Maybe a little clarification: I'm looking for something that will make the IDE editor more compliant with the code. It won't let me follow any definitions because of what the editor THINKS are errors.
A more OO approach to this would use separate classes, selecting between them at runtime:
public class FirstVideo extends FirstCanvas {
...
}
public class SecondVideo extends SecondCanvas {
...
}
...
video = (something ? new FirstVideo() : new SecondVideo());
This does not require non-standard compilation steps to achieve and doesn't open the door to the eldritch horrors of C/C++ preprocessor directives.
这篇关于如何获取eclipse来识别预处理语句?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!