Syntax Highlighting
When a source file is loaded in an Editor window, it is read line by line. Each line is broken up into its constituent words. Different words and groups of words are handled differently, as described below:
Syntax Highlighting | ||||
---|---|---|---|---|
Comments | Any portion of the line that initiates or falls within a comment is considered to be one comment (essentially it's treated as one big word). | |||
Language Reserved Words | When NetLinx Studio is started it loads the NetLinx.rw file. This is the "reserved word" file. The file contains all of the words that NetLinx Studio will consider to be "Language Reserved Words". Language Reserved Words are syntax highlighted using the color specified in Preferences > Editor - Highlighting and Fonts > Language Reserved Word. | |||
Operator | All of the following operators: *= < > + - / % ! & | ^ ~ <= >= <> && | ^^** | |
Floating Point Numbers | A number is considered a floating point number if it contains a decimal point. Floating point numbers are syntax highlighted using the color specified in Preferences > Editor - Highlighting and Fonts > Floating Point Number. | |||
Number | A number is any series of digits that does not include a decimal point. | |||
String | Strings are any series of characters and digits that occur within two single quotes. |
Syntax Highlighting (Cont.) | |
---|---|
Constants, Devices, Type, Variable | Since NetLinx code may be divided into the following sections DEFINE_CONSTANT, DEFINE_DEVICE, DEFINE_TYPE, DEFINE_VARIABLE, anytime a word is encountered that falls within one of these sections it is parsed, remembered, and then syntax highlighted according to the section in which it occurred. |
Default Text | Any word that is not recognized as any of the above is syntax highlighted using the color specified in Preferences > Editor - Highlighting and Fonts > Default Text. |
Default Syntax Highlighting Colors
Syntax Highlighting assigns different colors to different types of data in your Source Code file for increased readability.
The default colors can be customized via the options in the Editor - Highlighting and Fonts tab of the Preferences dialog - see
page 190
for details.