User manual
178
mikoPascal PRO for PIC32
MikroElektronika
Lexical Elements Overview
The following topics provide a formal denition of the mikroPascal PRO for PIC32 lexical elements. They describe
different categories of word-like units (tokens) recognized by the language.
In the tokenizing phase of compilation, the source code le is parsed (i.e. broken down) into tokens and whitespace.
The tokens in mikroPascal PRO for PIC32 are derived from a series of operations performed on your programs by the
compiler.
Whitespace
Whitespace is a collective name given to spaces (blanks), horizontal and vertical tabs, newline characters and comments.
Whitespace can serve to indicate where tokens start and end, but beyond this function, any surplus whitespace is
discarded.
For example, the two sequences
var i : char;
j : word;
and
var
i : char;
j : word;
are lexically equivalent and parse identically to give nine tokens:
var
i
:
char
;
j
:
word
;
Newline Character
Newline character (CR/LF) is not a whitespace in BASIC, and serves as a statement terminator/separator. In mikroPascal
PRO for PIC32, however, you may use newline to break long statements into several lines. Parser will rst try to get the
longest possible expression (across lines if necessary), and then check for statement terminators.
Whitespace in Strings
The ASCII characters representing whitespace can occur within string literals, in which case they are protected from
the normal parsing process (they remain a part of the string). For example,