Package org.nutz.el.opt.arithmetic

Examples of org.nutz.el.opt.arithmetic.RBracketOpt


    }
    //右括号
    if(item instanceof RBracketOpt){
      switch(bracket.poll()){
      case Method:
        item = new Object[]{new RBracketOpt(),new InvokeMethodOpt()};
      }
    }
    //转换负号'-'
    if(item instanceof SubOpt && NegativeOpt.isNegetive(prev)){
      item = new NegativeOpt();
View Full Code Here


    case '(':
      exp.poll();
      return new LBracketOpt();
    case ')':
      exp.poll();
      return new RBracketOpt();
    case '>':
      exp.poll();
      switch(exp.peek()){
      case '=':
        exp.poll();
        return new GTEOpt();
      case '>':
        exp.poll();
        if(exp.peek() == '>'){
          exp.poll();
          return new UnsignedLeftShift();
        }
        return new RightShift();
      }
      return new GTOpt();
    case '<':
      exp.poll();
      switch(exp.peek()){
      case '=':
        exp.poll();
        return new LTEOpt();
      case '<':
        exp.poll();
        return new LeftShift();
      }
      return new LTOpt();
    case '=':
      exp.poll();
      switch(exp.peek()){
      case '=':
        exp.poll();
        return new EQOpt();
      }
      throw new ElException("表达式错误,请检查'='后是否有非法字符!");
    case '!':
      exp.poll();
      switch(exp.peek()){
      case '=':
        exp.poll();
        return new NEQOpt();
      }
      return new NotOpt();
    case '|':
      exp.poll();
      switch(exp.peek()){
      case '|':
        exp.poll();
        return new OrOpt();
      }
      return new BitOr();
    case '&':
      exp.poll();
      switch(exp.peek()){
      case '&':
        exp.poll();
        return new AndOpt();
      }
      return new BitAnd();
    case '~':
      exp.poll();
      return new BitNot();
    case '^':
      exp.poll();
      return new BitXro();
    case '?':
      exp.poll();
      return new QuestionOpt();
    case ':':
      exp.poll();
      return new QuestionSelectOpt();
   
    case '.':
      if(!Character.isJavaIdentifierStart(exp.peek(1))){
        return null;
      }
      exp.poll();
      return new AccessOpt();
    case ',':
      exp.poll();
      return new CommaOpt();
    case '[':
      exp.poll();
      return new Object[]{new ArrayOpt(),new LBracketOpt()};
    case ']':
      exp.poll();
      return new Object[]{new RBracketOpt(), new FetchArrayOpt()};
    }
    return null;
  }
View Full Code Here

        }

        // 右括号
        if (item instanceof RBracketOpt) {
            if (methods.poll() != null) {
                item = new Object[]{new RBracketOpt(), new InvokeMethodOpt()};
            }
        }
        // 转换负号'-'
        if (item instanceof SubOpt && NegativeOpt.isNegetive(prev)) {
            item = new NegativeOpt();
View Full Code Here

        case '(':
            exp.poll();
            return new LBracketOpt();
        case ')':
            exp.poll();
            return new RBracketOpt();
        case '>':
            exp.poll();
            switch(exp.peek()){
            case '=':
                exp.poll();
                return new GTEOpt();
            case '>':
                exp.poll();
                if(exp.peek() == '>'){
                    exp.poll();
                    return new UnsignedLeftShift();
                }
                return new RightShift();
            }
            return new GTOpt();
        case '<':
            exp.poll();
            switch(exp.peek()){
            case '=':
                exp.poll();
                return new LTEOpt();
            case '<':
                exp.poll();
                return new LeftShift();
            }
            return new LTOpt();
        case '=':
            exp.poll();
            switch(exp.peek()){
            case '=':
                exp.poll();
                return new EQOpt();
            }
            throw new ElException("表达式错误,请检查'='后是否有非法字符!");
        case '!':
            exp.poll();
            switch(exp.peek()){
            case '=':
                exp.poll();
                return new NEQOpt();
            }
            return new NotOpt();
        case '|':
            exp.poll();
            switch(exp.peek()){
            case '|':
                exp.poll();
                return new OrOpt();
            }
            return new BitOr();
        case '&':
            exp.poll();
            switch(exp.peek()){
            case '&':
                exp.poll();
                return new AndOpt();
            }
            return new BitAnd();
        case '~':
            exp.poll();
            return new BitNot();
        case '^':
            exp.poll();
            return new BitXro();
        case '?':
            exp.poll();
            return new QuestionOpt();
        case ':':
            exp.poll();
            return new QuestionSelectOpt();
       
        case '.':
            if(!Character.isJavaIdentifierStart(exp.peek(1))){
                return nullobj;
            }
            exp.poll();
            return new AccessOpt();
        case ',':
            exp.poll();
            return new CommaOpt();
        case '[':
            exp.poll();
            return new Object[]{new ArrayOpt(),new LBracketOpt()};
        case ']':
            exp.poll();
            return new Object[]{new RBracketOpt(), new FetchArrayOpt()};
        }
        return nullobj;
    }
View Full Code Here

TOP

Related Classes of org.nutz.el.opt.arithmetic.RBracketOpt

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.