Examples of NewArrayExpression


Examples of org.codehaus.jparsec.examples.java.ast.expression.NewArrayExpression

  // new int[5]
  static Parser<Expression> newArrayWithExplicitLength(Parser<Expression> expr) {
    return new Mapper<Expression>() {
      @SuppressWarnings("unused")
      Expression map(TypeLiteral type, Expression length, List<Expression> values) {
        return new NewArrayExpression(type, length, values);
      }
    }.sequence(term("new"), TypeLiteralParser.TYPE_LITERAL,
        term("["), expr, term("]"),
        between(term("{"), expr.sepBy(term(",")), term("}")).optional());
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.java.ast.expression.NewArrayExpression

  // new int[] {...}
  static Parser<Expression> newArrayWithoutExplicitLength(Parser<Expression> expr) {
    return new Mapper<Expression>() {
      @SuppressWarnings("unused")
      Expression map(ArrayTypeLiteral type, List<Expression> values) {
        return new NewArrayExpression(type.elementType, null, values);
      }
    }.sequence(term("new"), TypeLiteralParser.ARRAY_TYPE_LITERAL,
        term("{"), expr.sepBy(term(",")), term("}"));
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.java.ast.expression.NewArrayExpression

  // new int[5]
  static Parser<Expression> newArrayWithExplicitLength(Parser<Expression> expr) {
    return new Mapper<Expression>() {
      @SuppressWarnings("unused")
      Expression map(TypeLiteral type, Expression length, List<Expression> values) {
        return new NewArrayExpression(type, length, values);
      }
    }.sequence(term("new"), TypeLiteralParser.TYPE_LITERAL,
        term("["), expr, term("]"),
        between(term("{"), expr.sepBy(term(",")), term("}")).optional());
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.java.ast.expression.NewArrayExpression

  // new int[] {...}
  static Parser<Expression> newArrayWithoutExplicitLength(Parser<Expression> expr) {
    return new Mapper<Expression>() {
      @SuppressWarnings("unused")
      Expression map(ArrayTypeLiteral type, List<Expression> values) {
        return new NewArrayExpression(type.elementType, null, values);
      }
    }.sequence(term("new"), TypeLiteralParser.ARRAY_TYPE_LITERAL,
        term("{"), expr.sepBy(term(",")), term("}"));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.