Question

For a small language with minimal flow control, written with ANTLR, are there any guidelines or references that could be taken into consideration when testing the language?

Thanks

Was it helpful?

Solution 2

Unit tests for various concrete syntax -> parse tree mappings are a great way. Then do same for sample input phrases -> translation or evaluation or whatever your app is. High code coverage in the generated parser corresponds to high grammar rule coverage.

OTHER TIPS

as an input parameter for tests, you can use a syntax files (whole or parts if you can) and then check if your data structures contains expected values (declared variables, procedures, types etc). but at the end you will still have to create a lot of different programs in your new language, run them and check if they provide correct result or interact with your IO abstraction

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top