In this paper, we propose an implementation method of hygienic macro-definition mechanisms into languages defined using OMeta, an OOP language with PEG-based general-purpose pattern matching. From the specification of a macro-definition mechanism and a parser written in OMeta, the proposed method generates an extended parser equipped with the macro-definition mechanism based on the Scoped Set model. We show the effectiveness of the method by applying it to two different languages: Javascript and MinCaml.