gpt4 book ai didi

org.sonar.sslr.internal.vm.ZeroOrMoreExpression类的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 02:10:31 29 4
gpt4 key购买 nike

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

ZeroOrMoreExpression介绍

暂无

代码示例

代码示例来源:origin: SonarSource/sslr

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerlessGrammarBuilder#zeroOrMore(Object)} instead.
 */
@Deprecated
public static Object zeroOrMore(Object... e) {
 return new ZeroOrMoreExpression(convertToSingleExpression(e));
}

代码示例来源:origin: org.sonarsource.sslr/sslr-core

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerfulGrammarBuilder#zeroOrMore(Object)} instead.
 */
@Deprecated
public static Matcher o2n(Object... e) {
 return new ZeroOrMoreExpression(convertToSingleExpression(e));
}

代码示例来源:origin: org.codehaus.sonar.sslr/sslr-core

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerlessGrammarBuilder#zeroOrMore(Object)} instead.
 */
@Deprecated
public static Object zeroOrMore(Object... e) {
 return new ZeroOrMoreExpression(convertToSingleExpression(e));
}

代码示例来源:origin: org.sonarsource.sslr/sslr-core

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerlessGrammarBuilder#zeroOrMore(Object)} instead.
 */
@Deprecated
public static Object zeroOrMore(Object... e) {
 return new ZeroOrMoreExpression(convertToSingleExpression(e));
}

代码示例来源:origin: org.codehaus.sonar.sslr/sslr-core

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerfulGrammarBuilder#zeroOrMore(Object)} instead.
 */
@Deprecated
public static Matcher o2n(Object... e) {
 return new ZeroOrMoreExpression(convertToSingleExpression(e));
}

代码示例来源:origin: SonarSource/sslr

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerfulGrammarBuilder#zeroOrMore(Object)} instead.
 */
@Deprecated
public static Matcher o2n(Object... e) {
 return new ZeroOrMoreExpression(convertToSingleExpression(e));
}

代码示例来源:origin: SonarSource/sslr

/**
 * Creates parsing expression - "zero or more".
 * During execution of this expression parser will repeatedly try sub-expression until it fails.
 * This expression always succeeds, with an empty match if sub-expression fails.
 * <p>
 * Be aware that:
 * <ul>
 * <li>This expression is greedy, i.e. expression {@code sequence(zeroOrMore("foo"), "foo")} will never succeed.
 * <li>Sub-expression must not allow empty matches, i.e. for expression {@code zeroOrMore(optional("foo"))} parser will report infinite loop.
 * </ul>
 *
 * @param e  sub-expression
 * @throws IllegalArgumentException if given argument is not a parsing expression
 */
public final Object zeroOrMore(Object e) {
 return new ZeroOrMoreExpression(convertToExpression(e));
}

代码示例来源:origin: org.sonarsource.sslr/sslr-core

/**
 * Creates parsing expression - "zero or more".
 * During execution of this expression parser will repeatedly try sub-expression until it fails.
 * This expression always succeeds, with an empty match if sub-expression fails.
 * <p>
 * Be aware that:
 * <ul>
 * <li>This expression is greedy, i.e. expression {@code sequence(zeroOrMore("foo"), "foo")} will never succeed.
 * <li>Sub-expression must not allow empty matches, i.e. for expression {@code zeroOrMore(optional("foo"))} parser will report infinite loop.
 * </ul>
 *
 * @param e  sub-expression
 * @throws IllegalArgumentException if given argument is not a parsing expression
 */
public final Object zeroOrMore(Object e) {
 return new ZeroOrMoreExpression(convertToExpression(e));
}

代码示例来源:origin: org.codehaus.sonar.sslr/sslr-core

/**
 * Creates parsing expression - "zero or more".
 * During execution of this expression parser will repeatedly try sub-expression until it fails.
 * This expression always succeeds, with an empty match if sub-expression fails.
 * <p>
 * Be aware that:
 * <ul>
 * <li>This expression is greedy, i.e. expression {@code sequence(zeroOrMore("foo"), "foo")} will never succeed.
 * <li>Sub-expression must not allow empty matches, i.e. for expression {@code zeroOrMore(optional("foo"))} parser will report infinite loop.
 * </ul>
 *
 * @param e  sub-expression
 * @throws IllegalArgumentException if given argument is not a parsing expression
 */
public final Object zeroOrMore(Object e) {
 return new ZeroOrMoreExpression(convertToExpression(e));
}

代码示例来源:origin: SonarSource/sslr

@Setup
public void setup() {
 int n = Integer.getInteger("n", 3);
 input = Strings.repeat("t", n);
 ParsingExpression subExpression = new StringExpression("t");
 oneOrMore = compile(new OneOrMoreExpression(subExpression));
 usingZeroOrMore = compile(new SequenceExpression(subExpression, new ZeroOrMoreExpression(subExpression)));
}

代码示例来源:origin: org.sonarsource.sslr/sslr-core

/**
 * Creates parsing expression - "zero or more".
 * Convenience method equivalent to calling {@code zeroOrMore(sequence(e1, rest))}.
 *
 * @param e1  sub-expression
 * @param rest  rest of sub-expressions
 * @throws IllegalArgumentException if any of given arguments is not a parsing expression
 * @see #zeroOrMore(Object)
 * @see #sequence(Object, Object)
 */
public final Object zeroOrMore(Object e1, Object... rest) {
 return new ZeroOrMoreExpression(new SequenceExpression(convertToExpressions(e1, rest)));
}

代码示例来源:origin: org.codehaus.sonar.sslr/sslr-core

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerfulGrammarBuilder#till(Object)} instead.
 */
@Deprecated
public static Matcher till(Object e) {
 ParsingExpression expression = convertToExpression(e);
 return new SequenceExpression(
   new ZeroOrMoreExpression(
     new SequenceExpression(
       new NextNotExpression(expression),
       AnyTokenExpression.INSTANCE)),
   expression);
}

代码示例来源:origin: SonarSource/sslr

/**
 * Creates parsing expression - "zero or more".
 * Convenience method equivalent to calling {@code zeroOrMore(sequence(e1, rest))}.
 *
 * @param e1  sub-expression
 * @param rest  rest of sub-expressions
 * @throws IllegalArgumentException if any of given arguments is not a parsing expression
 * @see #zeroOrMore(Object)
 * @see #sequence(Object, Object)
 */
public final Object zeroOrMore(Object e1, Object... rest) {
 return new ZeroOrMoreExpression(new SequenceExpression(convertToExpressions(e1, rest)));
}

代码示例来源:origin: SonarSource/sslr

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerfulGrammarBuilder#till(Object)} instead.
 */
@Deprecated
public static Matcher till(Object e) {
 ParsingExpression expression = convertToExpression(e);
 return new SequenceExpression(
   new ZeroOrMoreExpression(
     new SequenceExpression(
       new NextNotExpression(expression),
       AnyTokenExpression.INSTANCE)),
   expression);
}

代码示例来源:origin: org.sonarsource.sslr/sslr-core

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerfulGrammarBuilder#till(Object)} instead.
 */
@Deprecated
public static Matcher till(Object e) {
 ParsingExpression expression = convertToExpression(e);
 return new SequenceExpression(
   new ZeroOrMoreExpression(
     new SequenceExpression(
       new NextNotExpression(expression),
       AnyTokenExpression.INSTANCE)),
   expression);
}

代码示例来源:origin: org.codehaus.sonar.sslr/sslr-core

/**
 * Creates parsing expression - "zero or more".
 * Convenience method equivalent to calling {@code zeroOrMore(sequence(e1, rest))}.
 *
 * @param e1  sub-expression
 * @param rest  rest of sub-expressions
 * @throws IllegalArgumentException if any of given arguments is not a parsing expression
 * @see #zeroOrMore(Object)
 * @see #sequence(Object, Object)
 */
public final Object zeroOrMore(Object e1, Object... rest) {
 return new ZeroOrMoreExpression(new SequenceExpression(convertToExpressions(Lists.asList(e1, rest))));
}

代码示例来源:origin: SonarSource/sslr

@Setup
public void setup() {
 int n = Integer.getInteger("n", 3);
 input = Strings.repeat("t", n);
 ParsingExpression subExpression = new StringExpression("t");
 zeroOrMore = compile(new ZeroOrMoreExpression(subExpression));
 optionalOneOrMore = compile(new OptionalExpression(new OneOrMoreExpression(subExpression)));
}

代码示例来源:origin: org.sonarsource.sslr/sslr-core

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerfulGrammarBuilder#exclusiveTill(Object)} instead.
 */
@Deprecated
public static Matcher exclusiveTill(Object... e) {
 ParsingExpression[] expressions = convertToExpressions(e);
 ParsingExpression subExpression = expressions.length == 1 ? expressions[0] : new FirstOfExpression(expressions);
 return new ZeroOrMoreExpression(
   new SequenceExpression(
     new NextNotExpression(
       subExpression),
     AnyTokenExpression.INSTANCE));
}

代码示例来源:origin: org.codehaus.sonar.sslr/sslr-core

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerfulGrammarBuilder#exclusiveTill(Object)} instead.
 */
@Deprecated
public static Matcher exclusiveTill(Object... e) {
 ParsingExpression[] expressions = convertToExpressions(e);
 ParsingExpression subExpression = expressions.length == 1 ? expressions[0] : new FirstOfExpression(expressions);
 return new ZeroOrMoreExpression(
   new SequenceExpression(
     new NextNotExpression(
       subExpression),
     AnyTokenExpression.INSTANCE));
}

代码示例来源:origin: SonarSource/sslr

/**
 * @deprecated in 1.19, use {@link org.sonar.sslr.grammar.LexerfulGrammarBuilder#exclusiveTill(Object)} instead.
 */
@Deprecated
public static Matcher exclusiveTill(Object... e) {
 ParsingExpression[] expressions = convertToExpressions(e);
 ParsingExpression subExpression = expressions.length == 1 ? expressions[0] : new FirstOfExpression(expressions);
 return new ZeroOrMoreExpression(
   new SequenceExpression(
     new NextNotExpression(
       subExpression),
     AnyTokenExpression.INSTANCE));
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com