Package org.eclipse.php.internal.core.ast.nodes

Examples of org.eclipse.php.internal.core.ast.nodes.Statement


  public void testClassRemove() throws Exception {
    String str = "<?php $a = 5; class A { } ?>";
    String expected = "<?php $a = 5; ?>";
    parseAndCompare(str, expected, new ICodeManiplator() {
      public void manipulate(Program program) {
        Statement statement = program.statements().get(1);
        statement.delete();
      }
    });
  }
View Full Code Here


  public void testStatementBeforeClass() throws Exception {
    String str = "<?php $a = 5; class A { } ?>";
    String expected = "<?php class A { } ?>";
    parseAndCompare(str, expected, new ICodeManiplator() {
      public void manipulate(Program program) {
        Statement statement = program.statements().get(0);
        statement.delete();
      }
    });
  }
View Full Code Here

        ProjectOptions.useShortTags((IProject) null)).createAST(
        new NullProgressMonitor());

    program.initCommentMapper(document, new PhpAstLexer(reader));

    final Statement node = program.statements().get(0);
    final int extendedLength = program.getExtendedLength(node);

    assert extendedLength > node.getLength();
  }
View Full Code Here

    program.initCommentMapper(document, new PhpAstLexer(reader));

    final ClassDeclaration node = (ClassDeclaration) program.statements()
        .get(0);
    final Statement statement = node.getBody().statements().get(index);

    final int extendedLength = program.getExtendedLength(statement);

    assert extendedLength > statement.getLength();
  }
View Full Code Here

    }

    // visit the nodes
    Statement[] statements = program.getStatements();
    for (int i = 0; i < statements.length; i++) {
      Statement statement = statements[i];
      if (inNode(statement, offset)) {
        return statement;
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.ast.nodes.Statement

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.