modify ast builder for protocol