serialize grammar in a more diff'able form

generate rules line by line
also, use ternary if  in serializePostprocessor and serializeSymbol