Professional Documents
Culture Documents
5 Tokens Lyst1919
5 Tokens Lyst1919
Tokens
② Constants
③ variables
⑥ keywords
⑤ comments
tokens
also known lexical elements
tokens are as
•
211%-95
-
Parser is a
program
whose job is to
Constants ( Literals )
-
Identifiers ( variables ,
functions . . . .
)
-
Keywords
-
operators
Punctuations
space
-
operator
✓ ← ← constant
int 9=5 I
↑ ↑
← punctuates
keyword variable )
C
identities
Whitespace
-
Tokens are
usually separated by white
space ,
which can be one or more
Blanks
-
Tabs
-
New lines
-
Form feed
- Comments
Cornmeal
-
Comments are text ignored by compiler
•
Comments are useful for documentation
of your code and useful for programmers .
text line 2
' '
- n
*
/
Sample
-
Program in C
operators
Punctuators
inn# main C) Constants
{ Identifiers
iinntt b. c ; / / variables
keywords
a
* numbers 11$ ;
"
•
;
C=za*- b :
CD :
"
prin.tt #
"
sum is %d •
*
ends here /
/
*
main function body
}
utinsata
Inform
-
-
primary secondary
3 Pointers
Integer 25
,
-417,0 ,
.
• array
" "
Real , ,
-
structure
' ' ' ' ' ' '
character a A 5 't .
union
enumerator
#É7
-
I 1
1.*
' ' '
yn
Variables
G-]
-60
Di
RAM
program
,memf¥É
CPU or
men
Variables
☒
Variables
Variable is name of location
a memory
•
where we store
program
's data .
during
execution of
program .
✗ -
I ✗ b$ ✗
s.li ✗ 52 ✗
x y ✗
if ✗ ( keyword)
IF ✓
-
A ✓
2x ✗
sensitive
c
language is a case
language
cisu keywords
p_ք#Reserved words
case sensitive
language
?¥¥m?!
auto double int struct _
Bool
break else switch Complex
long -
_
Align of
register typedef
enum
case -
Imaginary
char extern return union
inline Generic
const float short unsigned
-
i.FI /
_
_
do static _
Thread local _
-689 Cgg
1-
32
Keywords +5
Cll
+7