Package lombok.ast

Examples of lombok.ast.Node


   
    if (!source.getProblems().isEmpty()) {
      fail(source.getProblems().get(0).toString());
    }
   
    Node node = source.getNodes().get(0);
    node.accept(new SyntacticValidityVisitor(true));
    node.accept(new ForwardingAstVisitor() {
      @Override public boolean visitNode(Node node) {
        for (Message m : node.getMessages()) if (m.isError()) {
          fail(String.format("Source: %s[%s]: %s: %s\n", source.getName(), node.getPosition(), node, m.getMessage()));
         
        }
        return false;
      }
    });
View Full Code Here


   
    if (!source.getProblems().isEmpty()) {
      fail(source.getProblems().get(0).toString());
    }
   
    Node node = source.getNodes().get(0);
    TextFormatter formatter = new TextFormatter();
    node.accept(new SourcePrinter(formatter));
    String actual = fixLineEndings(formatter.finish());
    String original = fixLineEndings(source.getRawInput());
    try {
      assertEquals(original, actual);
    } catch (AssertionError e) {
View Full Code Here

   
    if (cud.hasErrors()) return null;
   
    EcjTreeConverter converter = new EcjTreeConverter();
    converter.visit(source.getRawInput(), cud);
    Node lombokized = converter.get();
   
    EcjTreeBuilder builder = new EcjTreeBuilder(source.getRawInput(), source.getName(), ecjCompilerOptions());
    builder.visit(lombokized);
    return builder.get();
  }
View Full Code Here

      @Override public boolean visitVariableDefinition(VariableDefinition node) {
       
        if (node.astVariables().size() == 1) {
          return true;
        }
        Node parent = node.getParent();
        if (!(parent instanceof VariableDeclaration || parent instanceof For)) {
          return true;
        }
       
        if (parent instanceof VariableDeclaration) {
          splitVariableDeclaration((VariableDeclaration)parent);
        }
       
        if (parent instanceof For) {
          splitFor((For)parent, node);
        }
        return true;
      }
     
      private void splitVariableDeclaration(VariableDeclaration varDecl) {
        VariableDefinition varDef = varDecl.astDefinition();
        Node upFromDecl = varDecl.getParent();
        if (!(upFromDecl instanceof Block || upFromDecl instanceof TypeBody)) {
          return;
        }
       
        for (VariableDefinitionEntry varDefEntry : varDef.astVariables()) {
View Full Code Here

   
    if (!actual.getProblems().isEmpty()) {
      fail(actual.getProblems().get(0).toString());
    }
   
    Node node = actual.getNodes().get(0);
    TextFormatter formatter = new TextFormatter();
    node.accept(new SourcePrinter(formatter));
    String actualString = formatter.finish();
   
    assertEquals(fixLineEndings(expected), fixLineEndings(actualString));
  }
View Full Code Here

TOP

Related Classes of lombok.ast.Node

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.