Well, yes. But the traditional sweet/salty/sour/bitter groupings are pretty loose. I'm a bit doubtful about how well-supported they are by actual science. But that's a question for a biologist.
Anyway, the way it works in general is that you have lots of receptors in your mouth; special enzymes that trigger some signal to your brain when specific molecules bind to them. The size, shape and chemical properties of a molecule is what determines if it binds to a receptor or not. A simplified picture is
http://image.wistatutor.com/content/feed/tvcs/LOCK20AND20KEY1.png" ; basically the enzyme has a shape that 'fits' the molecules that are supposed to bind to it.
Some of the receptors in your body are specific to single compounds, but your taste receptors can react to many of them. All molecules that have some chemical feature that 'fits the lock' will trigger the corresponding taste. So you have for instance artificial sweeteners that trigger the same receptors as sugar, but trigger a much stronger signal, so only a small amount of sweetener will give the same response as a much larger amount of sugar.
Capsaicin, the substance that makes hot peppers 'hot',
really does taste 'hot' - it actually triggers not only taste receptors, but
heat receptors in your mouth.
So, there are very many chemical compounds that have taste, and most of them have somewhat different tastes, because they trigger different combinations of receptors. (and to different extents, it's not quite an on/off thing, as far as I know) But it's hard to attribute the taste of most of our foods to any single chemical compound. There are usually thousands of compounds involved.
Usually, artificial flavors are made up of only a handful of compounds that have been identified as the biggest contributors to the taste. For instance
http://en.wikipedia.org/wiki/Ester#Appendix_A:_List_of_ester_odorants", when it comes to fruits. That's why artificial flavors have a bad name- they don't have all the compounds in them, so the taste is not as 'rich'.