commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Axel Kramer (JIRA)" <>
Subject [jira] Commented: (MATH-192) Operator precedence driven parser
Date Tue, 19 Feb 2008 20:24:43 GMT


Axel Kramer commented on MATH-192:

> Phil Steitz - 17/Feb/08 09:30 AM
> I am +1 for incorporating something based on this, assuming
> 1) The code can be contributed under ASL (see
> 2) There is sufficient community interest to ready it for release / maintain it
> Assuming yes to 1), we need to go through the incubator IP clearance process. Not a big
deal. The important thing is to make sure that the code is unencumbered. Luc or I can handle

Thanks for your help. 
Some parts of the parser are derived from the project.

The author allowed me to start my successor project "MathEclipse" with his coding under the
Eclipse Common Public License (removing dependencies to external GPL libraries from the original
I know the author personally here in Germany and got his permission to use his original parser
code also under ASL.
I've also taken some methods of the Eclipse JDT parser/scanner and reworked it for the math
parser. But AFAIK the Eclipse license should be compatible with the ASL?

How does the "IP clearance process" work technically/formally?

> Niall Pemberton - 17/Feb/08 09:56 AM
> Just to clarify - this is currently part of the matheclipse sourceforge project?
Yes, it's released in the MathEclipse project, but it's not used as a commons-math (double
or Complex type) evaluator in this project. 
I've used the parser there for a symbolic math evaluator.
You can test the current syntax online in this AJAX form:

See the "Examples" combo-box or the menu "Help->Input Syntax" for some syntax examples.
The JUnit tests also show some more input examples:

> Also was the parser generated using JavaCC or ANTLR or some other such tool - if so which?
No, it's handwritten.

> Operator precedence driven parser 
> ----------------------------------
>                 Key: MATH-192
>                 URL:
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>         Attachments:
> Attached are sources for an operator precedence driven parser as described here:
> At the moment the used syntax for the math expressions is very similar to the Mathematica
input syntax
> and must probably be reworked for the common maths needs.
> Mainly the parser is driven by the arrays HEADER_STRINGS, OPERATOR_STRINGS and OPERATORS
in the:
>   org.matheclipse.parser.operator.ASTNodeFactory
> class.
> There's a utility class
>   org.matheclipse.parser.util.GenerateOperatorArrays
> which generates the above arrays for operator sets defined in a textfile like for example
>   /org.matheclipse.parser/eval/src/operators.txt
> JUnit test classes for testing the pure parser without any evaluations:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message