In fact lexical rules and grammar rule are translated into Python in a very similar way