A parser to calculate AND-OR string expression