public class Parser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
RS_VERSION
The supported version of the RiveScript language.
|
Constructor and Description |
---|
Parser()
Creates a new
Parser with a default ParserConfig . |
Parser(ParserConfig config)
Creates a new
Parser with the given ParserConfig . |
Modifier and Type | Method and Description |
---|---|
Root |
parse(java.lang.String filename,
java.lang.String[] code)
Parses the RiveScript source code.
|
public static final double RS_VERSION
public Parser()
Parser
with a default ParserConfig
.public Parser(ParserConfig config)
Parser
with the given ParserConfig
.config
- the configpublic Root parse(java.lang.String filename, java.lang.String[] code) throws ParserException
This will return an Abstract Syntax Tree Root
object containing all of the relevant information parsed from the source code.
In case of errorMessages (e.g. a syntax error when strict mode is enabled) a ParserException
will be thrown.
filename
- the arbitrary name for the source code being parsedcode
- the lines of RiveScript source codeParserException
- in case of a parsing error