Tokens:-
Tokens are the smallest individual unit of any language . It is the smallest element in the 'C' language .
Tokens are :-
Tokens are :-
- Constant
- Keyword
- Identifiers
- Punctuation
- Operators
1. Constant :- A constant value is the one which does not change during the execution of a program
Types of constant:-
- Integer Constant
- Real Constant
- Character Constant
- String constant
2. Keyword
:- The word which have special meaning to the compiler is called
keyword. The meaning of keyword can't be changed. They are also called
reserved word . Keyword can't be used as a variable name . They are 32
keywords in 'C' . All keyword are in lower case .
List of keywords
- auto
- break
- case
- char
- const
- continue
- default
- do
- double
- else
- enum
- extern
- float
- for
- goto
- if
- int
- long
- register
- return
- short
- signed
- size of
- static
- struct
- switch
- typed ef
- union
- unsigned
- void
- volatile
- while
3.Identifiers/ Names
Identifiers is the name of user-defined variable, array and functions .
'C' is a case-sensitive language that is upper case and lower case alphabets are different for 'C'.
Ex- 'Num' and 'num' are two different identifiers for c language.
Rules of identifiers :-
- First character must be an alphabet or underscore.
- Identifiers name must consist of only letters, digits and underscore.
- An Identifier should have less than 31 characters.
- The keyword can not be used as identifiers.
- No comma or blank are allowed with in an identifier.
4.Punctuations:-
Semicolons,colons,commas,apostrophes,quotations mark,braces,brackets and parentheses .
; : , ' " () {} [] * = # .
5. Operators :-
- Assignment Operator
- Arithmetic Operator
- Relational Operator
- Logical Operator
- Increment Operator
- Decrement Operator
- Boolean Operator
- Bit-wise Operator
- Size of() Operator
- Comma Operator
No comments:
Post a Comment