sbmlteam / jsbml

JSBML is a community-driven project to create a free, open-source, pure Java™ library for reading, writing, and manipulating SBML files (the Systems Biology Markup Language) and data streams. It is an alternative to the mixed Java/native code-based interface provided in libSBML.

Home Page:https://sbml.org/software/jsbml/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems converting ASTNode2 to ASTNode with FormulaParserLL3

LisaFalk opened this issue · comments

Even though it is not the best idea converting ASTNode2 to ASTNode with FormulaParserLL3 we thought it would be working.
But the formula (A xor B) causes the following exception:
Caused by: org.sbml.jsbml.text.parser.ParseException: Encountered " "xor "" at line 1, column 3.
Was expecting one of:

"+" ...
"^" ...
"-" ...
"*" ...
"/" ...
"%" ...
...
<BOOLEAN_LOGIC> ...
...

Thanks for the report, in fact, to support easily 'xor(A, B)' we removed the support for 'A xor B'. You can still use 'XOR' or 'Xor'. Did you wrote this by hand or was it generated by one of the FormulaCompiler ?

Thank you. It occured by calling the method toFormula() on a ASTLogicalOperatorNode(ASTNode.Type.LOGICAL_XOR).

Yes, the ASTNode2 formula compiler would not have been corrected with the latest changes, I will take care of that.

It should be fixed now in master.