1. Character set:
To study a language first we have to familiarize the character set. For example, to study English language first we have to study the alphabets. Similarly here the character set includes letters(A to Z & a to z), digits(0 to 9), special characters(+, -, ?, *, /, …..) white spaces(non printable), etc.
2. Token: It is the smallest individual units similar to a word in English or Malayalam language. C++ has 5 tokens
- Keywords: These are reserved words for the compiler. We can’t use for any other purposes.
Eg: float is used to declare variable to store numbers with decimal point. We can’t use this for any other purpose
- Identifier: These are user defined words.
Eg: variable name, function name, class name, object name, etc…
- Literals (Constants): Its value does not change during execution
eg: In maths % = 3.14157 and boiling point of water is 100.
- Punctuators: In English or Malayalam language punctuation mark are used to increase the readability but here it is used to separate the tokens.
eg:{,}, (,), ……..
- Operators: These are symbols used to perform an operation(Arithmetic, relational, logical, etc…).