If there is an existing parser, like for a lot of templating languages, this is can be done, since templates are parsed to ruby in a separate step. Otherwise, it would require creating a ruby-based parser for a language, or porting the concepts to that language.