Examples of UnaryOperator


Examples of operators.UnaryOperator

  public NonGroundLiteral parse(TokenState st) throws ParseException {
    TokenParser nafSym = new TokenParser(Token.Type.NAF);
    TokenParser negSym = new TokenParser(Token.Type.NEG);
    boolean naf = false;
    boolean neg = false;
    UnaryOperator negOp = null;
    if(nafSym.tryParse(st)) {
      naf = true;
      Token negOpTok = st.getNext();
      if(!negOpTok.getType().equals(Token.Type.SYMBOL))
        throw new ParseException(negOpTok.getLocation(),"naf operator",negOpTok.toString());
View Full Code Here

Examples of org.apache.taglibs.standard.lang.jstl.UnaryOperator

    throw new Error("Missing return statement in function");
  }

  final public Expression UnaryExpression() throws ParseException {
  Expression expression;
  UnaryOperator singleOperator = null;
  UnaryOperator operator;
  List operators = null;
    label_8:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MINUS:
View Full Code Here

Examples of org.apache.taglibs.standard.lang.jstl.UnaryOperator

    throw new Error("Missing return statement in function");
  }

  final public Expression UnaryExpression() throws ParseException {
  Expression expression;
  UnaryOperator singleOperator = null;
  UnaryOperator operator;
  List operators = null;
    label_8:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MINUS:
View Full Code Here

Examples of org.apache.taglibs.standard.lang.jstl.UnaryOperator

    throw new Error("Missing return statement in function");
  }

  final public Expression UnaryExpression() throws ParseException {
  Expression expression;
  UnaryOperator singleOperator = null;
  UnaryOperator operator;
  List operators = null;
    label_8:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MINUS:
View Full Code Here

Examples of org.apache.taglibs.standard.lang.jstl.UnaryOperator

    throw new Error("Missing return statement in function");
  }

  final public Expression UnaryExpression() throws ParseException {
  Expression expression;
  UnaryOperator singleOperator = null;
  UnaryOperator operator;
  List operators = null;
    label_8:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MINUS:
View Full Code Here

Examples of org.apache.taglibs.standard.lang.jstl.UnaryOperator

    throw new Error("Missing return statement in function");
  }

  final public Expression UnaryExpression() throws ParseException {
  Expression expression;
  UnaryOperator singleOperator = null;
  UnaryOperator operator;
  List operators = null;
    label_8:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MINUS:
View Full Code Here

Examples of org.eclipse.jst.jsf.validation.internal.el.operators.UnaryOperator

            final Token  firstToken = node.getFirstToken();
            if (UnaryOperator.isUnaryOperator(firstToken))
            {
                if (type instanceof ValueType)
                {
                    final UnaryOperator unaryOp = UnaryOperator.createUnaryOperator(firstToken, _diagnosticFactory);
                    final Diagnostic diagnostic = unaryOp.validate((ValueType)type);

                    if (diagnostic.getSeverity() != Diagnostic.OK)
                    {
                        final int offset = _context.getDocumentPosition() + firstToken.beginColumn - 1;
                        final int length = node.getLastToken().endColumn - firstToken.beginColumn+1;
                        _reporter.report(diagnostic, offset, length);
                    }

                    ((EvaluationTracker)data).
                    setType(unaryOp.performOperation ((ValueType)type));
                }
                // cannot apply operations to method bindings
                else
                {
                    final int offset = _context.getDocumentPosition() +
View Full Code Here

Examples of org.stjs.generator.javascript.UnaryOperator

public class DefaultUnaryTemplate<JS> implements WriterContributor<UnaryTree, JS> {

  @Override
  public JS visit(WriterVisitor<JS> visitor, UnaryTree tree, GenerationContext<JS> context) {
    JS operand = visitor.scan(tree.getExpression(), context);
    UnaryOperator op = UnaryOperator.valueOf(tree.getKind());
    assert op != null : "Unknow operator:" + tree.getKind();

    return context.js().unary(op, operand);
  }
View Full Code Here

Examples of org.stjs.generator.javascript.UnaryOperator

    }
    return null;
  }

  protected JS doVisit(WriterVisitor<JS> visitor, UnaryTree tree, GenerationContext<JS> context, boolean global) {
    UnaryOperator op = UnaryOperator.valueOf(tree.getKind());
    assert op != null : "Unknow operator:" + tree.getKind();

    BinaryOperator binaryOp = getBinaryOperator(op);

    if (binaryOp == null) {
      return super.visit(visitor, tree, context);
    }

    JS operand = visitor.scan(tree.getExpression(), context);
    TreeWrapper<ExpressionTree, JS> twOperand = context.getCurrentWrapper().child(tree.getExpression());
    JS target = SetterAssignmentTemplate.getTarget(visitor, twOperand, context);
    JS field = SetterAssignmentTemplate.getField(twOperand, context);

    JS value = context.js().binary(binaryOp, Arrays.asList(operand, context.js().number(1)));

    List<JS> arguments = new ArrayList<JS>();
    arguments.add(field);
    arguments.add(value);
    if (op.isPostfix()) {
      arguments.add(context.js().keyword(Keyword.TRUE));
    }

    if (global) {
      arguments.add(0, target);
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.