本文整理了Java中org.sonar.sslr.internal.vm.ZeroOrMoreExpression
类的一些代码示例,展示了ZeroOrMoreExpression
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZeroOrMoreExpression
类的具体详情如下:
包路径:org.sonar.sslr.internal.vm.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));
}
内容来源于网络,如有侵权,请联系作者删除!