Package org.eclipse.assemblyformatter.ir.lowlevel

Examples of org.eclipse.assemblyformatter.ir.lowlevel.Comment


          }
        }
      }
      break;
    case ';':
      section = new Comment(Type.A);
      section.setOffset(position);
      i = content.indexOf(lineSeparator, position);

      if (i > position) {
        position = i - 1;
        section.setEnd(i);
      } else {
        // line separator is not found
        moveFarForward();
        section.setEnd(content.length());
      }
      break;
    case '/': // similar with case ';'
      moveForward();
      if (!moveSuccess) {
        break;
      }
      if (character == '/') {
        section = new Comment(Type.CPP);
        section.setOffset(position - 1);
        i = content.indexOf(lineSeparator, position);

        if (i > position) {
          position = i - 1;
          section.setEnd(i);
        } else {
          // line separator is not found
          moveFarForward();
          section.setEnd(content.length());
        }
      } else {
        if (character == '*') {
          section = new Comment(Type.C);
          section.setOffset(position - 1);

          boolean flag = true;
          while (flag) {
            moveForward();
View Full Code Here


    int offset;
    section = base;
    while (section != null) {
      Section nextSection = section.getNextSection();
      if (section instanceof Comment) {
        Comment comment = (Comment) section;
        switch (comment.getType()) {
        case A:
          offset = comment.getOffset() + 1;
          if (document.getChar(offset) != ' ') {
            document.replace(offset, 0, " ");
          }
          break;
        case CPP:
          offset = comment.getOffset() + 2;
          if (document.getChar(offset) != ' ') {
            document.replace(offset, 0, " ");
          }
          break;
        }
View Full Code Here

        boolean stopFlag = false;
        if (section instanceof LineSeparator) {
          stopFlag = true;
        } else {
          if (section instanceof Comment) {
            Comment comment = (Comment) section;
            if ((comment.getType() == Comment.Type.A)
                || (comment.getType() == Comment.Type.CPP)) {
              stopFlag = true;
            }
          }
        }
        if (stopFlag) {
View Full Code Here

TOP

Related Classes of org.eclipse.assemblyformatter.ir.lowlevel.Comment

Copyright © 2018 www.massapicom. 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.