Skip to main content

Explain the Identifiers, Keywords and Tokens

 .

Tokens

A token is the smallest unit used in a C program. Token can define in C as the smallest individual elements in a program that is meaningful to the functioning of a compiler.
The following are the types of tokens: Keywords, Identifiers, Constant, Strings, Operators, etc.

Identifier

Identifier refer to the name of user define variable, array and function. A identifier should be essentially  a sequence of latter and digits. It is a type of string of alphanumeric characters that always begins with either an alphabetic or underscore character. There are specific rules to define the identifiers, and we can not use the already defined keywords present in the C language as identifiers.

 Valid Identifier

 Invalid Identifier

sum12 

12sum 

 Temp

goto 

 emp_12

emp12 


Internal identifier

Internal identifiers are the ones that are not used in any of the external link processes. Internal identifiers, also known as internal names, include the names of local variables. The internal identifier can be a local variable. It has at least 31 significant characters.

External identifier

External identifiers are the ones that are used in an external link process. These identifiers are also known as external names; include function names and global variable names that are shared between source files. The external identifier can be a name of function or a global variable. It has at least 63 significant characters.


Keywords 

Keywords are predefined, reserved words used in programming that have special meaning to the compiler. Keywords are part of the syntax and part of the syntax and they cannot be used as an identifier. These are the reserved words having predefine meaning in c program. These are 32 keywords as following.

 Auto

 double 

int 

struct 

break 

 else

long 

 switch

case 

enum 

register 

typedef 

char 

extern 

return 

 union

continue 

for 

signed 

void 

default  

goto 

sizeof 

volatile 

constant 

 float

short 

unsigned 





Comments

Popular posts from this blog

BCA mathematics -I (Unit I Set)

 .

BCA Mathematics -I (Unit I Complex Number)

 .

BCA Mathematics -I (Unit I Natural Number)

.