문제

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

도움이 되었습니까?

해결책 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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top