newbie: general compilers question: static checking

Neil Zanella <nzanella@cs.mun.ca>
2 Nov 2003 14:46:50 -0500

          From comp.compilers

Related articles
newbie: general compilers question: static checking nzanella@cs.mun.ca (Neil Zanella) (2003-11-02)
Re: newbie: general compilers question: static checking derkgwen@HotPOP.com (Derk Gwen) (2003-11-08)
Re: newbie: general compilers question: static checking clausing@voyager.net (Brian Clausing) (2003-11-08)
Re: newbie: general compilers question: static checking bobduff@shell01.TheWorld.com (Robert A Duff) (2003-11-08)
Re: newbie: general compilers question: static checking vbdis@aol.com (2003-11-08)
| List of all articles for this month |
From: Neil Zanella <nzanella@cs.mun.ca>
Newsgroups: comp.compilers
Date: 2 Nov 2003 14:46:50 -0500
Organization: Memorial University of Newfoundland
Keywords: analysis, question
Posted-Date: 02 Nov 2003 14:46:50 EST

Hello,


I have seen the words "static checking" in the context of compilers
several times as something typically done in between the parsing and
intermediate code generation phases of the compiler. Could anyone
please explain to me what static checking is? Also, is it a front-end
issue or a back-end issue? Seems like a front-end issue to me since it
seems to be language dependent. Seems to me like static checking is
part of semantic analysis.


I think static checking has to do with checking type compatibility of
assignment, arithmetic, and other operators. Perhaps someone can confirm
this with me. I am not sure why this is so but some texbooks also call
the following static checking:


- checking that break statements do not appear outside enclosing
    constructs where a break statement may appear
- checking that elements of enmerated types are not repeated
- checking that variable names do not appear in the same lexical scope
- checking that labels are not repeated


So, static checking seems to encompass a variety of semantic checks.
In general, how do I tell whether a check done by the compiler falls
under the category of static checking, and what is the relevance of
the word static in the words static checking?


Perhaps someone can elaborate on static checking.


In particular, I would like to know what the relationship between
semantic analysis and static checking is. It would appear to me
that the two terms could almost be used interchangeably. Is
this correct?


Thank you for your replies,


Neil


Post a followup to this message

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