|ensuring full semantic checker coverage? email@example.com (Ross Bencina) (2003-03-22)|
|Re: ensuring full semantic checker coverage? firstname.lastname@example.org (David Chase) (2003-03-23)|
|Re: ensuring full semantic checker coverage? email@example.com (Quinn Tyler Jackson) (2003-03-24)|
|Re: ensuring full semantic checker coverage? firstname.lastname@example.org (Ross Bencina) (2003-03-30)|
|From:||"Ross Bencina" <email@example.com>|
|Date:||22 Mar 2003 16:43:26 -0500|
|Organization:||iPrimus Customer - reports relating to abuse should be sent to firstname.lastname@example.org|
|Posted-Date:||22 Mar 2003 16:43:26 EST|
I'm implementing a compiler for a language with an ISO specification
(14496-3:1999(E)). This is the first compiler I've written. Currently
I'm working on implementing the semantic (type) checker, which walks
an AST annotating it with type information. The language specification
document contains a large number of specific assertions that need to
be enforced. To some degree the checks will be dispersed in the source
code, as I may need/want to implement the checks in multiple passes.
I'm wondering what the best approach is to ensure that every check is
implemented, and that every check remains implemented if I decide to
refactor the code in the future. Being able to easily keep track of
which modules perform which checks would also be handy.
My current plan is to build a database (some sort of tagged textfile)
with separate items for each assertion that the checker must test,
give each of these assertions an ID, then embed these IDs in comments
with the source code that implements each check. That way I can write
a script that crossreferences every required check to the code that
performs it. Perhaps the error message text for each check might also
form part of this approach.
Another approach I can think of is to somehow organise the code so
that it follows the order of the sections in the specification, and
annotate each check in the code with the relevent specification
Can anyone offer any insights or references to other/better approaches
to organising the implementation of semantic checks in order to
maximise the prospects that a standards document is adhered to?
Thanks in Advance
Return to the
Search the comp.compilers archives again.