EP0406028A2

Incremental compiler for source code development system.

Abstract

A computer-aided software development system includes programs to implement edit, compile, link and run sequences, all from memory, at very high speed. The compiler and linker operate on an incremental basis, line-by-line or increment-by-increment, so if only one line is changed in an edit session, then only that line and lines related to it need be recompiled if no other code is affected; linking is also done in a manner to save and re-use parts of link tables and link lists which are not changed from one edit session to another. Dependency analysis may be performed incrementally, without requiring the user to enter dependencies. Scanning is also done incrementally, and the resulting token lists and token tables, and lexical increment tables, are saved in memory to be used again where no changes are made. All of the linking tables are saved in memory so there is no need to generate link tables for increments of code where no changes in links are needed. The parser is able to skip lines or blocks of lines of source code which haven't been changed; for this purpose, each line of source text in the editor has a change-tag to indicate whether this line has been changed, and from this change-­tag information a clean-lines table is built having a clean-lines indication for each line of source code, indicating how many clean lines follow the present line. All of the source code text modules, the token lists, symbol tables, code tables and related data saved from one compile to another are maintained in virtual memory rather than in files so that speed of operation is enhanced. Also, the object code created is maintained in memory rather than in a file, and executed from this memory image, to reduce delays. A virtual memory management arrangement for the system assures that all of the needed data modules and code is present in real memory in the phase being implemented, with a minimum of page faults and page swapping during the phase, again to enhance operating speed.

EP0406028A2, drawing sheet 1
Sheet 1 of 18

Term

Term ended

Projected expiry passed 2 July 2010, 16.2 years ago.

  1. Priority
  2. Filed
  3. Published
  4. Projected expiry
  5. Today

57 claims: 22 independent, 35 dependent

  1. 1
    A method of reducing turnaround time in an edit-compile-link-run cycle of a programming development system, comprising the steps of:a) editing a module of application source text, said source text being resident in a file system and held during all editing actions in virtual memory in a source text buffer including a plurality of lines;b) incrementally compiling said module of application source text to create a module of executable application code;c) incrementally linking said module of executable application code to create in memory an executable form of application program;d) executing said executable form of the application program in place.
  2. 5
    A method according to any of claims 1 to 4 including the step of stopping either the steps of compiling, linking or executing upon detecting an error, whereby a user may correct the error via said step of editing.
  3. 6
    A method of developing source code, comprising the steps of:a) editing a module of source using an editor, said source text being stored in a source-text buffer as a plurality of lines;b) compiling said source-text buffer to produce a code table;c) linking said code table to produce a code image;d) running the code via said code image;e) said step of compiling including: i) generatilig an increment table where each increment represents a lexical increment of said source text and saving said increment table in memory, and skipping lexical increments for which a corresponding increment has been saved in said increment table from a prior version of said source-­text buffer and the corresponding increment has not been changed, ii) detecting semantic increments in said source text, and for each semantic increment, checking to see if the line or lines including said statement have been changed, and, if not, skipping said semantic increment and reusing code of said code table for said skipped semantic increment;f) said step of linking including generating a link table where each entry in said link table includes an identification and location of an element needed by or supplied by said code table, and including matching said elements needed or supplied in said link table and generating a link list.
  4. 9
    A method of developing source code, comprising the steps of:a) editing a plurality of modules of source text, said source text for each module being stored in one of a plurality of separate source-text buffers as a plurality of lines;b) compiling said source-text buffers to produce a plurality of code tables, one for each source-text buffer;c) linking items of said code tables to produce a link table;d) executing the code via said code tables and said link table;e) said step of compiling including: i) generating an increment table where each increment represents a lexical increment of said source text and saving said increment table in memory, and skipping lexical increments for which a corresponding increment has been saved from a prior version of said source-text buffer and the corresponding source text has not been changed, ii) detecting semantic increments in said source text, and for each semantic increment, checking to see if the line or lines of said source text corresponding to said semantic increment have been changed, and, if not, skipping said semantic increment and reusing saved code of said skipped semantic increment.
  5. 13
    A method according to any of claims 9 to 12 wherein said plurality of separate source-text buffers, said plurality of code tables, said increment tables, and said link table, are all saved in virtual memory after said step of executing and used after another said step of editing.
  6. 14
    A system for use in developing source code, comprising:a) means for editing a module of source text and storing said source text in a source-text buffer as a plurality of lines, each line having an associated change-tag;b) means for compiling said source-text buffer to produce a code table;c) means for linking said code table to produce a code image;d) means for running the code via said code image;e) said means for compiling including: i) means for generating an increment table where each entry represents an increment of said source text in a line, and for saving said increment table in memory, and for skipping increments for which a corresponding entry has been saved from a prior version of said source-text buffer and the corresponding increment has not been changed, ii) means for detecting semantic increments in said source code, and for each semantic increment, checking via said change-tag to see if the line or lines including said statement have been changed, and, if not skipping said semantic increment and reusing code corresponding to said semantic increment.
  7. 16
    A method of incrementally compiling code, comprising the steps of:a) editing a module of source text, said source text being stored in a source-text buffer as a plurality of lines;b) compiling each line of said source text to create code tables for executable statements in said source text, said compiling including: i) generating an increment table where each entry represents a lexical increment of said source text and saving said increment table in memory, and skipping lexical increments for which a corresponding increment has been saved in the increment table from a prior step of compiling said source-­text buffer and the corresponding lines of source text have not been changed.
  8. 18
    A method of developing source code, the steps of:a) editing a module of source text using an editor, said source text being stored in memory in a source-text buffer as a plurality of lines;b) compiling said source-text buffer to produce in memory a code table;c) linking said code table to produce in memory a code image in a buffer;d) running the code from said code image in said buffer.
  9. 21
    A method of developing source code, comprising the steps of:a) editing a module of source text and storing edited source text in memory in a source-text buffer as a plurality of lines, each line having an associated change-tag indicating whether or not the line has been changed since a previous step of editing said module;b) compiling said source-text buffer to produce a code table in memory;c) linking said code table to produce a code image in a buffer in memory;d) running the code from said code image in said buffer in memory;e) said step of compiling including generating said code tables for executable statements of said source text and generating in memory symbol tables for declarative statements of said source text, each entry in the symbol table corresponding to one of said declarative statements;f) said step of linking including generating a link table in memory where each entry in said link table includes an identification and location of an element needed by or supplied by said code table, and including matching said elements needed or supplied in said link table and generating in memory a link list used in said step of running.
  10. 24
    In a method of compiling code, the steps of:a) editing a module of source text, said source text being stored in a source-text buffer as a plurality of lines;b) compiling said source-text buffer to produce a code table;c) linking said code table to produce a link table;d) running the code via said code table and link table;e) said step of compiling including scanning lines of said source text to generate a table of lexical increments of said source text, and saving said lexical increment table in memory, said scanning including skipping lexical increments for which corresponding lexical increments have been saved from a prior step of scanning and related source text lines have not been changed.
  11. 27
    A method of developing source code, comprising the steps of:a) editing a module of source text using an editor, said source text being stored in a source-text buffer as a plurality of lines;b) compiling said source-text buffer to produce a code table in memory;c) linking said code table to produce a link table in a buffer in memory;d) running the code from memory via said code table and said link table;e) said step of compiling including scanning lines of said source text to generate a table of lexical increments of said source text, and saving said lexical increment table in memory, said scanning including skipping lexical increments for which corresponding lexical increments have been saved from a prior step of scanning and related source text lines have not been changed.
  12. 29
    A method of linking, comprising the steps of:a) editing a module of source text and storing edited source text in a source-text buffer;b) compiling said source-text buffer to produce a code table in memory;c) linking said code table to produce a code image in a buffer in memory;d) running the code via said code image;e) said step of compiling including scanning each line of said source text and generating code to build said code table for executable statements of said source text and to generate a symbol table for declarative statements in said source text;f) said step of linking including: i) generating a link table in memory where entries in said link table include an identification and location of an element needed by or supplied by said code table;ii) matching said elements needed or supplied in said link table and generating a link list;g) and, after completing or terminating said steps of compiling, linking or running, saving said link table and said link list in memory for reuse following another step of editing.
  13. 32
    A method of developing source code, comprising the steps of:a) editing a module of source text and storing edited source text in a source-text buffer as a plurality of lines, each line having an associated change-­tag indicating whether or not the line has been changed since a previous step of editing said module;b) compiling said source-text buffer to produce a code table in memory;c) linking said code table to produce a code image in a buffer in memory;d) running the code via said code image;e) said step of compiling including scanning a representation of each line of said source text to generate code to build said code table for executable statements of said source text and to generate a symbol table for declarative statements in said source text, each entry in the symbol table corresponding to one of said declarative statements;f) said step of linking including generating a link table in memory where entries in said link table include an identification and location of an element needed by or supplied by said code table, and including matching said elements needed or supplied in said link table and generating a link list used in said step of running, and including checking via said change-tag to determine if each of said entries and said link list may be reused;g) and, after completing or terminating said steps of compiling, linking or running, saving said link table and said link list in memory for reuse following another step of editing.
  14. 34
    A system for linking code, comprising:i) means for generating a link table in memory wherein entries in said link table include an identification and location of an element needed by or supplied by a code table produced by a compiler;ii) means for matching said elements needed or supplied in said link table and generating a link list;and iii) means for saving said link table and said link list in memory for reuse following another step of editing, after completing or terminating said compiling, linking or running.
  15. 37
    A method of performing an incremental dependency analysis in compiling source code, comprising the steps of:a) editing a plurality of modules of source text using an editor, said source text being stored in memory in a plurality of source-text buffers as a plurality of lines;b) performing a dependency analysis on said plurality of source-text buffers while said buffers are in memory, said dependency analysis including finding in each of said buffers in lines which have been changed statements dependent upon statements in other of said buffers to thereby select buffers which must be compiled;b) incrementally compiling said selected source-text buffers to generate or update a plurality of code tables;c) linking said code tables to produce a link table in a buffer;and d) running the code from said code tables and said link table.
  16. 39
    A method of developing source code, comprising the steps of:a) editing a module of source text and storing edited source text in memory in a source-text buffer as a plurality of lines, each line having an associated change-tag indicating whether or not the line has been changed since a previous step of editing said module;b) performing a dependency analysis on said plurality of source-text buffers while said buffers are in memory, said dependency analysis including finding in each of said buffers in lines which have been changed statements dependent upon statements in other of said buffers to thereby select buffers which must be compiled;c) compiling said source-text buffer to generate or update a code table in memory;d) linking said code table to produce a link table in a buffer in memory;e) running the code from said code table and said link table in said buffer in memory;f) said step of compiling including generating code to build said code table from executable statements, and including generating symbol table from declarative statements in said source-text buffer in memory;g) said step of linking including generating said link table in memory where each entry in said link table is an identification and location of an element needed by or supplied by said code table, and including matching said elements needed or supplied in said link table.
  17. 41
    A method of compiling code, comprising the steps of:a) editing a module of source text, said source text being stored in a source-text buffer as a plurality of lines;b) compiling said source text to create code tables, said compiling including: i) scanning said source text buffer to generate a table of lexical increments corresponding to lines of said source text, and, if the line of source text including a lexical increment has not been changed during said step of editing, skipping said lexical increment in said scanning.
  18. 43
    A method of developing source code, comprising the steps of:a) editing a module of source text, said source text being stored in a source-text buffer as a plurality of lines;b) compiling said source-text buffer to produce a code table;c) linking said code table to generate a link table;d) running the code via said code table and said link table;e) said step of compiling including: i) scanning said source text buffer to generate a table of lexical increments corresponding to lines of said source text, and, if the line of source text including a lexical increment has not been changed during said step of editing, skipping said lexical increment in said scanning;g) said step of linking including generating a link table where each entry in said link table includes an identification and location of an element needed by or supplied by said code table, and including matching said elements needed or supplied in said link table.
  19. 45
    A method of developing source code, comprising the steps of:a) editing a plurality of modules of source text, said source text for each module being stored in one of a plurality of separate source-text buffers as a plurality of lines;b) compiling said source-text buffers to produce a plurality of code tables, one for each source-text buffer;c) linking each of said code tables to produce a link table;d) running the code via said code tables and said link table;e) said step of compiling including, for each one of said source-text buffers: i) scanning said source text buffer to generate a table of lexical increments corresponding to lines of said source text, and, if the line of source text including a lexical increment has not been changed during said step of editing, skipping said lexical increment in said scanning.
  20. 48
    A method of managing a virtual memory system, said virtual memory system having a paged virtual memory, a volatile memory and a non-volatile storage, said volatile memory having much faster access than said non-volatile storage, comprising the steps of:a) storing in virtual memory a plurality of separate data modules, said modules being of variable size, each module being stored on a separate page or pages of said virtual memory with no interleaved data regardless of the size of the module;b) storing in virtual memory the code for a plurality of separate operating phases each of which may perform some operation on one or more of said data modules;c) swapping pages of at least one of said data modules and pages of said code for at least one of said operating phases from said non-volatile storage to said volatile memory for execution of each of said operating phases;d) and reallocating said data modules after each one of said operating phases are performed thereon to maintain each said modules in a page or pages with no interleaved data.
  21. 52
    A method of executing a source-code development program using a computer having a virtual memory system, said virtual memory system having a paged virtual memory, a real memory and disk storage, comprising the steps of:a) editing a plurality of separate data modules including source-code text modules, said modules being of variable size, each module being stored in virtual memory on a separate page or pages of said virtual memory with no interleaved data regardless of the size of the module;b) storing in virtual memory the code for a plurality of separate operating phases of said development program, said operating phases including phases of said editing and also compiling and linking, each of said phases performing an operation on one or more of said data modules;c) moving pages of at least one of said data modules and pages of said code for at least one of said operating phases to said real memory for execution of said operating phases;d) and reallocating said data modules and said tables after said operating phases are performed thereon to maintain each of said data modules and tables in pages with no interleaved data.
  22. 54
    A method of performing a source-code development program using a computer having a virtual memory system, said virtual memory system having a paged virtual memory, a real memory and disk storage, comprising the steps of:a) storing in virtual memory a plurality of separate data modules including source-code text modules, said modules being of variable size, each module being stored on a separate page or pages of said virtual memory with no interleaved data regardless of the size of the module;b) storing in virtual memory the code for a plurality of separate operating phases of said development program, each of said phases performing some operation on one or more of said data modules;c) moving pages of at least one of said data modules and pages of said code for at least one of said operating phases to said real memory for execution of said operating phases;d) and reallocating said data modules after said operating phases are performed thereon to maintain each said modules in pages with no interleaved data.
Independent claims22