Grammatical hierarchy and linear precedence