Insert machine code based on metadata

Would it be possible to detect a metadata inserted at beginning parsing stage (at LLParser) to branch and add statements and then emit a machine code (.byte/.word) at lower levels depending on whether or not if that metadata is present? As far as I searched, the only way I could think of doing this is to detect the metadata at an earlier stage, then pass a flag if the metadata was present and use that flag to emit the extra machine codes.

Kaarthik A.