Package lombok.ast

Examples of lombok.ast.Position


 
  public boolean logBlockComment(String text) {
    if (text.startsWith("/*")) text = text.substring(2);
    if (text.endsWith("*/")) text = text.substring(0, text.length() - 2);
    Comment c = new Comment().astBlockComment(true).astContent(text);
    c.setPosition(new Position(startPos(), currentPos()));
    source.registerComment(getContext(), c);
    return true;
  }
View Full Code Here


  }
 
  public boolean logLineComment(String text) {
    if (text.startsWith("//")) text = text.substring(2);
    Comment c = new Comment().astBlockComment(false).astContent(text);
    c.setPosition(new Position(startPos(), currentPos()));
    source.registerComment(getContext(), c);
    return true;
  }
View Full Code Here

        result.rawTypeArguments().addToEnd(arg);
      }
    }
   
    posify(result); //We only care about the end position here.
    return result.setPosition(new Position(identifier.getStartIndex(), result.getPosition().getEnd()));
  }
View Full Code Here

      source.registerStructure(e, pNode);
    }
    if (dimClosed != null) for (org.parboiled.Node<Node> pNode : dimClosed) {
      source.registerStructure(e, pNode);
    }
    if (name != null) e.setPosition(new Position(name.getPosition().getStart(), currentPos()));
    VariableDefinition decl = new VariableDefinition().rawTypeReference(type);
    if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
    if (varargs != null && !varargs.trim().isEmpty()) decl.astVarargs(true);
    decl.rawVariables().addToEnd(e);
    return posify(decl);
View Full Code Here

  }
 
  public Node createAnnotationDeclaration(Node modifiers, Node name, List<Node> members, org.parboiled.Node<Node> typeOpen, org.parboiled.Node<Node> typeClose) {
    Node typeBody = createNormalTypeBody(members);
    if (typeOpen != null && typeClose != null) {
      typeBody.setPosition(new Position(typeOpen.getStartIndex(), typeClose.getEndIndex()));
    }
    AnnotationDeclaration decl = new AnnotationDeclaration().astName(createIdentifierIfNeeded(name, currentPos())).rawBody(typeBody);
    if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
    return posify(decl);
  }
View Full Code Here

    @NonNull
    @Override
    public Location getLocation(
            @NonNull JavaContext context,
            @NonNull Node node) {
        Position position = node.getPosition();
        return Location.create(context.file, context.getContents(),
                position.getStart(), position.getEnd());
    }
View Full Code Here

        }

        @NonNull
        @Override
        public Location resolve() {
            Position pos = mNode.getPosition();
            return Location.create(mFile, null /*contents*/, pos.getStart(), pos.getEnd());
        }
View Full Code Here

    result = List.of(actualValue);
    return true;
  }
 
  private void posParen(Node node, int iteration, java.util.List<Position> parenPositions, JCTree jcTree) {
    Position p = null;
    if (parenPositions.size() > iteration) p = parenPositions.get(iteration);
    int start = (p == null || p.isUnplaced() || p.getStart() < 0) ? node.getPosition().getStart() - 1 - iteration : p.getStart();
    int end = (p == null || p.isUnplaced() || p.getEnd() < 0) ? node.getPosition().getEnd() + 1 + iteration : p.getEnd();
    setPos(start, end, jcTree);
  }
View Full Code Here

    id.setPosition(pos);
    return id;
  }
 
  private Position toPosition(int start, int end) {
    return new Position(start, end + 1);
  }
View Full Code Here

  private Position toPosition(int start, int end) {
    return new Position(start, end + 1);
  }
 
  private Position toPosition(long pos) {
    return new Position((int) (pos >> 32), (int) (pos & 0xFFFFFFFFL) + 1);
  }
View Full Code Here

TOP

Related Classes of lombok.ast.Position

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.