Mikroelektronika MIKROE-724 データシート

ページ / 726
182
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
Comments
Comments are pieces of text used to annotate a program, and are technically another form of whitespace. Comments are 
for the programmer’s use only; they are stripped from the source text before parsing.
Use the apostrophe to create a comment:
‘ Any text between an apostrophe and the end of the
‘ line constitutes a comment. May span one line only.
There are no multi-line comments in mikroBasic PRO for dsPIC30/33 and PIC24
Tokens
Token is the smallest element of a mikroBasic PRO for dsPIC30/33 and PIC24 program, meaningful to the compiler. 
The parser separates tokens from the input stream by creating the longest token possible using the input characters 
in a left–to–right scan.
mikroBasic PRO for dsPIC30/33 and PIC24 recognizes the following kinds of tokens:
- keywords 
- identifiers 
- constants 
- operators 
- punctuators (also known as separators) 
Token Extraction Example
Here is an example of token extraction. Take a look at the following example code sequence:
end_flag = 0
First, note that 
end_flag
 would be parsed as a single identifier, rather than as the keyword 
end
 followed by the identifier 
_flag
.
The compiler would parse it as the following four tokens:
end_flag   ‘ variable identifier
=         ‘ assignment operator
0         ‘ literal
newline
   ‘ statement terminator