Package org.esa.snap.core.jexp
Interface Parser
-
public interface Parser
Instances of theParser
interface are used to convert a code string representing an arithmetic expression in a tree of terms which can then be executed by using one of the evaluation methods of the
class.Term
- Version:
- $Revision$ $Date$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Namespace
getDefaultNamespace()
Gets this parser's default namespace.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.
-
-
-
Method Detail
-
getDefaultNamespace
Namespace getDefaultNamespace()
Gets this parser's default namespace.- Returns:
- the default environment used to resolve names.
-
parse
Term parse(String code) throws ParseException
Parses the expression given in the code string. Names in the code string are resolved using the default namespace.- Parameters:
code
- the code string, for the syntax of valid expressions refer to the class description- Returns:
- the the parsed code as
Term
- Throws:
ParseException
- if a parse reportError occurs
-
parse
Term parse(String code, Namespace namespace) throws ParseException
Parses the expression given in the code string. Names in the code string are resolved using the given namespace.- Parameters:
code
- the code string, for the syntax of valid expressions refer to the class descriptionnamespace
- the environment which is used to resolve names- Returns:
- the the parsed code as
Term
- Throws:
ParseException
- if a parse error occurs
-
-