UD CISC 672 - Phase 4 : Code Generation (6 pages)

Previewing pages 1, 2 of 6 page document View the full content.
View Full Document

Phase 4 : Code Generation



Previewing pages 1, 2 of actual document.

View the full content.
View Full Document
View Full Document

Phase 4 : Code Generation

81 views

Other


Pages:
6
School:
University of Delaware
Course:
Cisc 672 - Compiler Construction
Compiler Construction Documents

Unformatted text preview:

Phase 4 Code Generation Program java public void cgen PrintWriter s CgenClassTable cct new CgenClassTable getClasses s codeGeneration CgenClassTable java The following steps are performed in the constructor try installBasicClasses installClasses cls buildInheritanceTree code exitScope catch NoScopePresentException e Utilities fatalError e Generating code for classes installClasses cls would generate the code for all the classes by iterating through all the classes code performs all the data related functions and the in the last line calls codeMethods codeMethods functioncalls the treeNodes Method cgen function which needs to be implemented by you treeNodes Method cgen This might look familiar to you now public void cgen java io PrintWriter str codeGeneration CgenNode cls cls setMethodFormals formals expr cgen str cls Implement all cgen java io PrintWriter str codeGeneration CgenNode cls methods in treeNodes classes Tips Look at spim pdf if you would like to look at the instrction set Compare the code generated by the binary and use diff to find places where you might be going wrong



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Phase 4 : Code Generation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Phase 4 : Code Generation and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?