Mikroelektronika MIKROE-350 データシート

ページ / 526
COMMENTS
Comments are pieces of text used to annotate a program, and are technically anoth-
er 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 AVR
TOKENS
Token is the smallest element of a mikroBasic PRO for AVR 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 AVR 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. See the following code sequence:
end_flag = 0
The compiler would parse it into four tokens:
end_flag  ' variable identifier
=         ' assignment operator
0         ' literal
newline   ' statement terminator
Note that 
end_flag
would be parsed as a single identifier, rather than the keyword
end followed by the identifier _
flag
.
113
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroBasic PRO for AVR
CHAPTER 5