
Compilation 11
System . out. println (" Hello , World !");
}
}
The scanner breaks the program text into atomic tokens. For example, it recognizes each
of import, java, ., lang, ., System, and ; as being distinct tokens.
Some tokens, such as java, HelloWorld, and main, are identifiers. The scanner catego-
rizes theses tokens as IDENTIFIER tokens. The parser uses these category names to identify
the kinds of incoming tokens. IDENTIFIER tokens carry along their images as attributes; for
example, the first IDENTIFIER in the above program has java as its image. Such attributes
are used in semantic analysis.
Some tokens are reserved words, each having its unique ...