To dream of a machine gun represents decision making that is decimating or wipes out everything in it's way. Never listening to anyone else no matter what. The power to influence or completely remove all obstacles at once. You or someone else that is cutting down everything in their way. Nothing is getting in the your way or interfering with your choices. It might also reflect your attempt to wipe out all competing ideas or goals.
Negatively, dreaming about a machine gun may reflect a total lack of concern for the consequences of your choices. Being unwilling to listen to anything except your own ideas. Decisions that are decimating or "wipe out" everything. Anger that is out of check. Insensitively making choices that will turn everyone you know into a loser. Paranoid jealousy making drastic choices to exterminate opposition or competition. Risking "collateral damage" with sweeping changes.
To dream of being attacked by a machine gun represents a fear of being totally wiped out by a problem or someone's else's overpowering decisions. Feeling that multiple areas of your life are threatened at once. It may also reflect strong competition or someone else's decision that has a big impact on you. An area of your life may be negatively influences all other areas with no concern for your feelings. Alternatively, it may be a sign that you feel you have hurt yourself intentionally never listening to anyone else at all.
Example: A woman dreamed of someone firing a machine gun on a room full of people. In waking like she had a fear that she was destroying multiple areas of her life at once with a big decision she made.
Example 2: A man dreamed of being shot at with a machine gun on the left side of his chest. In waking life he was diagnosed with lung cancer on his left side. The machine gun may have reflected his view of himself choosing to hurt himself smoking for years despite all the people telling him not to. Metaphorically, killing himself by never having to listen to anyone else at all.