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.

PseudoToken.java 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.ajdt.internal.compiler.ast;
  13. import org.aspectj.weaver.patterns.IToken;
  14. import org.aspectj.weaver.patterns.Pointcut;
  15. import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
  16. import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
  17. import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
  18. import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Parser;
  19. /**
  20. */
  21. public class PseudoToken extends ASTNode implements IToken {
  22. public String value;
  23. public boolean isIdentifier;
  24. public String literalKind = null;
  25. public Parser parser;
  26. /**
  27. * Constructor for PointcutDesignatorToken.
  28. */
  29. public PseudoToken(Parser parser, String value, boolean isIdentifier) {
  30. this.parser = parser;
  31. this.value = value;
  32. this.isIdentifier = isIdentifier;
  33. }
  34. public String toString(int tab) {
  35. return "<" + value + "@" + getStart() + ":" + getEnd() + ">";
  36. }
  37. /**
  38. * @see org.aspectj.weaver.patterns.IToken#getString()
  39. */
  40. public String getString() {
  41. return value;
  42. }
  43. /**
  44. * @see org.aspectj.weaver.patterns.IToken#isIdentifier()
  45. */
  46. public boolean isIdentifier() {
  47. return isIdentifier;
  48. }
  49. /**
  50. * returns null if this isn't a literal
  51. */
  52. public String getLiteralKind() {
  53. return literalKind;
  54. }
  55. public Pointcut maybeGetParsedPointcut() {
  56. return null;
  57. }
  58. public int getStart() {
  59. return sourceStart;
  60. }
  61. /**
  62. *
  63. */
  64. public int getEnd() {
  65. return sourceEnd;
  66. }
  67. public String getFileName() {
  68. return "unknown";
  69. }
  70. public int postParse(TypeDeclaration typeDec, MethodDeclaration enclosingDec, int tokenNumber) {
  71. // nothing to do typically
  72. return 0;
  73. }
  74. /* (non-Javadoc)
  75. * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#print(int, java.lang.StringBuffer)
  76. */
  77. public StringBuffer print(int indent, StringBuffer output) {
  78. output.append("PseudoToken<" + getString() + ">");
  79. return output;
  80. }
  81. }