CHARACTER SETS AND TOKENS
Definition Of character set
A character set is a set of valid characters that a language can recognise . A character set represent any letter , digit , or any other sign . C++ has the following set:
Letters : A-Z , a-z
Digits : 0-9
Special Symbols : Space + - * / ^ \ () [] {} = > < . ' " $ , ; : ......etc.
White Spaces: Blank space , Horizontal tab (->)Carriage return , new line , Form feed.
Other Characters : C++ can process any of the 256 ASCII characters.
TOKENS
The smallest individual unit in a program is known as Token. C++ has the following tokens:
Keywords, Identifiers,Literals , Punctuators and Operators.
Keywords : These are the words that convey a special meaning to the language compiler.
Identifiers : An Identifier is the name given by user for a unit of a program.
Literials : Literials are data items that never change their value during a program run.
C++ allows several kinds of literials
1. integer - constant
2. character - constant
3.floating - constant
4.String - constant
No comments:
Post a Comment