|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.parboiled.BaseActions<V>
org.parboiled.BaseParser<V>
V
- the type of the parser valuespublic abstract class BaseParser<V>
Base class of all parboiled parsers. Defines the basic rule creation methods.
Field Summary | |
---|---|
static org.parboiled.Rule |
ANY
Matches any character except Chars.EOI . |
static org.parboiled.Rule |
DEDENT
Matches the special Chars.DEDENT character produces by the org.parboiled.buffers.IndentDedentInputBuffer |
static org.parboiled.Rule |
EMPTY
Matches nothing and always succeeds. |
static org.parboiled.Rule |
EOI
Matches the Chars.EOI (end of input) character. |
static org.parboiled.Rule |
INDENT
Matches the special Chars.INDENT character produces by the org.parboiled.buffers.IndentDedentInputBuffer |
static org.parboiled.Rule |
NOTHING
Matches nothing and always fails. |
Constructor Summary | |
---|---|
BaseParser()
|
Method Summary | ||
---|---|---|
static org.parboiled.Action |
ACTION(boolean expression)
Explicitly marks the wrapped expression as an action expression. |
|
org.parboiled.Rule |
AnyOf(char[] characters)
Creates a new rule that matches any of the characters in the given char array. |
|
org.parboiled.Rule |
AnyOf(org.parboiled.support.Characters characters)
Creates a new rule that matches any of the given characters. |
|
org.parboiled.Rule |
AnyOf(java.lang.String characters)
Creates a new rule that matches any of the characters in the given string. |
|
org.parboiled.Rule |
Ch(char c)
Explicitly creates a rule matching the given character. |
|
org.parboiled.Rule |
CharRange(char cLow,
char cHigh)
Creates a rule matching a range of characters from cLow to cHigh (both inclusively). |
|
org.parboiled.Rule |
FirstOf(java.lang.Object[] rules)
Creates a new rule that successively tries all of the given subrules and succeeds when the first one of its subrules matches. |
|
org.parboiled.Rule |
FirstOf(java.lang.Object rule,
java.lang.Object rule2,
java.lang.Object... moreRules)
Creates a new rule that successively tries all of the given subrules and succeeds when the first one of its subrules matches. |
|
protected org.parboiled.Rule |
fromCharArray(char[] array)
Used internally to convert the given char array to a parser rule. |
|
protected org.parboiled.Rule |
fromCharLiteral(char c)
Used internally to convert the given character literal to a parser rule. |
|
protected org.parboiled.Rule |
fromStringLiteral(java.lang.String string)
Used internally to convert the given string literal to a parser rule. |
|
org.parboiled.Rule |
IgnoreCase(char... characters)
Explicitly creates a rule matching the given string in a case-independent fashion. |
|
org.parboiled.Rule |
IgnoreCase(char c)
Explicitly creates a rule matching the given character case-independently. |
|
org.parboiled.Rule |
IgnoreCase(java.lang.String string)
Explicitly creates a rule matching the given string in a case-independent fashion. |
|
|
newInstance()
Creates a new instance of this parsers class using the no-arg constructor. |
|
org.parboiled.Rule |
OneOrMore(java.lang.Object rule)
Creates a new rule that tries repeated matches of its subrule and succeeds if the subrule matches at least once. |
|
org.parboiled.Rule |
OneOrMore(java.lang.Object rule,
java.lang.Object rule2,
java.lang.Object... moreRules)
Creates a new rule that tries repeated matches of a sequence of the given subrules and succeeds if the sequence matches at least once. |
|
org.parboiled.Rule |
Optional(java.lang.Object rule)
Creates a new rule that tries a match on its subrule and always succeeds, independently of the matching success of its sub rule. |
|
org.parboiled.Rule |
Optional(java.lang.Object rule,
java.lang.Object rule2,
java.lang.Object... moreRules)
Creates a new rule that tries a match on the sequence of the given subrules and always succeeds, independently of the matching success of its sub sequence. |
|
org.parboiled.Rule |
Sequence(java.lang.Object[] rules)
Creates a new rule that only succeeds if all of its subrule succeed, one after the other. |
|
org.parboiled.Rule |
Sequence(java.lang.Object rule,
java.lang.Object rule2,
java.lang.Object... moreRules)
Creates a new rule that only succeeds if all of its subrule succeed, one after the other. |
|
org.parboiled.Rule |
String(char... characters)
Explicitly creates a rule matching the given string. |
|
org.parboiled.Rule |
String(java.lang.String string)
Explicitly creates a rule matching the given string. |
|
org.parboiled.Rule |
Test(java.lang.Object rule)
Creates a new rule that acts as a syntactic predicate, i.e. |
|
org.parboiled.Rule |
Test(java.lang.Object rule,
java.lang.Object rule2,
java.lang.Object... moreRules)
Creates a new rule that acts as a syntactic predicate, i.e. |
|
org.parboiled.Rule |
TestNot(java.lang.Object rule)
Creates a new rule that acts as an inverse syntactic predicate, i.e. |
|
org.parboiled.Rule |
TestNot(java.lang.Object rule,
java.lang.Object rule2,
java.lang.Object... moreRules)
Creates a new rule that acts as an inverse syntactic predicate, i.e. |
|
org.parboiled.Rule |
toRule(java.lang.Object obj)
Converts the given object to a rule. |
|
org.parboiled.Rule[] |
toRules(java.lang.Object... objects)
Converts the given object array to an array of rules. |
|
org.parboiled.Rule |
ZeroOrMore(java.lang.Object rule)
Creates a new rule that tries repeated matches of its subrule. |
|
org.parboiled.Rule |
ZeroOrMore(java.lang.Object rule,
java.lang.Object rule2,
java.lang.Object... moreRules)
Creates a new rule that tries repeated matches of the sequence of the given sub rules. |
Methods inherited from class org.parboiled.BaseActions |
---|
currentChar, drop, drop, dup, getContext, hasError, inPredicate, match, matchedChar, matchEnd, matchOrDefault, matchStart, nodeSuppressed, peek, peek, poke, poke, pop, pop, push, push, pushAll, setContext, swap, swap3, swap4, swap5, swap6 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.parboiled.Rule EOI
Chars.EOI
(end of input) character.
public static final org.parboiled.Rule INDENT
Chars.INDENT
character produces by the org.parboiled.buffers.IndentDedentInputBuffer
public static final org.parboiled.Rule DEDENT
Chars.DEDENT
character produces by the org.parboiled.buffers.IndentDedentInputBuffer
public static final org.parboiled.Rule ANY
Chars.EOI
.
public static final org.parboiled.Rule EMPTY
public static final org.parboiled.Rule NOTHING
Constructor Detail |
---|
public BaseParser()
Method Detail |
---|
public <P extends BaseParser<V>> P newInstance()
Parboiled.createParser(Class, Object...)
for creating
new parser instances since this method does not use reflection.
P
- the parser class
public org.parboiled.Rule Ch(char c)
fromCharLiteral(char)
,
e.g. because you redefined it, you can also use this wrapper.
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
argument will yield the same rule instance.
c
- the char to match
public org.parboiled.Rule IgnoreCase(char c)
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
argument will yield the same rule instance.
c
- the char to match independently of its case
public org.parboiled.Rule CharRange(char cLow, char cHigh)
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
arguments will yield the same rule instance.
cLow
- the start char of the range (inclusively)cHigh
- the end char of the range (inclusively)
public org.parboiled.Rule AnyOf(java.lang.String characters)
Note: This methods provides caching, which means that multiple invocations with the same argument will yield the same rule instance.
characters
- the characters
public org.parboiled.Rule AnyOf(char[] characters)
Note: This methods provides caching, which means that multiple invocations with the same argument will yield the same rule instance.
characters
- the characters
public org.parboiled.Rule AnyOf(org.parboiled.support.Characters characters)
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
argument will yield the same rule instance.
characters
- the characters
public org.parboiled.Rule String(java.lang.String string)
fromStringLiteral(String)
,
e.g. because you redefined it, you can also use this wrapper.
Note: This methods provides caching, which means that multiple invocations with the same argument will yield the same rule instance.
string
- the String to match
public org.parboiled.Rule String(char... characters)
fromStringLiteral(String)
,
e.g. because you redefined it, you can also use this wrapper.
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
argument will yield the same rule instance.
characters
- the characters of the string to match
public org.parboiled.Rule IgnoreCase(java.lang.String string)
Note: This methods provides caching, which means that multiple invocations with the same argument will yield the same rule instance.
string
- the string to match
public org.parboiled.Rule IgnoreCase(char... characters)
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
argument will yield the same rule instance.
characters
- the characters of the string to match
public org.parboiled.Rule FirstOf(java.lang.Object rule, java.lang.Object rule2, java.lang.Object... moreRules)
Note: This methods provides caching, which means that multiple invocations with the same arguments will yield the same rule instance.
rule
- the first subrulerule2
- the second subrulemoreRules
- the other subrules
public org.parboiled.Rule FirstOf(java.lang.Object[] rules)
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
argument will yield the same rule instance.
rules
- the subrules
public org.parboiled.Rule OneOrMore(java.lang.Object rule)
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
argument will yield the same rule instance.
rule
- the subrule
public org.parboiled.Rule OneOrMore(java.lang.Object rule, java.lang.Object rule2, java.lang.Object... moreRules)
Note: This methods provides caching, which means that multiple invocations with the same arguments will yield the same rule instance.
rule
- the first subrulerule2
- the second subrulemoreRules
- the other subrules
public org.parboiled.Rule Optional(java.lang.Object rule)
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
argument will yield the same rule instance.
rule
- the subrule
public org.parboiled.Rule Optional(java.lang.Object rule, java.lang.Object rule2, java.lang.Object... moreRules)
Note: This methods provides caching, which means that multiple invocations with the same arguments will yield the same rule instance.
rule
- the first subrulerule2
- the second subrulemoreRules
- the other subrules
public org.parboiled.Rule Sequence(java.lang.Object rule, java.lang.Object rule2, java.lang.Object... moreRules)
Note: This methods provides caching, which means that multiple invocations with the same arguments will yield the same rule instance.
rule
- the first subrulerule2
- the second subrulemoreRules
- the other subrules
public org.parboiled.Rule Sequence(java.lang.Object[] rules)
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
arguments will yield the same rule instance.
rules
- the sub rules
public org.parboiled.Rule Test(java.lang.Object rule)
Creates a new rule that acts as a syntactic predicate, i.e. tests the given sub rule against the current input position without actually matching any characters. Succeeds if the sub rule succeeds and fails if the sub rule rails. Since this rule does not actually consume any input it will never create a parse tree node.
Also it carries a SuppressNode
annotation, which means all sub nodes will also never create a parse
tree node. This can be important for actions contained in sub rules of this rule that otherwise expect the
presence of certain parse tree structures in their context.
Also see SkipActionsInPredicates
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
argument will yield the same rule instance.
rule
- the subrule
public org.parboiled.Rule Test(java.lang.Object rule, java.lang.Object rule2, java.lang.Object... moreRules)
Creates a new rule that acts as a syntactic predicate, i.e. tests the sequence of the given sub rule against the current input position without actually matching any characters. Succeeds if the sub sequence succeeds and fails if the sub sequence rails. Since this rule does not actually consume any input it will never create a parse tree node.
Also it carries a SuppressNode
annotation, which means all sub nodes will also never create a parse
tree node. This can be important for actions contained in sub rules of this rule that otherwise expect the
presence of certain parse tree structures in their context.
Also see SkipActionsInPredicates
Note: This methods provides caching, which means that multiple invocations with the same arguments will yield the same rule instance.
rule
- the first subrulerule2
- the second subrulemoreRules
- the other subrules
public org.parboiled.Rule TestNot(java.lang.Object rule)
Creates a new rule that acts as an inverse syntactic predicate, i.e. tests the given sub rule against the current input position without actually matching any characters. Succeeds if the sub rule fails and fails if the sub rule succeeds. Since this rule does not actually consume any input it will never create a parse tree node.
Also it carries a SuppressNode
annotation, which means all sub nodes will also never create a parse
tree node. This can be important for actions contained in sub rules of this rule that otherwise expect the
presence of certain parse tree structures in their context.
Also see SkipActionsInPredicates
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
argument will yield the same rule instance.
rule
- the subrule
public org.parboiled.Rule TestNot(java.lang.Object rule, java.lang.Object rule2, java.lang.Object... moreRules)
Creates a new rule that acts as an inverse syntactic predicate, i.e. tests the sequence of the given sub rules against the current input position without actually matching any characters. Succeeds if the sub sequence fails and fails if the sub sequence succeeds. Since this rule does not actually consume any input it will never create a parse tree node.
Also it carries a SuppressNode
annotation, which means all sub nodes will also never create a parse
tree node. This can be important for actions contained in sub rules of this rule that otherwise expect the
presence of certain parse tree structures in their context.
Also see SkipActionsInPredicates
Note: This methods provides caching, which means that multiple invocations with the same arguments will yield the same rule instance.
rule
- the first subrulerule2
- the second subrulemoreRules
- the other subrules
public org.parboiled.Rule ZeroOrMore(java.lang.Object rule)
Note: This methods carries a Cached
annotation, which means that multiple invocations with the same
argument will yield the same rule instance.
rule
- the subrule
public org.parboiled.Rule ZeroOrMore(java.lang.Object rule, java.lang.Object rule2, java.lang.Object... moreRules)
Note: This methods provides caching, which means that multiple invocations with the same arguments will yield the same rule instance.
rule
- the first subrulerule2
- the second subrulemoreRules
- the other subrules
public static org.parboiled.Action ACTION(boolean expression)
Action
instance during parser construction.
expression
- the expression to turn into an Action
protected org.parboiled.Rule fromCharLiteral(char c)
c
- the character
protected org.parboiled.Rule fromStringLiteral(java.lang.String string)
string
- the string
protected org.parboiled.Rule fromCharArray(char[] array)
array
- the char array
public org.parboiled.Rule[] toRules(java.lang.Object... objects)
objects
- the objects to convert
public org.parboiled.Rule toRule(java.lang.Object obj)
obj
- the object to convert
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |