Package org.esa.snap.core.jexp
Interface Parser
-
public interface ParserInstances of theParserinterface 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 theclass.Term- Version:
- $Revision$ $Date$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NamespacegetDefaultNamespace()Gets this parser's default namespace.Termparse(String code)Parses the expression given in the code string.Termparse(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
-
-