Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Programming Guide

Token records

Each token record assigns a number, called a token index, that is used by later records to refer to a token recognized by the PL/I compiler. The record also identifies the type of the token plus the column and line on which it started and ended.

Figure 119. Declare for a token record
Dcl
  1 Xin_Tok     Based( null() ),   /* token record                  */
                                   /*                               */
    2 Xin_Tok_Hdr                  /* standard header               */
           like Xin_Hdr,           /*                               */
                                   /*                               */
    2 Xin_Tok_Inx                  /* adata index for token         */
           fixed bin(32) unsigned, /*                               */
                                   /*                               */
    2 Xin_Tok_Begin_Line           /* starting line no within file  */
           fixed bin(32) unsigned, /*                               */
                                   /*                               */
    2 Xin_Tok_End_Line_Offset      /* offset of end line from first */
           fixed bin(16) unsigned, /*                               */
                                   /*                               */
    2 Xin_Tok_Kind_Value           /* token kind                    */
           ordinal xin_Tok_Kind,   /*                               */
                                   /*                               */
    2 Xin_Tok_Rsrvd                /* reserved                      */
           fixed bin(8) unsigned,  /*                               */
                                   /*                               */
    2 Xin_Tok_Begin_Col            /* starting column               */
           fixed bin(16) unsigned, /*                               */
                                   /*                               */
    2 Xin_Tok_End_Col              /* ending column                 */
           fixed bin(16) unsigned; /*                               */

The ordinal xin_Tok_Kind identifies the type of the token record.

Figure 120. Declare for the token record kind

 Define
  ordinal
    xin_Tok_Kind
      (  xin_Tok_Kind_Unset
        ,xin_Tok_Kind_Lexeme
        ,xin_Tok_Kind_Comment
        ,xin_Tok_Kind_Literal
        ,xin_Tok_Kind_Identifier
        ,xin_Tok_Kind_Keyword
                                   )  prec(8) unsigned;

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)