Generalized Handle Grammars and Their Relation to Petri Nets