Assignment Two
Assignment Two
Token:-
Tokens
int (keyword), a(identifier), =(operator), 10(constant) and ;
(punctuation-semicolon)
Lexeme
It is a sequence of It specifies a
Token is basically a
characters in the source set of rules
sequence of
code that are matched that a
characters that are
by given predefined scanner
treated as a unit as
language rules for every follows to
it cannot be further
lexeme to be specified create a
broken down.
Definition as a valid token. token.
The
all the reserved
sequence of
Interpretation keywords of that
int, goto characters
language(main,
of type that make the
printf, etc.)
Keyword keyword.
it must start
with the
name of a variable, alphabet,
Interpretation main, a
function, etc followed by
of type the alphabet
Identifier or a digit.
Interpretation
all the operators are
of type +, = +, =
considered tokens.
Operator
bracket, comma,
etc.
any string of
characters
a grammar rule or “Welcome to
(except ‘ ‘)
boolean literal. GeeksforGeeks!”
Interpretation between ”
of type Literal and