public final class NestedParser extends Object
This is a fast, simple parser that takes input and a single, global hierarchy of operators and spits out "AST" implemented as nested Lists.
String input = "string(maxLength=10, trim, uppercase)";
String[] operators = { "()", ",", "=" }; // in order of precedence, can be pair of start/end or single char separator
List| Constructor and Description |
|---|
NestedParser() |
| Modifier and Type | Method and Description |
|---|---|
static String |
access(List<? extends Object> ast,
int index) |
static String |
access(List<? extends Object> ast,
int index,
String defaultValue) |
List<Object> |
parse(String input,
List<String> operators) |
List<Object> |
parse(String input,
String[] operators) |
Copyright © 2017. All rights reserved.