use of org.matheclipse.parser.client.Parser in project symja_android_library by axkr.
the class RelaxedParserTestCase method testParser2.
public void testParser2() {
try {
Parser p = new Parser(true);
Object obj = p.parse("a sin()cos()x()y z");
assertEquals(obj.toString(), "Times(Times(Times(Times(Times(a, sin()), cos()), x()), y), z)");
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.matheclipse.parser.client.Parser in project symja_android_library by axkr.
the class RelaxedParserTestCase method testParser1.
public void testParser1() {
try {
Parser p = new Parser(true);
Object obj = p.parse("a()(0)(1)f[[x]]");
assertEquals(obj.toString(), "Times(Times(a(), Times(0, 1)), Part(f, x))");
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.matheclipse.parser.client.Parser in project symja_android_library by axkr.
the class ParserTestCase method testParser7.
public void testParser7() {
try {
Parser p = new Parser();
ASTNode obj = p.parse("a+%%%+%3*:=4!");
fail("A SyntaxError exception should occur here");
} catch (Exception e) {
assertEquals("Syntax error in line: 1 - Operator: := is no prefix operator.\n" + "a+%%%+%3*:=4!\n" + " ^", e.getMessage());
}
}
use of org.matheclipse.parser.client.Parser in project symja_android_library by axkr.
the class ParserTestCase method testParser3.
public void testParser3() {
try {
Parser p = new Parser();
ASTNode obj = p.parse("f[y,z](a+b+c)");
assertEquals(obj.toString(), "Times(f(y, z), Plus(a, b, c))");
} catch (Exception e) {
e.printStackTrace();
assertEquals("", e.getMessage());
}
}
use of org.matheclipse.parser.client.Parser in project symja_android_library by axkr.
the class ParserTestCase method testParser8.
public void testParser8() {
try {
Parser p = new Parser();
ASTNode obj = p.parse("-42424242424242424242");
assertEquals(obj.toString(), "-42424242424242424242");
} catch (Exception e) {
e.printStackTrace();
assertEquals("", e.getMessage());
}
}
Aggregations