Package org.nutz.el.opt.arithmetic

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


   */
  private Object parseItem(Object item){
    //左括号
    if(item instanceof LBracketOpt){
      if(prev instanceof IdentifierObj){
        item = new Object[]{new MethodOpt(), new LBracketOpt()};
        bracket.addFirst(BracketType.Method);
      }else {
        bracket.addFirst(BracketType.Default);
      }
    }
View Full Code Here


    case '%':
      exp.poll();
      return new ModOpt();
    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 LBracketOpt) {
            if (prev instanceof Elobj) {
                MethodOpt prem = new MethodOpt();
                item = new Object[]{prem, new LBracketOpt()};
                methods.addFirst(prem);
            } else {
                methods.addFirst(null);
            }
        }
View Full Code Here

        case '%':
            exp.poll();
            return new ModOpt();
        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.LBracketOpt

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.