Examples of OORexxDirective


Examples of org.oorexx.language.OORexxDirective

      OORexxPackage container = new OORexxPackage();
        container.setFile(file);
        container.setName(file.getName());
       
        for(String key: map.keySet()){
          OORexxDirective commentAble = map.get(key);
          container.appendCommentAble(commentAble);
        }
       
      this.containers.add(container);
    }
View Full Code Here

Examples of org.oorexx.language.OORexxDirective

   
    ArrayList<String> content = new ArrayList<String>();


   
    OORexxDirective previousClass = null;
    int directiveStartIndex = 0;
   
    for(int i = 0; i < contentLines.length ; i++){
      String contentLine = contentLines[i].trim();
     
   
      for(String directive: keywordBean.getDirectiveKeywords())
        if(contentLine.toLowerCase().startsWith(directive + " ")){
          currentDirective = directive;
          content = new ArrayList<String>();
          directiveStartIndex = i;
        }
     
      if(!currentDirective.equals(""))
        content.add(contentLine);
     
      if(!currentDirective.equals("") && isDirectiveFinished(contentLines, i) && content.size() > 0){
        OORexxDirective commentAble = StringToDirectiveParser.parse(currentDirective, content, getNearestClassComment(directiveStartIndex), packageFile);
       
       
       
        content = new ArrayList<String>();
       
        if(commentAble instanceof OORexxClass){
          previousClass = commentAble;
        }
       
        if(commentAble instanceof OORexxRoutine || commentAble instanceof OORexxOptions
            || commentAble instanceof OORexxRequires)
          previousClass = null;
       
        if(previousClass != null && (commentAble instanceof OORexxMethod || commentAble instanceof OORexxAttribute || commentAble instanceof OORexxConstant)){
          OORexxClass clazz = (OORexxClass) this.directiveMap.get(previousClass.getName());
            if(commentAble instanceof OORexxMethod && commentAble.getName().toLowerCase().equals("init"))
              clazz.setInit((OORexxMethod)commentAble);
            if(commentAble instanceof OORexxMethod && !commentAble.getName().toLowerCase().equals("init"))
              clazz.appendMethod((OORexxMethod)commentAble);
            if(commentAble instanceof OORexxAttribute)
              clazz.appendAttribute((OORexxAttribute) commentAble)
            if(commentAble instanceof OORexxConstant)
              clazz.appendConstant((OORexxConstant) commentAble);
           
             
         
          Collections.sort(clazz.getMethods());
          Collections.sort(clazz.getAttributes());
          Collections.sort(clazz.getConstants());
         
          this.directiveMap.put(previousClass.getName(), clazz);
        }
       
        if(previousClass == null || commentAble instanceof OORexxClass){
         
          directiveMap.put(commentAble.getName(), commentAble);
        }
       
        currentDirective = "";
      }
       
View Full Code Here

Examples of org.oorexx.language.OORexxDirective

 
  public Map<String, OORexxDirective> getDirectiveMap(){
    parse();
   
    for(String name: directiveMap.keySet()){
      OORexxDirective commentAble =  directiveMap.get(name);
        if(commentAble instanceof OORexxClass){
          for(OORexxMethod method: ((OORexxClass) commentAble).getMethods()){
            method.setParent(commentAble);
          }
          for(OORexxAttribute attribute: ((OORexxClass) commentAble).getAttributes()){
View Full Code Here

Examples of org.oorexx.language.OORexxDirective

    return false;
  }
 
  public static OORexxDirective parse(String directive, List<String> content, List<String> comment, File packageFile){
   
    OORexxDirective commentAble = null;
   
    directive = directive.toLowerCase();
   
    if(directive.equals("::class"))
      commentAble = LineToOORexxClass.convert(content.get(0));
   
    if(directive.equals("::attribute"))
      commentAble = LineToOORexxAttribute.convert(content.get(0));
   
    if(directive.equals("::method"))
      commentAble = LinesToOORexxMethod.convert(content);
   
    if(directive.equals("::routine"))
      commentAble =  LinesToOORexxRoutine.convert(content);
   
    if(directive.equals("::requires"))
      commentAble = LineToOORexxRequires.convert(content.get(0));
   
    if(directive.equals("::constant"))
      commentAble = LineToOORexxConstant.convert(content.get(0));
   
    if(directive.equals("::options"))
      commentAble = LineToOORexxOptions.convert(content.get(0));
   
    if(comment.size() > 0)
      commentAble.setComment(OORexxCommentConverter.parse(new OORexxDescriptionComment(comment)));
   
    commentAble.setFile(packageFile);
   
    return commentAble;
  }
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.