add gate rule parsing/exporting to templates