← Back to Patent Explorer
US5386570A Expired / Lapsed US ⏱️ 0.0 years remaining

Method for a two pass compiler with the saving parse states from first to second pass

Assignee: Hewlett Packard Development Co LP
•
Filing: 1993-05-24
•
Granted: 1995-01-31
•
Expires: 2013-05-24
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract A system which scans and parses input source code of a computer programming language during a first pass, and saves the parse states to be replayed during a second pass. Therefore, the source file is not rescanned nor is it reparsed during the second pass. The parse states are replayed during the second pass, reexecuting all the parser actions in the grammar in the same order during the second pass that they were originally recorded during the actual parsing in the first pass. This eliminates the need to rescan and reparse the original input language, reducing the processing time of the compiler. The user specifies what code is to be executed during each pass, and the system also provides facilities for communication between the passes.

Inventors

  • 👤 Gregory S. Lindhorst

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-11-02 15:44
CPC Classifications
G; G06; G06F; G06F8/00; G06F8/40; G06F8/41; G06F8/42; G06F8/427

Claims Analysis

Total Claims: 32
Claim 1
Independent Claim 252 words
A computer implemented method for compiling a first computer language into a second computer language, wherein said compiling requires at least two compilation passes, said computer implemented method comprising the steps of: reading a compiler definition file containing a plurality of definitions of parser states for compiling said first computer language into said second computer language, and wherein said compiler definition file further contains at least one production function for execution during at least one of said parser states; and processing said compiler definition file to compile said first computer language and create said second computer language, comprising the steps of performing a first compilation pass comprising the steps of reading a source file containing statements of said first computer language and creating a plurality of tokens, one for each symbol contained in each of said statements of said source file, parsing said tokens to determine which of said plurality of parser states to perform for said tokens, wherein said parsing defines an order of performing each of said parser states, executing all said production functions identified for execution during performance of each of said plurality of parser states, and writing said parser states to a data storage area in said order of performing, performing a second pass comprising the steps of retrieving said parser states from said data storage area in said order of performing, and executing all said production functions identified for execution during performance of each of said parser states, wherein said production functions create said second computer language.
Claim 2
Dependent Claim 252 words
A computer implemented method for compiling a first computer language into a second computer language, wherein said compiling requires at least two compilation passes, said computer implemented method comprising the steps of: reading a compiler definition file containing a plurality of definitions of parser states for compiling said first computer language into said second computer language, and wherein said compiler definition file further contains at least one production function for execution during at least one of said parser states; and processing said compiler definition file to compile said first computer language and create said second computer language, comprising the steps of performing a first compilation pass comprising the steps of reading a source file containing statements of said first computer language and creating a plurality of tokens, one for each symbol contained in each of said statements of said source file, parsing said tokens to determine which of said plurality of parser states to perform for said tokens, wherein said parsing defines an order of performing each of said parser states, executing all said production functions identified for execution during performance of each of said plurality of parser states, and writing said parser states to a data storage area in said order of performing, performing a second pass comprising the steps of retrieving said parser states from said data storage area in said order of performing, and executing all said production functions identified for execution during performance of each of said parser states, wherein said production functions create said second computer language.
Claim 3
Dependent Claim 46 words
The computer implemented method of claim 1 wherein each of said production functions is specified for execution during said first compilation pass, or specified for execution during said second compilation pass, or specified for execution during both said first compilation pass and said second compilation pass.
Claim 4
Dependent Claim 69 words
The computer implemented method of claim 1 further comprising the step of saving data during execution of at least one of said production functions executed during said first compilation pass, and restoring said saved data during execution of said production function during said second pass, wherein said data is saved and restored at a same location in said order of performing said parser states in each of said passes.
Claim 5
Dependent Claim 22 words
The computer implemented method of claim 3 wherein said saving and restoring said data occurs between performing each of said parser states.
Claim 6
Dependent Claim 28 words
The computer implemented method of claim 3 wherein said saving and restoring said data occurs when a predefined production function is executed in each of said compilation passes.
Claim 7
Dependent Claim 30 words
The computer implemented method of claim 1 further comprising the step of identifying at least one production function in said first compilation pass for execution in said second compilation pass.
Claim 8
Dependent Claim 56 words
The computer implemented method of claim 6 further comprising the step of saving parameter data to be passed to said at least one production function in said first compilation pass and passing said parameter data to said at least one production function when said at least one production function is executed in said second compilation pass.
Claim 9
Dependent Claim 60 words
The computer implemented method of claim 1 further comprising the step of suspending processing of said first compilation pass, performing said second compilation pass to process all said parse states stored in said data storage area in said second compilation pass, and resuming processing of said first pass, when a predefined production function is executed during said first compilation pass.
Claim 10
Dependent Claim 87 words
The computer implemented method of claim 1 further comprising the step of saving data during execution of at least one of said production functions executed during said first compilation pass, and restoring said saved data during execution of said production function during said second compilation pass, wherein said data is saved at a first location in said order of performing said parser states in said first compilation pass and restored at an earlier location in said order of performing said parser states in said second compilation pass.
Claim 11
Dependent Claim 47 words
The computer implemented method of claim 9 wherein a location for said saving is identified when a first predefined production function is executed in said first compilation pass, and wherein said data is saved when a second predefined production function is executed in said first compilation pass.
Claim 12
Dependent Claim 349 words
A computer fmplemented method for compiling a first computer language into a second computer language, wherein said compiling requires at least two compilation passes, said computer implemented method comprising the steps of: reading a compiler definition file containing a plurality of definitions of parser states for compiling said first computer language into said second computer language, and wherein said compiler definition file further contains at least one production function for execution during at least one of said parser states, and wherein each of said at least one production function is specified for execution in either a first compilation pass, specified for execution in a second compilation pass or specified for execution in both said first and said second compilation passes; and processing said compiler definition file to compile said first computer language and create said second computer language, comprising the steps of performing said first compilation pass comprising the steps of reading a source file containing statements of said first computer language and creating a plurality of tokens, one for each symbol contained in each of said statements of said source file, parsing said tokens to determine which of said plurality of parser states to perform for said tokens, wherein said parsing defines an order of performing each of said parser states, executing all said production functions specified for execution during performance of each of said plurality of parser states in said first compilation pass and executing all said production functions specified for execution during performance of each of said plurality of parser states in both said compilation passes, and writing said parser states to a data storage area in said order of performing, performing said second pass comprising the steps of retrieving said parser states from said data storage area in said order of performing, and executing all said production functions specified for execution during performance of each of said parser states in said second compilation pass and executing all said production functions specified for execution during performance of each of said parser states in both said compilation passes, wherein said production functions create said second computer language.
Claim 13
Dependent Claim 349 words
A computer fmplemented method for compiling a first computer language into a second computer language, wherein said compiling requires at least two compilation passes, said computer implemented method comprising the steps of: reading a compiler definition file containing a plurality of definitions of parser states for compiling said first computer language into said second computer language, and wherein said compiler definition file further contains at least one production function for execution during at least one of said parser states, and wherein each of said at least one production function is specified for execution in either a first compilation pass, specified for execution in a second compilation pass or specified for execution in both said first and said second compilation passes; and processing said compiler definition file to compile said first computer language and create said second computer language, comprising the steps of performing said first compilation pass comprising the steps of reading a source file containing statements of said first computer language and creating a plurality of tokens, one for each symbol contained in each of said statements of said source file, parsing said tokens to determine which of said plurality of parser states to perform for said tokens, wherein said parsing defines an order of performing each of said parser states, executing all said production functions specified for execution during performance of each of said plurality of parser states in said first compilation pass and executing all said production functions specified for execution during performance of each of said plurality of parser states in both said compilation passes, and writing said parser states to a data storage area in said order of performing, performing said second pass comprising the steps of retrieving said parser states from said data storage area in said order of performing, and executing all said production functions specified for execution during performance of each of said parser states in said second compilation pass and executing all said production functions specified for execution during performance of each of said parser states in both said compilation passes, wherein said production functions create said second computer language.
Claim 14
Dependent Claim 69 words
The computer implemented method of claim 11 further comprising the step of saving data during execution of at least one of said production functions executed during said first compilation pass, and restoring said saved data during execution of said production function during said second pass, wherein said data is saved and restored at a same location in said order of performing said parser states in each of said passes.
Claim 15
Dependent Claim 22 words
The computer implemented method of claim 12 wherein said saving and restoring said data occurs between performing each of said parser states.
Claim 16
Dependent Claim 28 words
The computer implemented method of claim 12 wherein said saving and restoring said data occurs when a predefined production function is executed in each of said compilation passes.
Claim 17
Dependent Claim 30 words
The computer implemented method of claim 11 further comprising the step of identifying at least one production function in said first compilation pass for execution in said second compilation pass.
Claim 18
Dependent Claim 56 words
The computer implemented method of claim 15 further comprising the step of saving parameter data to be passed to said at least one production function in said first compilation pass and passing said parameter data to said at least one production function when said at least one production function is executed in said second compilation pass.
Claim 19
Dependent Claim 60 words
The computer implemented method of claim 11 further comprising the step of suspending processing of said first compilation pass, performing said second compilation pass to process all said parse states stored in said data storage area in said second compilation pass, and resuming processing of said first pass, when a predefined production function is executed during said first compilation pass.
Claim 20
Dependent Claim 87 words
The computer implemented method of claim 11 further comprising the step of saving data during execution of at least one of said production functions executed during said first compilation pass, and restoring said saved data during execution of said production function during said second compilation pass, wherein said data is saved at a first location in said order of performing said parser states in said first compilation pass and restored at an earlier location in said order of performing said parser states in said second compilation pass.
Claim 21
Dependent Claim 47 words
The computer implemented method of claim 18 wherein a location for said saving is identified when a first predefined production function is executed in said first compilation pass, and wherein said data is saved when a second predefined production function is executed in said first compilation pass.
Claim 22
Dependent Claim 258 words
A computer implemented method for compiling a first computer language into a second computer language, wherein said compiling requires at least two compilation passes, said computer implemented method comprising the steps of: reading a compiler definition file containing a plurality of definitions of parser states for compiling said first computer language into said second computer language, and wherein said compiler definition file further contains at least one production function for execution during at least one of said parser states; and processing said compiler definition file to compile said first computer language and create said second computer language, comprising the steps of performing a scan compilation pass comprising the steps of reading a source file containing statements of said first computer language and creating a plurality of tokens, one for each symbol contained in each of said statements of said source file, parsing said tokens to determine which of said plurality of parser states to perform for said tokens, wherein said parsing defines an order of performing each of said parser states, executing all said production functions identified for execution during performance of each of said plurality of parser states, and writing said parser states to a data storage area in said order of performing, performing at least one pass subsequent to said scan pass comprising the steps of retrieving said parser states from said data storage area in said order of performing, and executing all said production functions identified for execution during performance of each of said parser states, wherein said production functions create said second computer language.
Claim 23
Dependent Claim 258 words
A computer implemented method for compiling a first computer language into a second computer language, wherein said compiling requires at least two compilation passes, said computer implemented method comprising the steps of: reading a compiler definition file containing a plurality of definitions of parser states for compiling said first computer language into said second computer language, and wherein said compiler definition file further contains at least one production function for execution during at least one of said parser states; and processing said compiler definition file to compile said first computer language and create said second computer language, comprising the steps of performing a scan compilation pass comprising the steps of reading a source file containing statements of said first computer language and creating a plurality of tokens, one for each symbol contained in each of said statements of said source file, parsing said tokens to determine which of said plurality of parser states to perform for said tokens, wherein said parsing defines an order of performing each of said parser states, executing all said production functions identified for execution during performance of each of said plurality of parser states, and writing said parser states to a data storage area in said order of performing, performing at least one pass subsequent to said scan pass comprising the steps of retrieving said parser states from said data storage area in said order of performing, and executing all said production functions identified for execution during performance of each of said parser states, wherein said production functions create said second computer language.
Claim 24
Dependent Claim 59 words
The computer implemented method of claim 20 wherein each of said production functions is specified for execution during said scan compilation pass, or specified for execution during said at least one pass subsequent to said scan compilation pass, or specified for execution during said scan compilation pass and said at least one pass subsequent to said scan compilation pass.
Claim 25
Dependent Claim 74 words
The computer implemented method of claim 20 further comprising the step of saving data during execution of at least one of said production functions executed during said scan compilation pass, and restoring said saved data during-execution of said production function during said second pass, wherein said data is saved and restored at a same location in said order of performing said parser states in each of said passes subsequent to said scan compilation pass.
Claim 26
Dependent Claim 22 words
The computer implemented method of claim 22 wherein said saving and restoring said data occurs between performing each of said parser states.
Claim 27
Dependent Claim 28 words
The computer implemented method of claim 22 wherein said saving and restoring said data occurs when a predefined production function is executed in each of said compilation passes.
Claim 28
Dependent Claim 37 words
The computer implemented method of claim 20 further comprising the step of identifying at least one production function in said scan compilation pass for execution in said at least one pass subsequent to said scan compilation pass.
Claim 29
Dependent Claim 63 words
The computer implemented method of claim 25 further comprising the step of saving parameter data to be passed to said at least one production function in said scan compilation pass and passing said parameter data to said at least one production function when said at least one production function is executed in said at least one pass subsequent to said scan compilation pass.
Claim 30
Dependent Claim 63 words
The computer implemented method of claim 20 further comprising the step of suspending processing of said scan compilation pass, performing said at least one pass subsequent to said scan compilation pass to process all said parse states stored in said data storage area, and resuming processing of said scan compilation pass, when a predefined production function is executed during said scan compilation pass.
Claim 31
Dependent Claim 101 words
The computer implemented method of claim 20 further comprising the step of saving data during execution of at least one of said production functions executed during said scan compilation pass, and restoring said saved data during execution of said production function during said at least one pass subsequent to said scan compilation pass, wherein said data is saved at a first location in said order of performing said parser states in said scan compilation pass and restored at an earlier location in said order of performing said parser states in said at least one pass subsequent to said scan compilation pass.
Claim 32
Dependent Claim 47 words
The computer implemented method of claim 28 wherein a location for said saving is identified when a first predefined production function is executed in said scan compilation pass, and wherein said data is saved when a second predefined production function is executed in said scan compilation pass.

References Cited (Backward Citations)

US4667290A Cited
US4914585A Cited
US5170456A Cited
US5230049A Cited
US5182806A Cited
US5193191A Cited
US5276881A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 1998-01-30 1998-08-01 1999-01-31 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2002-01-30 2002-08-01 2003-01-31 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2006-01-30 2006-08-01 2007-01-31 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag