I need to create a parser based on such algorithms: 1) Definition of a lemsend in the text of a code 2) Creating a dictionary of keywords 3) Search for syntax errors in keywords 4) Search for syntax errors in symbols (distribution symbols, parentheses, etc.)

If you do not know the implementation will be happy for any information)

1 answer 1

If you want to write from scratch, you should start by reading the " dragon book ". In this book (already in the first chapters) there are answers to all questions, with source code and examples. But only for c / c ++ it is better to run the text through the preprocessor first - so simplify the task a little (or write your own).

But you can go easier - take the ready analyzer - cppcheck , see how it works, and then either write your own, or "bend the samples to the desired consistency." Or maybe improve the original cppcheck.