org.parboiled.support.ValueStack.push()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中org.parboiled.support.ValueStack.push()方法的一些代码示例,展示了ValueStack.push()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ValueStack.push()方法的具体详情如下:
包路径:org.parboiled.support.ValueStack
类名称:ValueStack
方法名:push

ValueStack.push介绍

[英]Inserts the given value a given number of elements below the current top of the stack.
[中]将给定值插入堆栈当前顶部以下给定数量的元素。

代码示例

代码示例来源:origin: immutables/immutables

@Override
public final boolean run(Context<Object> context) {
 B builder = builder();
 context.getValueStack().push(builder);
 return true;
}

代码示例来源:origin: immutables/immutables

@Override
 public final boolean run(Context<Object> context) {
  Object value = get(context);
  context.getValueStack().push(value);
  return true;
 }
}

代码示例来源:origin: org.geotools/gt-css

@Override
  public boolean run(Context ctx) {
    String match = match();
    if (match.endsWith("k") || match.endsWith("M") || match.endsWith("G")) {
      match = scaleValueToString(match);
    }
    ctx.getValueStack().push(new Value.Literal(match));
    return true;
  }
});

代码示例来源:origin: org.parboiled/parboiled-java

/**
 * Pushes the given value onto the value stack. Equivalent to push(0, value).
 *
 * @param value the value to push
 * @return true
 */
public boolean push(V value) {
  check();
  context.getValueStack().push(value);
  return true;
}

代码示例来源:origin: org.immutables/trees

@Override
public final boolean run(Context<Object> context) {
 B builder = builder();
 context.getValueStack().push(builder);
 return true;
}

代码示例来源:origin: org.immutables/cases

@Override
public final boolean run(Context<Object> context) {
 B builder = builder();
 context.getValueStack().push(builder);
 return true;
}

代码示例来源:origin: org.immutables/cases

@Override
 public final boolean run(Context<Object> context) {
  Object value = get(context);
  context.getValueStack().push(value);
  return true;
 }
}

代码示例来源:origin: org.immutables/trees

@Override
 public final boolean run(Context<Object> context) {
  Object value = get(context);
  context.getValueStack().push(value);
  return true;
 }
}

代码示例来源:origin: org.parboiled/parboiled-java

/**
 * Inserts the given value a given number of elements below the current top of the value stack.
 *
 * @param down  the number of elements to skip before inserting the value (0 being equivalent to push(value))
 * @param value the value
 * @return true
 * @throws IllegalArgumentException if the stack does not contain enough elements to perform this operation
 */
public boolean push(int down, V value) {
  check();
  context.getValueStack().push(down, value);
  return true;
}

代码示例来源:origin: org.geotools/gt-css

@Override
  public boolean run(Context ctx) {
    String expression = match();
    expression = expandEnvironmentVariables(expression);
    try {
      Filter f = ECQL.toFilter(expression);
      ctx.getValueStack().push(new Data(f));
      return true;
    } catch (CQLException e) {
      throw new ParserRuntimeException(
          reportPosition(ctx) + ". " + e.getMessage(), e);
    }
  }
});

代码示例来源:origin: org.geotools/gt-css

@Override
  public boolean run(Context ctx) {
    String expression = match();
    expression = expandEnvironmentVariables(expression);
    try {
      org.opengis.filter.expression.Expression e =
          ECQL.toExpression(expression);
      ctx.getValueStack().push(new Value.Expression(e));
      return true;
    } catch (CQLException e) {
      throw new ParserRuntimeException(
          reportPosition(ctx) + ". " + e.getMessage(), e);
    }
  }
});

代码示例来源:origin: AlexFalappa/nb-springboot

@Override
public boolean run(Context<CfgElement> context) {
  if (!context.inErrorRecovery()) {
    final int start = context.getMatchStartIndex();
    final int end = context.getMatchEndIndex();
    final InputBuffer ibuf = context.getInputBuffer();
    final String value = ibuf.extract(start, end);
    ValueElement elemVal = new ValueElement(ibuf.getOriginalIndex(start), ibuf.getOriginalIndex(end), value);
    context.getValueStack().push(elemVal);
  }
  return true;
}

代码示例来源:origin: AlexFalappa/nb-springboot

@Override
public boolean run(Context<CfgElement> context) {
  if (!context.inErrorRecovery()) {
    final int start = context.getMatchStartIndex();
    final int end = context.getMatchEndIndex();
    final InputBuffer ibuf = context.getInputBuffer();
    final String key = ibuf.extract(start, end);
    KeyElement elemKey = new KeyElement(ibuf.getOriginalIndex(start), ibuf.getOriginalIndex(end), key);
    context.getValueStack().push(elemKey);
  }
  return true;
}

相关文章