/** * Random expressions we used for testing while writing the grammar. Might as well leave them in here */ public function testParse() { $o_parser = new ExpressionParser(); // parse() will throw an exception if it fails, so no assertions necessary $o_parser->parse('^ca_objects.preferred_labels = "foo"'); $o_parser->parse('^5 = "foo"'); $o_parser->parse('"Joe" NOT IN ["Julia", "Allison", "Sophie", "Maria", "Angie", "Seth"]'); $o_parser->parse('"Seth" IN ["Julia", "Allison", "Sophie", "Maria", "Angie", "Seth"]'); $o_parser->parse('5 IN [1,2,3,4,5]'); $o_parser->parse('("seth" = "seth")'); $o_parser->parse('5 > 10 OR "seth" = "seth"'); $o_parser->parse('(5 = 10) AND ("seth" = "seth") AND (6 > 1)'); $o_parser->parse('((5 > 10) AND ("seth" = "seth")) OR (6 > 1)'); $o_parser->parse('5 =~ /foo/'); $o_parser->parse('5 =~ /test test/'); $o_parser->parse('"foo" =~ /test test/'); $o_parser->parse('5 + 4'); $o_parser->parse('"foo" + "bar"'); $o_parser->parse('5 > 4'); $o_parser->parse('5 >= 4'); $o_parser->parse('5 != 4'); $o_parser->parse('5 = 4'); $o_parser->parse('5+5 >= 4'); $o_parser->parse('avg(abs(1.345), max(4,5))'); $o_parser->parse('1 ÷ 2 ÷ 3 + 4 * (5 * 2 - 6) * 3.14 ÷ avg(7, 8, 9)'); }