Programming
80
NetLinx Studio - Instruction Manual
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:
Supported Regular Expression Special Characters (Cont.)
Special
Character
Description
\x
This allows you to use a character x that would otherwise have a special meaning. For example: \[ would
be interpreted as [ and not as the start of a character set.
[...]
This indicates a set of characters. For example: [abc] means any of the characters a, b or c. You can also
use ranges. For example: [a-z] for any lower case character.
[^...]
The complement of the characters in the set. For example: [^A-Za-z] means any character except an
alphabetic character.
^
This matches the start of a line (unless used inside a set, see above).
$
This matches the end of a line.
*
This matches 0 or more times. For example: Sa*m matches Sm, Sam, Saam, Saaam and so on.
+
This matches 1 or more times. For example: Sa+m matches Sam, Saam, Saaam and so on.
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).
The comment is then syntax highlighted using the color specified in
Preferences > Editor -
Highlighting and Fonts > Comment
.
Language Reserved
Words
When NetLinx Studio is started it loads two files: NetLinx.rw and Axcess.rw. These are the
"reserved word" files. These files contain 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.
If a partial word that is typed is recognized as a reserved word, the editor will suggest its closest
match.
Operator
All of the following operators:
= < > + - * / % ! & | ^ ~ <= >= <> && || ^^
and the longer forms:
BOR AND XOR NOT BAND BNOT BXOR OR
are syntax highlighted using the color specified in
Preferences > Editor - Highlighting and Fonts >
Operator
.
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.
A number may have the optional prefix "
$
" for hex or the optional postfix "
b
" for binary.
If the number is a hexadecimal number then it may contain the letters A-F or a-f.
Numbers are syntax highlighted using the color specified in
Preferences > Editor - Highlighting
and Fonts > Number
.
String
Strings are any series of characters and digits that occur within two single quotes.
Strings are syntax highlighted using the color specified in
Preferences > Editor - Highlighting and
Fonts > String
.
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.
So if a DEFINE_DEVICE section contains a line that reads "dvTP = 128" the word dvTP will be
remembered as a device and syntax highlighted using the color specified in
Preferences > Editor
- Highlighting and Fonts > Device
.
Additionally, if the editor recognizes that you have partially typed the name of the above section
variable (for example "dv"), it will auto-suggest "dvTP". It does this for all of the items it
encountered in any of the above DEFINE_ sections.
Summary of Contents for NetLinx Studio
Page 40: ...Working with Projects 28 NetLinx Studio Instruction Manual...
Page 148: ...Communication Settings 136 NetLinx Studio Instruction Manual...
Page 160: ...Working with Online Devices 148 NetLinx Studio Instruction Manual...
Page 178: ...File Transfer Operations 166 NetLinx Studio Instruction Manual...
Page 208: ...Tools Menu Options 196 NetLinx Studio Instruction Manual...
Page 229: ...Setting Program Preferences 217 NetLinx Studio Instruction Manual...