refactored: leaves are now represented as ParseTree with special attribute @leaf=true