Syntax Highlighting - AMX NetLinx Studio Instruction Manual

Netlinx design v3.3 or higher
Table of Contents

Advertisement

Programming
Supported Regular Expression Special Characters (Cont.)
Special
Character
\x
[...]
[^...]
^
$
*
+

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
Language Reserved
Words
Operator
Floating Point
Numbers
Number
String
Constants, Devices,
Type, Variable
80
Description
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.
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.
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.
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.
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.
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.
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.
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.
NetLinx Studio - Instruction Manual

Advertisement

Table of Contents
loading

Table of Contents