Constructor and Description |
---|
ParserImpl()
Constructs a new parser instance which uses a
DefaultNamespace and type-checking enabled. |
ParserImpl(boolean typeChecking)
Constructs a new parser instance which uses a
DefaultNamespace and the given type-checking setting. |
ParserImpl(Namespace namespace)
Constructs a new parser instance which uses the given namespace and type-checking enabled.
|
ParserImpl(Namespace namespace,
boolean typeChecking)
Constructs a new parser instance which uses the given namespace and the given type-checking setting.
|
Modifier and Type | Method and Description |
---|---|
Namespace |
getDefaultNamespace()
Gets this parser's default namespace.
|
boolean |
isTypeChecking()
Gets whether or not this parser performs type checking on expressions.
|
Term |
parse(String code)
Parses the expression given in the code string.
|
Term |
parse(String code,
Namespace namespace)
Parses the expression given in the code string.
|
public ParserImpl()
DefaultNamespace
and type-checking enabled.public ParserImpl(boolean typeChecking)
DefaultNamespace
and the given type-checking setting.typeChecking
- if true, the parser performs strong type-checking on expressionspublic ParserImpl(Namespace namespace)
namespace
- the environment used to resolve names.public ParserImpl(Namespace namespace, boolean typeChecking)
namespace
- the environment used to resolve names.typeChecking
- if true, the parser performs type checking on expressionspublic final Namespace getDefaultNamespace()
getDefaultNamespace
in interface Parser
public boolean isTypeChecking()
public final Term parse(String code) throws ParseException
parse
in interface Parser
code
- the code string, for the syntax of valid expressions refer
to the class descriptionParseException
- if a parse reportError occurspublic final Term parse(String code, Namespace namespace) throws ParseException
parse
in interface Parser
code
- the code string, for the syntax of valid expressions refer
to the class descriptionnamespace
- the environment which is used to resolve namesParseException
- if a parse error occursCopyright © 2002–2014 Brockmann Consult GmbH. All rights reserved.