ensuring full semantic checker coverage?

"Ross Bencina" <rossb@audiomulch.com>
22 Mar 2003 16:43:26 -0500

          From comp.compilers

Related articles
ensuring full semantic checker coverage? rossb@audiomulch.com (Ross Bencina) (2003-03-22)
Re: ensuring full semantic checker coverage? chase@theworld.com (David Chase) (2003-03-23)
Re: ensuring full semantic checker coverage? qjackson@shaw.ca (Quinn Tyler Jackson) (2003-03-24)
Re: ensuring full semantic checker coverage? rossb@audiomulch.com (Ross Bencina) (2003-03-30)
| List of all articles for this month |

From: "Ross Bencina" <rossb@audiomulch.com>
Newsgroups: comp.compilers
Date: 22 Mar 2003 16:43:26 -0500
Organization: iPrimus Customer - reports relating to abuse should be sent to abuse@iprimus.com.au
Keywords: semantics, question
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
section numbers.

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


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.