You're right so far. In all cases, you have to have a rigorous description of the syntax of the language (a "grammar") before you can build something that can take something allegedly in that language and determine if it complies with the syntax rules (a "parser").
The parser is the front end of a compiler. Code generation is the back end.
There are dozens of books out there on compiler construction. Most of them go into great detail on parsing techniques. Some deal only with the back end.
The best and most accessible book I've found for a beginner is Nicklaus Wirth's "Compiler Construction". Available free. You'll have to translate his source code from Oberon (a simple descendant of PASCAL and Modula-2) into your language of choice.
Jack Crenshaw's series, "Let's Build A Compiler", although incomplete, is almost as good, and just as accessible.
There are other tools. ANTLR is popular.