Skip to main content
Home Documents Macintosh Pascal To Smalltalk
Pascal To Smalltalk

Pascal To Smalltalk

Macintosh · 1985 · PDF
FilenamePascal_to_Smalltalk_19850411.pdf
Size0.28 MB
Year1985
Subsection developer / MacApp
Downloads2
Enjoying MacTrove? Anonymous downloads are free and unlimited. Create a free account to track favorites, contribute metadata corrections, and join the community chat.
Reader
Pascal To Smalltalk
/
Loading…
OCR / Text contents
Pascal to Smalltalk Barry Haynes April 11, 1985 Current Status A new class, PascalCodeParser has been created. lt is a subclass of Parser that parses Pascal source code to produce a Smalltalk parse tree. From this parse tree, Smalltalk source is created and each method is added to the Smalltalk class that should include that method. Currently, the user must create the Smalltalk class manually. All methods are automatically placed in a category called pascal source. PascalCodeParser can now handle parsing procedures and functions and converting Pascal formal parameters into Smalltalk keyword parameters. lt converts simple local variables from Pascal to Smalltalk. Pascal expressions and assignment statements are correctly converted into equivalent Smalltalk statements. Handling function return results is also implemented. At this point, we know the basic conversion mechanism works. All that is required ·to do complete conversion from Pascal to Smalltalk is Smalltalk methods and a scheme for each of the parts of the Pascal railroad diagrams that have not yet been · implemented. The rest of this memo deals with these issues and problems that must be resolved to finish the job. lssues for the Rest of the Conversion 1. In general it is assumed the Object Pascal that is being translated has been compiled, has no syntax errors and is correct, complete Object Pascal in every way. 2.lt will be assumed that real numbers are not used in the Pascal that is being translated. · 3.Globals could be handled in the following way. For MacApp itself, global variables and constants can be added as class variables to class TObject. For the case of constants, code will be added to TObject initialize toset the constants to the correct values. Fora particular application, globals and constants declared in the interface and implementation of that application will be stored in a shared pool shared by all classes of that application. The shared pool will be initialized by the initialize method of whatever class the parser comes comes across first. lt is generally assumed this will be a sub-class of TApplication. 4. There will be a symbol table that will remember needed information about particular types and variables, like if it is an array or a PascalRecord. Variables that require a PascalRecord will have code generated in either the appropriate class initialize method or the local method, depending on where the Variable is located, to create the PascalRecord. 5.Both the interface and implementation of MacApp or a specific application will have to be parsed. This will allow the parser to know about the types of all variables. The parser will need to know about global procedures as well as methods that haven't yet been parsed. Only by parsing the interfaces first can this information be obtained. Procedures that are global to MacApp will be defined as class methods of TObject. Procedures that are global to a particular application will be defined as class methods of the …

Showing first 3,000 characters of 12,551 total. Open the full document →

Home Documents Macintosh Object Pascal For The Macintosh
Object Pascal For The Macintosh

Object Pascal For The Macintosh

Macintosh · 1985 · PDF
FilenameObject_Pascal_For_The_Macintosh_19850214.pdf
Size0.81 MB
Year1985
Subsection developer / MacApp
Downloads2
Enjoying MacTrove? Anonymous downloads are free and unlimited. Create a free account to track favorites, contribute metadata corrections, and join the community chat.
Reader
Object Pascal For The Macintosh
/
Loading…
OCR / Text contents
Object Pascal For. the Macintosh Larry Tesler February 14, 1985 lntroduction The specification of the. language Object Pascal appears in theObject Pascal Report, ~ttached. The present memo specifies differences between the current Macintosh imp_lementation änd the specification. In cases noted as "temporary deviations", we intend to bring the implementation into conformance shortly. Multi-Level "inherited" According to the standard, the statement "inherited Draw" activates a method of the immediate ancestor of the type whose method contains the statement. In the Macintosh versicin~ if a more remote ancestral type, T, has a different implementation of the same method, then that method can be invoked by T. Draw. This feature is rarely used. Object Type Declaratlons According to the standard. an obj~ct type declaration may appear in a main program, in the interfäce of ä unit, or in_ the implementation of a unit. In the Macintosh version, it can_.on,fy appear.in fhe interface of a unit. Method declarations can only appear in the i~plementation of ttie same untt. These d~viations are temporary. · ··. According·to the standard; it i·s an error if a method is declared override in the type ·dectaration and then not implemented, or if an override method is implemented but not decfared override. In the Macintosh Version, the compiler does not check for these errors. This is a temporary deviation. Aqcording to the standard, the oame of a method in a method header is qualified by · the type name when the method body is introduced but not in the type declaration. In the Macintosh version, qualification is permitted in the type declaration. Range Checklng Accordi.ng·to the standard, it is an error to coerce a value to an object type if it is not in the domain ofthat type.· In the Macintosh version, if and only if the compiler switch {$R+} is in effect, the compiler generates code to test the validity of object-type coercions. Object Pascal for the Macintosh Page 2 Unsafe Use of Handles According to the standard, the implementation of a reference is not specified, and may be machine dependent. In the Macintosh version, an object reference is implemented as a handle, i.e., as a pointer to a pointer to an object. The object itself can change its memory address during execution as part of a compaction process that is invoked to prevent heap fragmentation. Because an object can change its location, it is unsafe to save a pointer to it in a variable or register and then later to access the object through the saved pointer. lf a procedure call should intervene, then the heap might compact to make room for a newly allocated object or to swap the procedure itself into memory, invalidating the pointer. Where possible, the compiler takes care to access objects only through handles and not through pointers. Examples: type T = object F: Integer; S: String[lO]; end; var Y: T; Y.F := Func; Proc(Y.F); with Y do begin F := Func; Proc(F); F := F + 1; DrawString(S); end…

Showing first 3,000 characters of 29,607 total. Open the full document →

Home Documents Macintosh An Introduction To MacApp 0.1
An Introduction To MacApp 0.1

An Introduction To MacApp 0.1

Macintosh · 1985 · PDF
FilenameAn_Introduction_to_MacApp_0.1_19850214.pdf
Size1.08 MB
Year1985
Subsection developer / MacApp
Downloads4
Enjoying MacTrove? Anonymous downloads are free and unlimited. Create a free account to track favorites, contribute metadata corrections, and join the community chat.
Reader
An Introduction To MacApp 0.1
/
Loading…
OCR / Text contents
Date: From: To: January 21, 1985 Larry Tesler ~ Larry Rosenstein, Ken Doyle, Scott Wallace, Gaby Hirl, Dan lngalls, Barry Haynes, Yu Ying Chow, Mark Lentczner, Chris Espinosa, Andy AverilL Scott Knaster, Russ Daniels, Pete Cressman, Judy York, Amy Rapport, Eileen Crombie . . Subject: Bud Tribble, Jerome Coonen, Rony Sebok . . Steve Capps, Martin Haeberli, Rick Meyers, Al Hoffman . . Gursharan Sidhu. . Dan Cochran. . Hasmig Seropian, Cary Clark, Bob Belleville Expandable Application: Release Plan This is a release plan for the Expandable Application (aka Generic Appl ication, Standard Appl ication, Macintosh ToolKit, Vantage). All releases will be made through the Software Library. Non-Apple users will contact Technical Support for help. In turn, Technical Support will forward questions they can't answer to my group. Release 0.0 (•Phi") is planned for January 23, 1985. lts authors were Larry Rosenstein, Scott Wallace, and Ken Ooyle. One of two sample programs is by Gaby Hirl. Release 0.0 is intended for use by Rony Sebok (who is writing an electronic mail user interface)„ Russ Daniels (to prepare for eventual technical support of the product), and Kurt Schmucker and Andy Averilt {to write documentation). lt is missing many smal 1 but critical features; memory management is not yet smart; the Pascal syntax is not the tatest Wirth-approved variety; it is virtually undocumented; it has not been used outside my group. Release D.1 c-·chi•) is planned for February L 1985. The audience wi 11 be expanded to include other Apple employees who program Macintosh appl ications in Pascal, and a number of outside testers to be selected by Scott Knaster and myself. The outside testers wi 11 come from the ranks of university customers and certif ied developers with experiPnce in both Macintosh ToolBox use and object-oriented programming (e.g.„ Lisa Clascal). lt will be like Release 0.0 except it will have the Wirth-approved new syntax, scrap management, and various m inor improvements. We plan ta teach an in-hause course in February based an release 0.1. Release D.3 („Psi„) is planned for March 15, 1985. There will a little more documentation. The audience will be enlarged to include some outside testers with no specific prior experience. The capabilities will be expanded to include smarter memory management and to t ie other loose ends. Release 0.5 („Omega•) is planned for April 241 1985. lt will have the final architecture and fairly complete documentation. The audience wi 11 be expanded to include as many developers as we can suppart. Release 0.5 wi 11 never be a „Product 11 because the Lisa Workshop wil 1 be needed to compi lel 1 but it should make Macintosh application development easier for Lisa owners. Release 0. 7 („Alpha") is planned for around June 1, actually, one month after the later of: Release 0.5; Alpha of the New Macintosh Development System. This version will be compatible with Objective C, support applications in assembler . . and suppor…

Showing first 3,000 characters of 44,536 total. Open the full document →

Subscribe to MacApp
mp.ls