Add local index to grammar and metadata