C-Tokens
In a C source program, the basic element recognized by the compiler is the "token." A token is source-program text that the compiler does not break down into component elements.Or In Other words These are the basic building block in which form a program.Each and every smallest individual unit in C which has a specific meaning is known as C-Token.Types of C-Token:-There are 6 major C tokens in C language.
1.Keywords:-Keywords are those words whose meaning is already defined by Compiler.It Cannot be used as Variable Name.There are 32 Keywords in C.C Keywords are also called as Reserved words.All the C keywords are given bellow.
auto | double | int | struct |
---|---|---|---|
break | else | long | switch |
case | enum | register | typedef |
char | extern | return | union |
const | float | short | unsigned |
continue | for | signed | void |
default | goto | sizeof | volatile |
do | if | static | while |
2.Identifiers:-An Indetifier can only have alphanumeric characters( a-z , A-Z , 0-9 ) and underscore( _ ). The first character of an identifier can only contain alphabet( a-z , A-Z ) or underscore ( _ ). ... For example name and Name are two different identifier in C. Keywords and Identifiers in C Language.
3.Constant:- A "constant" is a number, character, or character string that can be used as a value in a program. Use constants to represent floating-point, integer, enumeration, or character values that cannot be modified. C supports several types of constants that I am discussing in this article.
4.Operator:-An operator is a symbol that tells the compiler to perform specific mathematical or logical functions. C language is rich in built-in operators and provides the following types of operators −- Arithmetic Operators
- Relational Operators
- Logical Operators
- Bitwise Operators
- Assignment Operators
- Misc Operators
Escape sequence | Hex value in ASCII | Character represented |
---|---|---|
\a | 07 | Alert (Beep, Bell) (added in C89) |
\b | 08 | Backspace |
\f | 0C | Formfeed |
\n | 0A | Newline (Line Feed); see notes below |
\r | 0D | Carriage Return |
\t | 09 | Horizontal Tab |
\v | 0B | Vertical Tab |
\\ | 5C | Backslash |
\' | 27 | Single quotation mark |
\" | 22 | Double quotation mark |
\? | 3F | Question mark (used to avoid trigraphs) |
\nnn | any | The byte whose numerical value is given by nnn interpreted as an octal number |
\xhh… | any | The byte whose numerical value is given by hh… interpreted as a hexadecimal number |
Delimiters | Description |
---|---|
( ) |
Parentheses. The Lisp programming language syntax is cited as recognizable primarily by its use of parentheses. |
{ } |
Braces (also called curly brackets.) |
[ ] |
Brackets (commonly used to denote a subscript) |
< > |
Angle brackets. |
" " |
commonly used to denote string literals. |
' ' |
commonly used to denote character literals. |
<? ?> |
used to indicate XML processing instructions. |
/* */ |
used to denote comments in some programming languages. |
<% %> |
used in some web templates to specify language boundaries. These are also called template delimiters. |
No comments:
Post a Comment