Friday 10 July 2015

Token :

             A token is a language element that is used to form a statement.C++ statement may consist of different tokens.Different types of tokens are as follows :

  • Keywords: Keywords is a word in C language that has predefined meaning and purpose.

Example:   For               Double             if                 const


  • Identifiers: Identifiers is the name of a variable or function etc.It is also called user-defined word.

Example:   Student_age           counter             good20                


  • Constants: Constant is a quantity that cannot be changed during execution of a program.

Example:   113           420               800.4             -300.5      'e'         '%'





  • String literals: A collection of characters written in double quotations is called string or string literal. 

Example:  "This is a string constant"              "300"             "99-Mall Road."


  • Operators: Operator is a symbol that performs some operation.It acts on different operands.

Example:     +               -                    *               /             %


  • Special Symbol: Special symbol is a symbol that is used to separate two tokens.It is also called punctuators.

Example:        [ ]             ( )            { }           ,            ;            .               :   



No comments:

Post a Comment