You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Axel Kramer (JIRA)" <ji...@apache.org> on 2008/02/16 19:21:08 UTC

[jira] Created: (MATH-192) Operator precedence driven parser

Operator precedence driven parser 
----------------------------------

                 Key: MATH-192
                 URL: https://issues.apache.org/jira/browse/MATH-192
             Project: Commons Math
          Issue Type: New Feature
         Environment: Tested with commons-math-1.2-RC1-src
            Reporter: Axel Kramer
            Priority: Minor


Attached are sources for an operator precedence driven parser as described here:
http://en.wikipedia.org/wiki/Operator-precedence_parser

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/AllParserTests.java

JUnit test classes for testing the evaluation in double or Complex calculation mode:
/org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java



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


[jira] Commented: (MATH-192) Operator precedence driven parser

Posted by "Axel Kramer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12570417#action_12570417 ] 

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 http://www.apache.org/licenses/#clas)
> 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 that.

Thanks for your help. 
Some parts of the parser are derived from the http://sourceforge.net/projects/hartmath 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 project).
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?
> http://www.matheclipse.org/
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:
 http://matheclipse.org/en/Special:Calc

See the "Examples" combo-box or the menu "Help->Input Syntax" for some syntax examples.
The JUnit tests also show some more input examples:
http://matheclipse.cvs.sourceforge.net/matheclipse/org.matheclipse.core.test/src/org/matheclipse/core/system/SystemTestCase.java?view=markup

> 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: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Commented: (MATH-192) Operator precedence driven parser

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569726#action_12569726 ] 

Phil Steitz commented on MATH-192:
----------------------------------

I am +1 for incorporating something based on this, assuming
1) The code *can* be contributed under ASL (see http://www.apache.org/licenses/#clas)
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 that.


> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Commented: (MATH-192) Operator precedence driven parser

Posted by "Paul Libbrecht (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569618#action_12569618 ] 

Paul Libbrecht commented on MATH-192:
-------------------------------------

Axel,

how extensible is this parser ?
Could it be "warm extensible", that is, extensible after compilation, by programme-calls?

E.g. could I redefine after class-loading, that \ is the (binary) set difference or the (unary) macro-call ?

thanks in advance

paul

PS: do I understand correctly that your submission is expected as a donation that'd be under APL?

> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Updated: (MATH-192) Operator precedence driven parser

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz updated MATH-192:
-----------------------------

    Fix Version/s: 2.0

> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Closed: (MATH-192) Operator precedence driven parser

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz closed MATH-192.
----------------------------

    Resolution: Won't Fix

No progress on IP clearance issues -> can't add this.

> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>             Fix For: 2.1
>
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Commented: (MATH-192) Operator precedence driven parser

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574687#action_12574687 ] 

Luc Maisonobe commented on MATH-192:
------------------------------------

Before this package can be accepted, you should provide some paperwork for IP clearance. This mainly involves signing somes forms and send them to Apache. Look at the guideline here: http://www.apache.org/licenses/
At the end of the page, the two sections "Contributor License Agreements" and "Software Grants" are the ones we need. The first one is for code you may contribute during your involvment with Apache. The second one is for the existing piece of code you provide now, which already exists. Since you said part of the code was produced by someone else, we need to have is written agreement too.

For the parts of the code that come from the Eclipse JDT, I am not sure. At least, it would be nice to know precisely which parts come from this lineage and if it is better to keep them as is (if licence permits) or if it should be rewritten.


> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Commented: (MATH-192) Operator precedence driven parser

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569730#action_12569730 ] 

Niall Pemberton commented on MATH-192:
--------------------------------------

Just to clarify - this is currently part of the matheclipse sourceforge project?
   http://www.matheclipse.org/

Also was the parser generated using JavaCC or ANTLR or some other such tool - if so which?

> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Updated: (MATH-192) Operator precedence driven parser

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz updated MATH-192:
-----------------------------

    Fix Version/s:     (was: 2.0)
                   2.1

Moving release version out for now.  Last call for IP clearance from contributor, else close as WONTFIX

> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>             Fix For: 2.1
>
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Commented: (MATH-192) Operator precedence driven parser

Posted by "Axel Kramer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574209#action_12574209 ] 

Axel Kramer commented on MATH-192:
----------------------------------

So what are the next steps I should make for the parser package?

> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Commented: (MATH-192) Operator precedence driven parser

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654220#action_12654220 ] 

Luc Maisonobe commented on MATH-192:
------------------------------------

I'm not aware of any progress for this issue.
Should we close it as "won't fix" ?

> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Updated: (MATH-192) Operator precedence driven parser

Posted by "Axel Kramer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Axel Kramer updated MATH-192:
-----------------------------

    Attachment: parser.zip

Attached are the Eclips project files for the parser

> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Commented: (MATH-192) Operator precedence driven parser

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635236#action_12635236 ] 

Phil Steitz commented on MATH-192:
----------------------------------

Any progress on the IP issues here?

> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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


[jira] Commented: (MATH-192) Operator precedence driven parser

Posted by "Axel Kramer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569688#action_12569688 ] 

Axel Kramer commented on MATH-192:
----------------------------------

> how extensible is this parser ?
> Could it be "warm extensible", that is, extensible after compilation, by programme-calls?
> 
> E.g. could I redefine after class-loading, that \ is the (binary) set difference or the (unary) macro-call ?
With the ASTNodeFactory#getIdentifier2OperatorMap() and ASTNodeFactory#addOperator() methods, you can achieve this dynamic operator "over-loading".
The operator characters set must also be defined properly in the IParserFactory#DEFAULT_OPERATOR_CHARACTERS string (Unfortunately the backslash \ is not included in the operators character set at the moment).

For the evaluation of this new operator you have to add new functions for example in the DoubleEvaluator#FUNCTION_DOUBLE_MAP or ComplexEvaluator#FUNCTION_MAP maps.

This isn't very comfortable to use at the moment. But I think in the first step we have to define a syntax for a math expression parser which should be the foundation for usage inside commons math?

> paul
>
> PS: do I understand correctly that your submission is expected as a donation that'd be under APL?
Yes.
But I don't know exactly which formalisms must be used to donate it under APL into the commons project?
And I also think that the current package is only a starting-point for discussion the design of a math parser.

axel

> Operator precedence driven parser 
> ----------------------------------
>
>                 Key: MATH-192
>                 URL: https://issues.apache.org/jira/browse/MATH-192
>             Project: Commons Math
>          Issue Type: New Feature
>         Environment: Tested with commons-math-1.2-RC1-src
>            Reporter: Axel Kramer
>            Priority: Minor
>         Attachments: parser.zip
>
>
> Attached are sources for an operator precedence driven parser as described here:
> http://en.wikipedia.org/wiki/Operator-precedence_parser
> 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/AllParserTests.java
> JUnit test classes for testing the evaluation in double or Complex calculation mode:
> /org.matheclipse.parser.test/src/org/matheclipse/parser/test/eval/AllEvalTests.java

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