Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!mailrus!ncar!tank!eecae!cps3xx!rang From: rang@cpsin3.cps.msu.edu (Anton Rang) Newsgroups: comp.lang.c Subject: Translating Pascal ==> C: nested procedures Message-ID: <3276@cps3xx.UUCP> Date: 4 Jun 89 03:10:27 GMT Sender: usenet@cps3xx.UUCP Reply-To: rang@cpswh.cps.msu.edu (Anton Rang) Organization: Michigan State University, Computer Science Dept. Lines: 32 I'm curious. This is not intended to start a flame war, by the way (which is why it's not X-posted to comp.lang.pascal :-). I've heard of several "Pascal to C" translators. How do they handle nested procedures? For instance, suppose I have: procedure insert_in_symtab(what : node); function conflict(n1, n2 : node) : boolean; ... function check_if_full : boolean; ... ... procedure insert_in_strtab(what : string); function check_if_full : boolean; { this code uses "what" } ... ... Do they just rename the nested procedures to unique names and make them "static"? If so, how do they handle accesses to variables which are declared in enclosing blocks? (If you don't think this is interesting to C people, please E-mail responses to me.) Thanks, Anton +---------------------------+------------------------+ | Anton Rang (grad student) | "VMS Forever!" | | Michigan State University | rang@cpswh.cps.msu.edu | +---------------------------+------------------------+