1. /*
  2. * @(#)file Token.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 4.7
  5. * @(#)date 04/09/15
  6. *
  7. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  8. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  9. *
  10. */
  11. /* Generated By:JavaCC: Do not edit this line. Token.java Version 0.7pre3 */
  12. package com.sun.jmx.snmp.IPAcl;
  13. /**
  14. * Describes the input token stream.
  15. */
  16. class Token {
  17. /**
  18. * An integer that describes the kind of this token. This numbering
  19. * system is determined by JavaCCParser, and a table of these numbers is
  20. * stored in the file ...Constants.java.
  21. */
  22. public int kind;
  23. /**
  24. * beginLine and beginColumn describe the position of the first character
  25. * of this token; endLine and endColumn describe the position of the
  26. * last character of this token.
  27. */
  28. public int beginLine, beginColumn, endLine, endColumn;
  29. /**
  30. * The string image of the token.
  31. */
  32. public String image;
  33. /**
  34. * A reference to the next regular (non-special) token from the input
  35. * stream. If this is the last token from the input stream, or if the
  36. * token manager has not read tokens beyond this one, this field is
  37. * set to null. This is true only if this token is also a regular
  38. * token. Otherwise, see below for a description of the contents of
  39. * this field.
  40. */
  41. public Token next;
  42. /**
  43. * This field is used to access special tokens that occur prior to this
  44. * token, but after the immediately preceding regular (non-special) token.
  45. * If there are no such special tokens, this field is set to null.
  46. * When there are more than one such special token, this field refers
  47. * to the last of these special tokens, which in turn refers to the next
  48. * previous special token through its specialToken field, and so on
  49. * until the first special token (whose specialToken field is null).
  50. * The next fields of special tokens refer to other special tokens that
  51. * immediately follow it (without an intervening regular token). If there
  52. * is no such token, this field is null.
  53. */
  54. public Token specialToken;
  55. /**
  56. * Returns the image.
  57. */
  58. public final String toString()
  59. {
  60. return image;
  61. }
  62. /**
  63. * Returns a new Token object, by default. However, if you want, you
  64. * can create and return subclass objects based on the value of ofKind.
  65. * Simply add the cases to the switch for all those special cases.
  66. * For example, if you have a subclass of Token called IDToken that
  67. * you want to create if ofKind is ID, simlpy add something like :
  68. *
  69. * case MyParserConstants.ID : return new IDToken();
  70. *
  71. * to the following switch statement. Then you can cast matchedToken
  72. * variable to the appropriate type and use it in your lexical actions.
  73. */
  74. public static final Token newToken(int ofKind)
  75. {
  76. switch(ofKind)
  77. {
  78. default : return new Token();
  79. }
  80. }
  81. }