Interface for symbol table construction in a multilanguage optimizing compiler
First Claim
1. A method, executed in a computer system, for providing type information about a source program, the method comprising the steps of:
- producing a type node by a compiler front end calling a service routine that creates and stores the type node at a first address in a memory, said compiler front end performing syntactic and semantic processing of a programming language, said type node describing a data type that belongs to said programming language and is used in a source program that is stored in the memory and includes one or more source statements written in said programming language, said service routine being a routine in a compiler back end and being called by a plurality of different compiler front ends, each of said different compiler front ends performing syntactic and semantic processing of a different programming language;
generating, using the source program and the compiler front end, a symbol table that includes said type node; and
generating, using said symbol table and said compiler back end, type information that is described by said type node and an object module for use in a target computer system, said object module and said type information being used in producing a machine executable program for said target computer system, said type information and said object module corresponding to said source program.
2 Assignments
0 Petitions
Accused Products
Abstract
A compiler framework uses a generic "shell" and a generic back end (where the code generator is target-specific). The generic back end provides the functions of optimization, register and memory allocation, and code generation. The code generation function of the back end may be targeted for any of a number of computer architectures. A front end is tailored for each different source language, such as Cobol, Fortran, Pascal, C, C++, etc. The front end scans and parses the source code modules, and generates from them an intermediate language representation of the source code programs expressed in the source code. The intermediate language represents any of the source code languages in a universal manner, so the interface between the front end and back end is of a standard format, and need not be rewritten for each language-specific front end. A feature is the type definition (TD) mechanism, referred to a the TD module. This module provides mechanisms used by the front end and the compiler of the back end in constructing program "type-information" to be incorporated in an object module for use by a linker or debugger. The creation of "type-information" takes place in the context of symbol table creation and allows a front end to specify to the back end an abstract representation of program type information. The TD module provides service routines that allow a front end to describe basic types and abstract types.
167 Citations
21 Claims
-
1. A method, executed in a computer system, for providing type information about a source program, the method comprising the steps of:
-
producing a type node by a compiler front end calling a service routine that creates and stores the type node at a first address in a memory, said compiler front end performing syntactic and semantic processing of a programming language, said type node describing a data type that belongs to said programming language and is used in a source program that is stored in the memory and includes one or more source statements written in said programming language, said service routine being a routine in a compiler back end and being called by a plurality of different compiler front ends, each of said different compiler front ends performing syntactic and semantic processing of a different programming language; generating, using the source program and the compiler front end, a symbol table that includes said type node; and generating, using said symbol table and said compiler back end, type information that is described by said type node and an object module for use in a target computer system, said object module and said type information being used in producing a machine executable program for said target computer system, said type information and said object module corresponding to said source program. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
-
12. A memory comprising:
-
a compiler front end that performs syntactic and semantic processing of a programming language; producing means, coupled to said compiler front end, for producing a type node which describes a data type that belongs to said programming language and that is used in a source program including one or more source statements written in said programming language, said producing means including a service routine that is included in a compiler back end and that is called by said compiler front end to create said type node; means for generating, using said source program and said compiler front end, a symbol table that includes said type node; and means for generating, using said symbol table and said compiler back end, type information that is described by said type node and an object module used in a target computer system, said object module and said type information being used to produce a machine executable program for said target computer system, said type information and said object module corresponding to said source program. - View Dependent Claims (13, 14, 15, 16)
-
-
17. A method, executed in a computer system, of producing debug type information, the method comprising the steps of:
-
producing, using a compiler front end that performs syntactic and semantic processing of a first programming language, a type node describing a data type of said programming language, said compiler front end calling a service routine that creates said type node as a first data structure in a memory at a first memory location and returns to said compiler front end an address handle corresponding to said first memory location, said service routine constructing and managing a list of type nodes that it has created in response to calls from said compiler front end, said list being stored in said memory at a second memory location; generating, using said source program and said compiler front end, a symbol table that includes a symbol node that is a second data structure and represents a program symbol in said source program, said symbol table includes a block node that is a third data structure and corresponds to a portion of said source program in which said program symbol is used, said program symbol being of said data type described by said the node and said symbol node including said first address handle, said type node is associated with said symbol node identifying said program symbol as being said data type, said block node comprising a list address handle denoting said second memory location; and generating, using said symbol table, a debug symbol table that includes debug type information about said source program, said debug type information being described by said type node and representing said program symbol being of said data type. - View Dependent Claims (18, 19, 20, 21)
-
Specification