Parser rule for parsing a power.
<p>
A power is an <tt>atom</tt> which might be followed by ^ or ** as operator and another <tt>power</tt>.

@return a power parsed from the given input
516216
protected Expression power() {
        Expression left = atom();
        if (tokenizer.current().isSymbol("^") || tokenizer.current().isSymbol("**")) {
            tokenizer.consume();
            Expression right = power();
            return reOrder(left, right, BinaryOperation.Op.POWER);
        }
        return left;
    }
1005850
protected ParserRuleContext getParentSourceElement(ParserRuleContext node) {
        if (node == null) return null;
        ParserRuleContext parent = node.getParent();
        if (parent instanceof QueryParser.SourceElementContext) {
            return parent;
        }
        return getParentSourceElement(parent);
    }
450513
void parseBlock( FormattableContainer currentRule ) {
        Operation expr = null;
        String name = null;
        Expression guard = null;
        StringBuilder builder = cachesBuilder;
        boolean wasWhite = false;
        for( ;; ) {
            char ch = reader.read();
            switch( ch ) {
                case '{':
                    String selector;
                    if( name == null ) {
                        selector = trim( builder );
                    } else {
                        selector = name;
                        name = null;
                        throwUnrecognizedInputIfAny( builder, ch );
                    }
                    if( selector.endsWith( "@" ) ) { // selector with variable name like abc@{foo}abc
                        builder.append( selector );
                        builder.append( ch );
                        break;
                    }
                    if( selector.contains( ":extend(" ) ) {
                        selector = LessExtend.addLessExtendsTo( currentRule, reader, selector );
                    }
                    Rule rule = rule( currentRule, selector, expr, guard );
                    currentRule.add( rule );
                    expr = null;
                    guard = null;
                    String[] selectors = rule.getSelectors();
                    for( String sel : selectors ) {
                        currentRule.getMixins().add( sel.trim(), rule );
                    }
                    return;
                case '/':
                    if( !comment( isWhitespace( builder ) ? currentRule : null ) ) {
                        builder.append( ch );
                    }
                    wasWhite = false;
                    break;
                case '\"':
                case '\'':
                    readQuote( ch, builder );
                    wasWhite = false;
                    break;
                case '(':
                    String cmd;
                    if( name == null ) {
                        int idx = builder.lastIndexOf( " when" );
                        if( idx < 0 || (idx + 5 != builder.length() && builder.indexOf( " when " ) < 0) ) {
                            if( isSelector( builder ) || !reader.nextIsMixinParam( true ) ) {
                                builder.append( ch );
                                break;
                            }
                        }
                        name = trim( builder );
                        if( idx < 0 ) {
                            expr = parseParameterList();
                            break;
                        } else {
                            cmd = name.substring( idx + 1 );
                            name = name.substring( 0, idx );
                        }
                    } else {
                        cmd = trim( builder );
                    }
                    char operator;
                    boolean isNot = false;
                    switch( cmd ) {
                        case "when not":
                            isNot = true;
                            //$FALL-THROUGH$
                        case "when":
                            operator = 0;
                            break;
                        case "and not":
                            isNot = true;
                            //$FALL-THROUGH$
                        case "and":
                            operator = '&';
                            break;
                        case ",not":
                        case ", not":
                            isNot = true;
                            //$FALL-THROUGH$
                        case ",":
                            operator = '|';
                            break;
                        default:
                            throw createException( "Unrecognized input: '" + cmd + "'" );
                    }
                    Expression right = parseExpression( (char)0 );
                    ch = read();
                    if( ch != ')' ) {
                        throw createException( "Unrecognized input: '" + ch + "'" );
                    }
                    if( isNot ) {
                        right = new Operation( reader, right, '!' );
                    }
                    guard = ( operator == 0 ) ? right : concat( guard, operator, right );
                    break;
                default:
                    boolean isWhite = Character.isWhitespace( ch );
                    if( isWhite ) {
                        if( builder.length() == 0 ) {
                            break;
                        }
                        if( wasWhite ) {
                            break;
                        } else {
                            builder.append( ' ' );
                            wasWhite = true;
                        }
                    } else {
                        builder.append( ch );
                        wasWhite = false;
                    }
            }
        }
    }
695095
private ExprKraken parseSelectExpr()
  {
    Token token = scanToken();

    if (token == Token.STAR) {
      // return new UnboundStarExpr();
      
      throw new UnsupportedOperationException(getClass().getName());
    }
    else {
      _token = token;

      return parseExpr();
    }
  }
1283670
@Pure
	public static double operator_power(Double a, Number b) {
		return Math.pow(a, b.doubleValue());
	}
942415
protected static boolean isOperatorLR( Symbol s ) {
        if( s == null )
            return false;

        switch( s ) {
            case ELEMENT_DIVIDE:
            case ELEMENT_TIMES:
            case ELEMENT_POWER:
            case RDIVIDE:
            case LDIVIDE:
            case TIMES:
            case POWER:
            case PLUS:
            case MINUS:
            case ASSIGN:
                return true;
        }
        return false;
    }
306072
public static final Parser<Double> instance() { // NOPMD it's thread save!
    if (PercentDoubleParser.instanceParser == null) {
      synchronized (PercentDoubleParser.class) {
        if (PercentDoubleParser.instanceParser == null) {
          PercentDoubleParser.instanceParser = new PercentDoubleParser();
        }
      }
    }
    return PercentDoubleParser.instanceParser;
  }
252368
public <T> T parse(String input, Class<T> clazz) {
		try {
			if (String.class.equals(clazz)) {
				return (T) input;
			}

			StringParser<T> parser = getParser(clazz, input);
			if (parser == null) {
				throw new ParserException(String.format("Cannot parse to %s : %s", clazz.getName(), input));
			}

			return parser.parse(input);
		}
		catch (NumberFormatException e) {
			throw new ParserException(e.getMessage());
		}
	}
947848
private ParseTree parseUnaryExpression() {
    SourcePosition start = getTreeStartLocation();
    if (peekUnaryOperator()) {
      Token operator = nextToken();
      ParseTree operand = parseUnaryExpression();
      return new UnaryExpressionTree(getTreeLocation(start), operator, operand);
    } else if (peekAwaitExpression()) {
      return parseAwaitExpression();
    } else {
      return parseUpdateExpression();
    }
  }
230145
public void setPower(int power)
    {
        if (power < -128 || 127 < power)
        {
            throw new IllegalArgumentException("'power' is out of the valid range: " + power);
        }

        mPower = power;

        getData()[POWER_INDEX] = (byte)power;
    }
1234082
public final Parser<Token> token() {
    return new Parser<Token>() {
      @Override boolean apply(ParseContext ctxt) {
        int begin = ctxt.getIndex();
        if (!Parser.this.apply(ctxt)) {
          return false;
        }
        int len = ctxt.getIndex() - begin;
        Token token = new Token(begin, len, ctxt.result);
        ctxt.result = token;
        return true;
      }
      @Override public String toString() {
        return Parser.this.toString();
      }
    };
  }
590898
public Object parseValue() {
    Object val;
    switch(T.getType()) {
      case LCURLY:
        val = parseObject();
        break;
      case LSQUARE:
        val = parseArray();
        break;
      case INTEGER:
        if(useBig) {
          val = new BigInteger(T.getString());
        } else {
          try {
            val = Integer.parseInt(T.getString());
          } catch(NumberFormatException e0) {
            // we have an overflow, the tokenizer guarantees the format is correct
            try {
              val = Long.parseLong(T.getString());
            } catch(NumberFormatException e1) {
              val = 0;
            }
          }
        }
        advance();
        break;
      case DOUBLE:
        if(useBig) {
          val = new BigDecimal(T.getString());
        } else {
          val = Double.parseDouble(T.getString());
        }
        advance();
        break;
      case STRING:
        val = T.getString();
        advance();
        break;
      case TRUE:
        val = true;
        advance();
        break;
      case FALSE:
        val = false;
        advance();
        break;
      case NULL:
        val = null;
        advance();
        break;
      default:
        val = null;
        addError();
    }
    return val;
  }
1093907
public static Expression power(Number value1, Number value2) {
        return power(x(value1), x(value2));
    }
1261761
@Override
    public Object parse(IGroup group, JsonRuleParser parser) {
        StringBuffer operate = new StringBuffer();

        // NOT
        if (group.getNot() != null && group.getNot()) {
            operate.append("( NOT ");
        }

        if (group.getRules().size() > 0) {
            operate.append("( ");
        }

        // rules
        List<Object> params = new ArrayList<Object>();
        for (int i = 0; i < group.getRules().size(); i++) {
            // json parse
            Operation operation = (Operation) parser.parse(group.getRules().get(i));

            // operate
            operate.append(operation.getOperate());
            if (i < group.getRules().size() - 1) {
                operate.append(EnumCondition.AND.equals(group.getCondition()) ? " AND " : " OR ");
            }
            // params
            if (operation.getHasValue()) {
                if (operation.getValue() instanceof List) {
                    params.addAll((Collection<?>) operation.getValue());
                } else {
                    params.add(operation.getValue());
                }
            }
        }

        if (group.getRules().size() > 0) {
            operate.append(" )");
        }
        if (group.getNot() != null && group.getNot()) {
            operate.append(" )");
        }

        return new Operation(operate, params);
    }
129736
public static Parse parseParse(final String parse, final GapLabeler gl) {
    final StringBuilder text = new StringBuilder();
    int offset = 0;
    final Stack<Constituent> stack = new Stack<Constituent>();
    final List<Constituent> cons = new LinkedList<Constituent>();
    for (int ci = 0, cl = parse.length(); ci < cl; ci++) {
      final char c = parse.charAt(ci);
      if (c == '(') {
        final String rest = parse.substring(ci + 1);
        final String type = getType(rest);
        if (type == null) {
          System.err.println("null type for: " + rest);
        }
        final String token = getToken(rest);
        stack.push(new Constituent(type, new Span(offset, offset)));
        if (token != null) {
          if (type.equals("-NONE-") && gl != null) {
            // System.err.println("stack.size="+stack.size());
            gl.labelGaps(stack);
          } else {
            cons.add(new Constituent(ShiftReduceParser.TOK_NODE,
                new Span(offset, offset + token.length())));
            text.append(token).append(" ");
            offset += token.length() + 1;
          }
        }
      } else if (c == ')') {
        final Constituent con = stack.pop();
        final int start = con.getSpan().getStart();
        if (start < offset) {
          cons.add(
              new Constituent(con.getLabel(), new Span(start, offset - 1)));
        }
      }
    }
    final String txt = text.toString();
    int tokenIndex = -1;
    final Parse p = new Parse(txt, new Span(0, txt.length()),
        ShiftReduceParser.TOP_NODE, 1, 0);
    for (int ci = 0; ci < cons.size(); ci++) {
      final Constituent con = cons.get(ci);
      final String type = con.getLabel();
      if (!type.equals(ShiftReduceParser.TOP_NODE)) {
        if (type == ShiftReduceParser.TOK_NODE) {
          tokenIndex++;
        }
        final Parse c = new Parse(txt, con.getSpan(), type, 1, tokenIndex);
        // System.err.println("insert["+ci+"] "+type+" "+c.toString()+"
        // "+c.hashCode());
        p.insert(c);
        // codeTree(p);
      }
    }
    return p;
  }
554204
def power(attrs, inputs, proto_obj):
    """"""
    new_attrs = translation_utils._fix_attribute_names(attrs, {'exponent':'exp'})
    if 'broadcast' in attrs:
        new_attrs = translation_utils._remove_attributes(new_attrs, ['broadcast'])
        if attrs['broadcast'] == 1:
            return 'broadcast_power', new_attrs, inputs
        else:
            mxnet_op = symbol.pow(inputs[0], inputs[1])
            return mxnet_op, new_attrs, inputs
    mxnet_op = symbol.broadcast_power(inputs[0], inputs[1])
    return mxnet_op, new_attrs, inputs
843570
private ParseTree parseReturnStatement() {
    SourcePosition start = getTreeStartLocation();
    eat(TokenType.RETURN);
    ParseTree expression = null;
    if (!peekImplicitSemiColon()) {
      expression = parseExpression();
    }
    eatPossibleImplicitSemiColon();
    return new ReturnStatementTree(getTreeLocation(start), expression);
  }