What is Lexical analyzer ? Types of Tokens in Complier Design
Submitted by PremsankarC on Sat, 01/23/2010 - 06:54.
Keyword:
Lexical analyzer,Complier Design
Lexical analyzer converts stream of input characters into a stream of tokens.The different tokens that our lexical analyzer identifies are as follows:
KEYWORDS:
int, char, float, double, if, for, while, else, switch, struct, printf, scanf, case, break, return, typedef, void
IDENTIFIERS:
main, fopen, getch etc
NUMBERS:
positive and negative integers, positive and negative floating point numbers.
OPERATORS:
+, ++, -, --, ||, *, ?, /, >, >=, <, <=, =, ==, &, &&.
BRACKETS:
[ ], { }, ( ).
STRINGS :
Set of characters enclosed within the quotes
COMMENT LINES:
Ignores single line, multi line comments
