< prev index next >

src/java.corba/share/classes/com/sun/tools/corba/se/idl/Token.java

Print this page




 315         return Last23Keyword ;
 316     if (level == CORBA_LEVEL_24RTF)
 317         return Last24rtfKeyword ;
 318     return Last30Keyword ;
 319   }
 320 
 321   /** Create a keyword token from a string.
 322   * Determines whether the string is an IDL keyword based on the corbaLevel.
 323   * Strings that are keywords at higher CORBA levels than the corbaLevel
 324   * argument create identifier tokens that are marked as "collidesWithKeyword", unless
 325   * escapedOK is FALSE, which is the case only when preprocessing is taking place.
 326   * In the case of the "init" keyword, which was only defined in CORBA 2.3, init is
 327   * marked deprecated in CORBA 2.3 since it is not supported in higher levels.
 328   * @param String string The string we are converting to a token.
 329   * @param float corbaLevel The CORBA level, currently in the interval [2.2, 3.0].
 330   * @param boolean escapedOK Flag set true if _ is used to escape an IDL keyword for use
 331   * as an identifier.
 332   * @param boolean[] collidesWithKeyword is an array containing one value: a flag
 333   * representing whether this string is an identifier that collides with a keyword.
 334   * This is set by this method.
 335   * @returns Token The resulting Token corresponding to string.
 336   */
 337   public static Token makeKeywordToken(
 338     String string, float corbaLevel, boolean escapedOK, boolean[] collision )
 339   {
 340     int level = getLevel( corbaLevel ) ;
 341     int lastKeyword = getLastKeyword( level ) ;
 342     boolean deprecated = false ;
 343     collision[0] = false ;
 344 
 345     // If the string is a keyword token, return that token
 346     for (int i = Token.FirstKeyword; i <= Token.LastKeyword; ++i) {
 347         if (string.equals (Token.Keywords[i])) {
 348             // <f60858.1><d62023> Return identifier if lexeme is a keyword in a
 349             // greater CORBA level; collect attributes indicating future keyword/
 350             // identifier collision and deprecations.
 351 
 352             // Init is really a funny case.  I don't want to mark it as
 353             // a keyword collision in the 2.2 case, since it was only
 354             // defined to be a keyword briefly in 2.3.
 355             if (i == Token.Init) {




 315         return Last23Keyword ;
 316     if (level == CORBA_LEVEL_24RTF)
 317         return Last24rtfKeyword ;
 318     return Last30Keyword ;
 319   }
 320 
 321   /** Create a keyword token from a string.
 322   * Determines whether the string is an IDL keyword based on the corbaLevel.
 323   * Strings that are keywords at higher CORBA levels than the corbaLevel
 324   * argument create identifier tokens that are marked as "collidesWithKeyword", unless
 325   * escapedOK is FALSE, which is the case only when preprocessing is taking place.
 326   * In the case of the "init" keyword, which was only defined in CORBA 2.3, init is
 327   * marked deprecated in CORBA 2.3 since it is not supported in higher levels.
 328   * @param String string The string we are converting to a token.
 329   * @param float corbaLevel The CORBA level, currently in the interval [2.2, 3.0].
 330   * @param boolean escapedOK Flag set true if _ is used to escape an IDL keyword for use
 331   * as an identifier.
 332   * @param boolean[] collidesWithKeyword is an array containing one value: a flag
 333   * representing whether this string is an identifier that collides with a keyword.
 334   * This is set by this method.
 335   * @return Token The resulting Token corresponding to string.
 336   */
 337   public static Token makeKeywordToken(
 338     String string, float corbaLevel, boolean escapedOK, boolean[] collision )
 339   {
 340     int level = getLevel( corbaLevel ) ;
 341     int lastKeyword = getLastKeyword( level ) ;
 342     boolean deprecated = false ;
 343     collision[0] = false ;
 344 
 345     // If the string is a keyword token, return that token
 346     for (int i = Token.FirstKeyword; i <= Token.LastKeyword; ++i) {
 347         if (string.equals (Token.Keywords[i])) {
 348             // <f60858.1><d62023> Return identifier if lexeme is a keyword in a
 349             // greater CORBA level; collect attributes indicating future keyword/
 350             // identifier collision and deprecations.
 351 
 352             // Init is really a funny case.  I don't want to mark it as
 353             // a keyword collision in the 2.2 case, since it was only
 354             // defined to be a keyword briefly in 2.3.
 355             if (i == Token.Init) {


< prev index next >