/** * Parses {@code source}. */ public final T parse(CharSequence source) { return parse(source, Mode.PRODUCTION); }
/** * Parses source read from {@code readable}. */ public final T parse(Readable readable) throws IOException { return parse(read(readable)); }
/** * Parses source read from {@code readable}. * * @param readable where the source is read from * @param moduleName the name of the module, this name appears in error message * @return the result * @deprecated Please use {@link #parse(Readable)} instead. */ @Deprecated public final T parse(Readable readable, String moduleName) throws IOException { return parse(read(readable), moduleName); }
/** Parsers {@code source} and evaluates to an {@link Integer}. */ public static int evaluate(String source) { return parser().parse(source); }
static <T> T parse(Parser<T> parser, String source) { return parser.from(TOKENIZER, Scanners.SQL_DELIMITER).parse(source); }
static <T> T parse(Parser<T> parser, Readable readable, String module) throws IOException { return parser.from(TOKENIZER, Scanners.JAVA_DELIMITER).parse(readable, module); }
static <T> T parse(Parser<T> parser, String source) { return parser.from(TOKENIZER, Scanners.JAVA_DELIMITER).parse(source); }
public SyntaxTree.Definition parse(Readable readable) { try { return grammar.from(tp.tokeniser(), ignore.skipMany()).parse(readable); } catch (IOException e) { throw new RuntimeException(e); } } }
public SyntaxTree.Definition parse(Readable readable) { try { return grammar.from(tp.tokeniser(), ignore.skipMany()).parse(readable); } catch(IOException e) { throw new RuntimeException(e); } } }
static <T> T parse(Parser<T> parser, String source) { return parser.from(INDENTATION.lexer(TOKENIZER, Indentation.WHITESPACES.or(COMMENT).many())) .parse(source); } }