parse rules. need to fix syntax tree fixing