Examples of PatternParser


Examples of org.aspectj.weaver.patterns.PatternParser

    sourceStart = tokens[0].sourceStart;
    sourceEnd = tokens[tokens.length-2].sourceEnd;
  }
 
  public Pointcut parsePointcut(Parser parser) {
    PatternParser patternParser = new PatternParser(tokenSource);
    try {
      Pointcut ret = patternParser.parsePointcut();
      checkEof(parser);
      return ret;
    } catch (ParserException pe) {
      reportError(parser, pe);
      return Pointcut.makeMatchesNothing(Pointcut.SYMBOLIC);
View Full Code Here

Examples of org.aspectj.weaver.patterns.PatternParser

                                        new String[] {pe.getMessage()});
  }
 
 
  public TypePattern maybeParseDominatesPattern(Parser parser) {
    PatternParser patternParser = new PatternParser(tokenSource);
    try {
      if (patternParser.maybeEatIdentifier("dominates")) {
        // there is no eof check here
        return patternParser.parseTypePattern();
      } else {
        return null;
      }
    } catch (ParserException pe) {
      reportError(parser, pe);
View Full Code Here

Examples of org.aspectj.weaver.patterns.PatternParser

  private void registerAspectExclude(final BcelWeaver weaver, final ClassLoader loader, final List<Definition> definitions) {
    String fastMatchInfo = null;
    for (Definition definition : definitions) {
      for (String exclude : definition.getAspectExcludePatterns()) {
        TypePattern excludePattern = new PatternParser(exclude).parseTypePattern();
        m_aspectExcludeTypePattern.add(excludePattern);
        fastMatchInfo = looksLikeStartsWith(exclude);
        if (fastMatchInfo != null) {
          m_aspectExcludeStartsWith.add(fastMatchInfo);
        }
View Full Code Here

Examples of org.aspectj.weaver.patterns.PatternParser

  private void registerAspectInclude(final BcelWeaver weaver, final ClassLoader loader, final List<Definition> definitions) {
    String fastMatchInfo = null;
    for (Definition definition : definitions) {
      for (String include : definition.getAspectIncludePatterns()) {
        TypePattern includePattern = new PatternParser(include).parseTypePattern();
        m_aspectIncludeTypePattern.add(includePattern);
        fastMatchInfo = looksLikeStartsWith(include);
        if (fastMatchInfo != null) {
          m_aspectIncludeStartsWith.add(fastMatchInfo);
        }
View Full Code Here

Examples of org.aspectj.weaver.patterns.PatternParser

        } else if (include.equals("*")) {
          includeStar = true;
        } else if ((fastMatchInfo = looksLikeExactName(include)) != null) {
          includeExactName.add(fastMatchInfo);
        } else {
          TypePattern includePattern = new PatternParser(include).parseTypePattern();
          includeTypePattern.add(includePattern);
        }
      }
      for (Iterator iterator1 = definition.getExcludePatterns().iterator(); iterator1.hasNext();) {
        hasExcludes = true;
        String exclude = (String) iterator1.next();
        fastMatchInfo = looksLikeStartsWith(exclude);
        if (fastMatchInfo != null) {
          excludeStartsWith.add(fastMatchInfo);
        } else if ((fastMatchInfo = looksLikeStarDotDotStarExclude(exclude)) != null) {
          excludeStarDotDotStar.add(fastMatchInfo);
        } else if ((fastMatchInfo = looksLikeExactName(exclude)) != null) {
          excludeExactName.add(exclude);
        } else if ((fastMatchInfo = looksLikeEndsWith(exclude)) != null) {
          excludeEndsWith.add(fastMatchInfo);
        } else if (exclude
            .equals("org.codehaus.groovy..* && !org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController*")) {
          // TODO need a more sophisticated analysis here, to allow for similar situations
          excludeSpecial.add(new String[] { "org.codehaus.groovy.",
              "org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController" });
          // for the related test:
          // } else if (exclude.equals("testdata..* && !testdata.sub.Oran*")) {
          // excludeSpecial.add(new String[] { "testdata.", "testdata.sub.Oran" });
        } else {
          TypePattern excludePattern = new PatternParser(exclude).parseTypePattern();
          excludeTypePattern.add(excludePattern);
        }
      }
    }
  }
View Full Code Here

Examples of org.aspectj.weaver.patterns.PatternParser

  private void registerDump(final BcelWeaver weaver, final ClassLoader loader, final List definitions) {
    for (Iterator iterator = definitions.iterator(); iterator.hasNext();) {
      Definition definition = (Definition) iterator.next();
      for (Iterator iterator1 = definition.getDumpPatterns().iterator(); iterator1.hasNext();) {
        String dump = (String) iterator1.next();
        TypePattern pattern = new PatternParser(dump).parseTypePattern();
        m_dumpTypePattern.add(pattern);
      }
      if (definition.shouldDumpBefore()) {
        m_dumpBefore = true;
      }
View Full Code Here

Examples of org.aspectj.weaver.patterns.PatternParser

    AnnotationGen aspect = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREPRECEDENCE_ANNOTATION);
    if (aspect != null) {
      NameValuePair precedence = getAnnotationElement(aspect, VALUE);
      if (precedence != null) {
        String precedencePattern = precedence.getValue().stringifyValue();
        PatternParser parser = new PatternParser(precedencePattern);
        DeclarePrecedence ajPrecedence = parser.parseDominates();
        struct.ajAttributes.add(new AjAttribute.DeclareAttribute(ajPrecedence));
        return true;
      }
    }
    return false;
View Full Code Here

Examples of org.aspectj.weaver.patterns.PatternParser

   * @param allowIf
   * @return pointcut, unresolved
   */
  private static Pointcut parsePointcut(String pointcutString, AjAttributeStruct struct, boolean allowIf) {
    try {
      PatternParser parser = new PatternParser(pointcutString, struct.context);
      Pointcut pointcut = parser.parsePointcut();
      parser.checkEof();
      pointcut.check(null, struct.enclosingType.getWorld());
      if (!allowIf && pointcutString.indexOf("if()") >= 0 && hasIf(pointcut)) {
        reportError("if() pointcut is not allowed at this pointcut location '" + pointcutString + "'", struct);
        return null;
      }
View Full Code Here

Examples of org.aspectj.weaver.patterns.PatternParser

   * @param location
   * @return type pattern
   */
  private static TypePattern parseTypePattern(String patternString, AjAttributeStruct location) {
    try {
      TypePattern typePattern = new PatternParser(patternString).parseTypePattern();
      typePattern.setLocation(location.context, -1, -1);// FIXME -1,-1 is
      // not good
      // enough
      return typePattern;
    } catch (ParserException e) {
View Full Code Here

Examples of org.aspectj.weaver.patterns.PatternParser

    }
  }   
 
 
  public PerClause parsePerClause(Parser parser) {
    PatternParser patternParser = new PatternParser(tokenSource);
    try {
      PerClause ret = patternParser.maybeParsePerClause();
      checkEof(parser);
      if (ret == null) return new PerSingleton();
      else return ret;
    } catch (ParserException pe) {
      reportError(parser, pe);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.