Jump to content

Compiler/Preprocessor: Difference between revisions

Remove empty parentheses
(removed constant math sentence)
(Remove empty parentheses)
Line 11:
The include command must be followed by whitespace and a string who contents is the actual file to read. Includes should allow the inclusion of other files to a recursive limit of five active header files plus the original source file.
 
The define command must be followed by whitespace and a new macro name. Redefinition is illegal. The same character convention for naming variables in the language is used for macro names. No whitespace is required in the arguments but is allowed between every token. BothWhen nothere parenthesisare orno emptyparameters, parenthesis are equivalent onneither the definedefinition or its usage. Thisis yieldsallowed noto argumentsspecify parenthesis. If there is a close parenthesis, the whitespace trailing it is optional. Otherwise, it is required. From that point to end of line is the definition, whitespace removed from both the start and end of it. Whitespace within the definition between tokens must be maintained. Any names within the definition are treated as macro names first before it is assumed they are a variable in the language.
 
To make it easier to find, the usage will be within hashtags, and replaces its usage elsewhere in the files processed. The calling arguments replace the define's parameters as a simple string substitution.
Line 26:
#include "Header.h"
#define width 5
#define height() 6
area = #area(height, width())#;
</pre>
 
Line 47:
area = 6 * 5;
</pre>
 
;Related Tasks
* [[Compiler/lexical_analyzer|Lexical Analyzer task]]
Cookies help us deliver our services. By using our services, you agree to our use of cookies.