You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IToken.java 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v 2.0
  6. * which accompanies this distribution and is available at
  7. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.weaver.patterns;
  13. import org.aspectj.weaver.IHasPosition;
  14. public interface IToken extends IHasPosition {
  15. IToken EOF = BasicToken.makeOperator("<eof>", 0, 0);
  16. /**
  17. * Returns the string value of this token.
  18. *
  19. * If isIdentifier is false, then this string must be intern'd
  20. * so that == matching can be used.
  21. *
  22. * If isIdentifier is true, interning is not required.
  23. */
  24. String getString();
  25. /**
  26. * Whether this should be treated as a token or a generic identifier
  27. */
  28. boolean isIdentifier();
  29. /**
  30. * Whether this should be treated as a literal value
  31. *
  32. * Kinds == "string", ???
  33. *
  34. * returns null if this isn't a literal
  35. */
  36. String getLiteralKind();
  37. /**
  38. * If this token represents a pre-parsed Pointcut, then return it;
  39. * otherwise returns null.
  40. *
  41. * Needed for the implementation of 'if'
  42. */
  43. Pointcut maybeGetParsedPointcut();
  44. }