|
Object-oriented Parser System v3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectParser
public class Parser
wraps a ParserFunction.
Encapsulates monadic LL(n) parser building blocks.
| Field Summary | |
|---|---|
static Parser |
get
a parser which succeeds with the current input as a value. |
protected ParserFunction |
parserFunction
|
| Constructor Summary | |
|---|---|
Parser(ParserFunction parserFunction)
|
|
| Method Summary | |
|---|---|
Parser |
andThen(Scope b)
sequential execution: create a parser which will apply the receiver and, if successful, pass the result value to the argument and apply the resulting parser. |
static Parser |
fail(String message)
create a parser which fails with a message. |
static Object |
foldl(Object value,
Object list)
applies a list of functions to a value. |
Parser |
many()
create a parser which will apply the receiver as often as possible and return all results (or none) as an ArrayList. |
Parser |
optional(Object value)
create a parser which will apply the receiver and, if it fails, succeed with the given value. |
Parser |
orElse(Parser b)
alternative execution: create a parser which will apply the receiver and, if it fails, the argument. |
Result |
parse(Input input)
apply the parser function to advance in the input. |
static Parser |
put(Object value,
Input input)
create a parser which succeeds with the given value and input. |
Parser |
some()
create a parser which will apply the receiver at least once and return all results as an ArrayList. |
static Parser |
succeed(Object value)
create a parser which succeeds and returns a value. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final ParserFunction parserFunction
public static final Parser get
| Constructor Detail |
|---|
public Parser(ParserFunction parserFunction)
| Method Detail |
|---|
public Result parse(Input input)
public static Parser succeed(Object value)
public static Parser fail(String message)
public static Parser put(Object value,
Input input)
public Parser andThen(Scope b)
public Parser orElse(Parser b)
public Parser optional(Object value)
public Parser some()
ArrayList.
public Parser many()
ArrayList.
public static Object foldl(Object value,
Object list)
|
(c) 2008 Axel T. Schreiner |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||