views:

88

answers:

3

Among the C-syntax family of languages (C, C++, Java, C#, ObjC, JS, AS, ...), which have a preprocessor compatible (to whatever extent) with the C preprocessor?

+3  A: 

Objective C is a superset of the C language and was initially implemented as an additional preprocessor to C code. It is fully compatible with C preprocessor.

None of the others you name have preprocessors compatible with the C spec. Keep in mind that preprocessors are an assembler/compiler-specific thing in many cases, and the functionality you are looking for may or may not be found in different, proprietary IDEs/Compilers.

Of course, C++ is 100% (more or less) compatible as well.

Computer Guru
A: 

C++ and objective-C both use the C preprocessor, none of the others do.

You can always add a macro processor or template language to any build process if you need it.

Mark
A: 

Java and JS have no preprocessor (JS understandably, really, since you can run strings as code in-language). Not sure about AS, but C, C++, and ObjC all have a C-grade preprocessor.

C# does have a preprocessor, but I've never used it, and thus cannot talk about it's use. http://msdn.microsoft.com/en-us/library/ed8yd1ha(VS10.0).aspx

The Boost preprocessor library is awesum.

DeadMG