public static final class GrammarFunctions.Advanced
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Matcher |
adjacent(java.lang.Object element)
Match the element if and only if the first token of this element is adjacent to the previous consumed token.
|
static Matcher |
anyToken()
Consume the next token whatever it is
|
static Matcher |
anyTokenButNot(java.lang.Object element)
Consume the next token if and only if the element doesn't match
|
static Matcher |
bridge(TokenType from,
TokenType to)
Consume all tokens between token from and token to.
|
static Matcher |
exclusiveTill(java.lang.Object... elements)
Consume all tokens as long one of the provided elements is not encountered.
|
static Matcher |
isFalse()
For unit test only Not consume the next token whatever it is
|
static Matcher |
isOneOfThem(TokenType... types)
Match the next token if and only if its type belongs to the provided list
|
static Matcher |
isTrue()
For unit test only Consume the next token whatever it is
|
static Matcher |
longestOne(java.lang.Object... elements)
Match the longest alternative within the elements exactly once
|
static Matcher |
memoizeMatches(java.lang.Object element) |
static Matcher |
till(java.lang.Object element)
Consume all tokens as long as the element is not encountered.
|
static Matcher |
tillNewLine()
Consume every following token which are on the current line
|
public static Matcher adjacent(java.lang.Object element)
>------previous_element---- element ---->
Without any space between previous_element and elementpublic static Matcher anyTokenButNot(java.lang.Object element)
public static Matcher isOneOfThem(TokenType... types)
public static Matcher bridge(TokenType from, TokenType to)
>------ from ---- ... ---- to ---->
public static Matcher isTrue()
public static Matcher isFalse()
public static Matcher anyToken()
public static Matcher tillNewLine()
public static Matcher till(java.lang.Object element)
>------ ... ---- element ---->
public static Matcher exclusiveTill(java.lang.Object... elements)
>------ ... ---- element 1 ---->
|-- element 2 --|
|-- ... --|
|-- element n --|
public static Matcher longestOne(java.lang.Object... elements)
>------element 1----->
| |
----element 2---
| |
---- ... ---
| |
----element n---
public static Matcher memoizeMatches(java.lang.Object element)
Copyright © 2012 SonarSource. All Rights Reserved.