As someone else mentioned, the dragon book is a good place to start.
If you want to get more indepth, then I reccomend the following 2 books, in the order listed:
- Types and Programming Lanauges, by Benjamin C. Pierce
- Principals of program analysis, by Flemming Nielson, Hanne Riis Nielson, and Chris Hankin
Now, these books are a bit heavy on theory, which might put some people off, but I think they are worth your time.
There is a little bit of danger in taking a theoretical approach, mainly that you can get caught up in the "rigor" of the mathematical modeling, and end up forgetting about the end goal in the first place (which is creating development tools for programmers). Some people kind of go off the deep end as a result. If you keep that in mind when you are going through the books it shouldn't be a problem though.
The reason I recommend taking a theoretical approach is that working through the proofs exercises in the Pierce book trains your brain for analyzing programing language semantics in the way that you need to when working on a real programing language. Doing the proofs basically boils down to thinking through the different possible combinations of things in the type system and how they interact with each other, and then reasoning about them.
Once you do it a few times, it starts to become intuitive. Going through that process quickly and intuitively is invaluable when working on a compilers, defining programing languages, or writing development tools.
The Nielson, Nielson, and Hankin book is a HARD read. I had the benefit of a professor, a class of students, and 2 lectures a week to help me, and it was tough. Going through it by your self won't be easy. However, it really covers the foundations of program analysis throughly, which would be really helpful if you want to start doing the kinds of analysis you are talking about.
As far as math knowledge goes, you need to be familiar with "discrete math" concepts. This includes things like "partial orders", "lattices", and basic set theory. Any CS "discrete math course" or a "modern algebra class" from the Math dept should give you the background you need.