| Modifier and Type | Field | Description |
|---|---|---|
protected String |
buffer |
The input buffer.
|
protected int |
position |
The current position.
|
| Constructor | Description |
|---|---|
Context(String buffer,
int position) |
Constructs an immutable parse context.
|
| Modifier and Type | Method | Description |
|---|---|---|
Failure |
failure(String message) |
Returns a parse failure at the current position.
|
Failure |
failure(String message,
int position) |
Returns a successful parse result.
|
String |
getBuffer() |
Returns the input buffer.
|
int |
getPosition() |
Returns the current position.
|
Success |
success(Object value) |
Returns a successful parse result at the current position.
|
Success |
success(Object value,
int position) |
Returns a successful parse result.
|
String |
toString() |
protected final String buffer
protected final int position
public Context(String buffer, int position)
buffer - the buffer this context is usingposition - the position this context is pointing atpublic String getBuffer()
public int getPosition()
public Success success(Object value)
value - the value of the parse resultpublic Success success(Object value, int position)
value - the value of the parse resultposition - the position of the parse resultpublic Failure failure(String message)
message - the error message of the parse resultpublic Failure failure(String message, int position)
message - the error message of the parse resultposition - the position of the parse resultCopyright © 2018 PetitParser. All rights reserved.