# preprocessor

Source: https://ref.dm-lang.org/DM/preprocessor/

The preprocessor performs various transformations on source code as the DM compiler reads the file. It may be used to define macros—that is words which are replaced by other fragments of code. It is also possible to insert other source code files and to conditionally compile or not compile sections of code.

Preprocessor commands are called directives. They are placed on a line by themselves and always begin with a hash symbol `#`. The preprocessor directives recognized by DM are the same as standard C compilers: ``

<pre>`<a href="#/DM/preprocessor/define">#define</a>
<a href="#/DM/preprocessor/if">#if</a>
<a href="#/DM/preprocessor/elif">#elif</a>
<a href="#/DM/preprocessor/ifdef">#ifdef</a>
<a href="#/DM/preprocessor/ifndef">#ifndef</a>
<a href="#/DM/preprocessor/else">#else</a>
<a href="#/DM/preprocessor/endif">#endif</a>
<a href="#/DM/preprocessor/include">#include</a>
<a href="#/DM/preprocessor/pragma">#pragma</a>
<a href="#/DM/preprocessor/error">#error</a>
<a href="#/DM/preprocessor/warn">#warn</a>
`</pre>

## Pages

- [__FILE__ macro](https://ref.dm-lang.org/DM/preprocessor/__FILE__.md)
- [__IMPLIED_TYPE__ macro](https://ref.dm-lang.org/DM/preprocessor/__IMPLIED_TYPE__.md)
- [__LINE__ macro](https://ref.dm-lang.org/DM/preprocessor/__LINE__.md)
- [__MAIN__ macro](https://ref.dm-lang.org/DM/preprocessor/__MAIN__.md)
- [__PROC__ macro](https://ref.dm-lang.org/DM/preprocessor/__PROC__.md)
- [__TYPE__ macro](https://ref.dm-lang.org/DM/preprocessor/__TYPE__.md)
- [#define directive](https://ref.dm-lang.org/DM/preprocessor/define/index.md)
- [DM_BUILD macro](https://ref.dm-lang.org/DM/preprocessor/DM_BUILD.md)
- [DM_VERSION macro](https://ref.dm-lang.org/DM/preprocessor/DM_VERSION.md)
- [#elif directive](https://ref.dm-lang.org/DM/preprocessor/elif.md)
- [#else directive](https://ref.dm-lang.org/DM/preprocessor/else.md)
- [#endif directive](https://ref.dm-lang.org/DM/preprocessor/endif.md)
- [#error directive](https://ref.dm-lang.org/DM/preprocessor/error.md)
- [#if directive](https://ref.dm-lang.org/DM/preprocessor/if.md)
- [#ifdef directive](https://ref.dm-lang.org/DM/preprocessor/ifdef.md)
- [#ifndef directive](https://ref.dm-lang.org/DM/preprocessor/ifndef.md)
- [#include directive](https://ref.dm-lang.org/DM/preprocessor/include.md)
- [#pragma directive](https://ref.dm-lang.org/DM/preprocessor/pragma/index.md)
- [#undef directive](https://ref.dm-lang.org/DM/preprocessor/undef.md)
- [#warn directive](https://ref.dm-lang.org/DM/preprocessor/warn.md)
