Package org.apache.uima.ruta.ide.parser.ast

Examples of org.apache.uima.ruta.ide.parser.ast.RutaStatement


    return (CodeBlock[]) result.toArray(new CodeBlock[result.size()]);
  }

  private void checkStatement(String code, int offset, List result, Statement sst) {
    if (sst instanceof RutaStatement) {
      RutaStatement statement = (RutaStatement) sst;
      result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
              .sourceEnd() - statement.sourceStart())));

      Iterator si = statement.getExpressions().iterator();
      // while (si.hasNext()) {
      // Expression ex = (Expression) si.next();
      // if (ex instanceof BlockDeclaration) {
      // BlockDeclaration be = (BlockDeclaration) ex;
      // try {
View Full Code Here


  }

  @Override
  protected boolean initiallyCollapse(ASTNode s, FoldingStructureComputationContext ctx) {
    if (s instanceof RutaStatement) {
      RutaStatement statement = (RutaStatement) s;
      if (!(statement.getAt(0) instanceof SimpleReference)) {
        return false;
      }

      String name = null;
      name = ((SimpleReference) statement.getAt(0)).getName();
      if (name.equals("namespace")) {
        return ctx.allowCollapsing() && fInitCollapseNamespaces;
      }

      return ctx.allowCollapsing() && fInitCollapseBlocks;
View Full Code Here

    if (s instanceof TypeDeclaration) {
      return canFold("namespace");
    } else if (s instanceof MethodDeclaration) {
      return canFold("proc");
    } else if (s instanceof RutaStatement) {
      RutaStatement statement = (RutaStatement) s;
      if (!(statement.getAt(0) instanceof SimpleReference)) {
        return false;
      }

      String name = null;
      name = ((SimpleReference) statement.getAt(0)).getName();
      return canFold(name);
    }

    return false;
  }
View Full Code Here

    return (CodeBlock[]) result.toArray(new CodeBlock[result.size()]);
  }

  private void checkStatement(String code, int offset, List result, Statement sst) {
    if (sst instanceof RutaStatement) {
      RutaStatement statement = (RutaStatement) sst;
      result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
              .sourceEnd() - statement.sourceStart())));

      Iterator si = statement.getExpressions().iterator();
      // while (si.hasNext()) {
      // Expression ex = (Expression) si.next();
      // if (ex instanceof BlockDeclaration) {
      // BlockDeclaration be = (BlockDeclaration) ex;
      // try {
View Full Code Here

  }

  @Override
  protected boolean initiallyCollapse(ASTNode s, FoldingStructureComputationContext ctx) {
    if (s instanceof RutaStatement) {
      RutaStatement statement = (RutaStatement) s;
      if (!(statement.getAt(0) instanceof SimpleReference)) {
        return false;
      }

      String name = null;
      name = ((SimpleReference) statement.getAt(0)).getName();
      if (name.equals("namespace")) {
        return ctx.allowCollapsing() && fInitCollapseNamespaces;
      }

      return ctx.allowCollapsing() && fInitCollapseBlocks;
View Full Code Here

    if (s instanceof TypeDeclaration) {
      return canFold("namespace");
    } else if (s instanceof MethodDeclaration) {
      return canFold("proc");
    } else if (s instanceof RutaStatement) {
      RutaStatement statement = (RutaStatement) s;
      if (!(statement.getAt(0) instanceof SimpleReference)) {
        return false;
      }

      String name = null;
      name = ((SimpleReference) statement.getAt(0)).getName();
      return canFold(name);
    }

    return false;
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.ruta.ide.parser.ast.RutaStatement

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.