TOKENS IN C language

Tokens in c programming language-: C  language provide many types tokens. In this  passage passage of text individual words and punctuation marks are called tokens. Similarly in a C program are the program the smallest individual units are known as C tokens. In the C language  has 6 types of tokens. C programs are written using these tokens Anderson test of the language. Types of C tokens are below:
1. Keywords
2. Identifiers
3. Constants
4. Strings
5. Special symbols
6. Operators
KEYWORDS AND IDENTIFIERS
Every C word word is classified as either a keyword or an identifier. All keywords have fixed meanings and these meaning cannot be changed changed. Keywords serve as basic buildings blocks for programme statements. All keywords must be written in lowercase. Some compilers may use additional keywords that must be identified from the  C manual.
There are some C keywords:
Auto , double, break, long, switch, return, Union, default, short, while, static, if, go to, register, do.
Identifiers refer to the names of variables functions and arrays. These are using different names and consists of a sequence of letters and digits which a letter as a first character. Both uppercase and lowercase letters are permitted , although lower case letters are commonly used. The underscore character is also permitted in identifiers. It is usually used as a link between 2 words in long identifiers.
◆ Rules for identifiers
1. First character must be an alphabet(or underscore)
2. Must consist of only letters digits or underscore
3. Only first 31 characters are significant.
4. Cannot use a keyword
5. Must not contain white space.

Leave a Comment