# 2 - Reserved Word: import Reserved...

This preview shows pages 1–4. Sign up to view the full content.

<program> <importStmt> Reserved Word: import Reserved Word: java . Reserved Word: util . Reserved Word: Scanner ; ... node has no more children Reserved Word: class IDENTIFIER: CS316ex2 [not in symbol table] { <dataFieldDecl> Reserved Word: static <varDecl> Reserved Word: int <singleVarDecl> IDENTIFIER: numrings [not in symbol table] ... node has no more children , <singleVarDecl> IDENTIFIER: movesrequired [not in symbol table] ... node has no more children ; ... node has no more children ... node has no more children <mainDecl> Reserved Word: public Reserved Word: static Reserved Word: void Reserved Word: main ( Reserved Word: String IDENTIFIER: args [not in symbol table] [ ] ) *** Generating: 0: INITSTKFRM ? <compoundStmt> { <statement> <outputStmt> Reserved Word: System . Reserved Word: out . Reserved Word: print ( <printArgument> *** Generating: 1: WRITESTRING 2 54 CHARACTER STRING LITERAL: "Nonrecursive Solution to the Tower of Hanoi Problem " ... node has no more children ) ; ... node has no more children

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
... node has no more children <statement> <assignmentOrInvoc> IDENTIFIER: howmanyrings [not in symbol table] <argumentList> ( ) ... node has no more children *** Generating: 2: CALLSTATMETHOD ? *** Generating: 3: NOPorDISCARDVALUE ; ... node has no more children ... node has no more children <statement> <assignmentOrInvoc> IDENTIFIER: howmanymoves [not in symbol table] <argumentList> ( ) ... node has no more children *** Generating: 4: CALLSTATMETHOD ? *** Generating: 5: NOPorDISCARDVALUE ; ... node has no more children ... node has no more children <statement> <assignmentOrInvoc> IDENTIFIER: writemoves [not in symbol table] <argumentList> ( ) ... node has no more children *** Generating: 6: CALLSTATMETHOD ? *** Generating: 7: NOPorDISCARDVALUE ; ... node has no more children ... node has no more children } ... node has no more children *** Fixed Up: 0: INITSTKFRM 0 *** Generating: 8: STOP ... node has no more children <methodDecl> Reserved Word: static Reserved Word: void *** Fixed Up: 3: NOP *** Fixed Up: 2: CALLSTATMETHOD 9 *** Generating: 9: INITSTKFRM ? IDENTIFIER: howmanyrings [method (start address = 9)] ( <parameterDeclList> <empty> ... node has no more children ) <compoundStmt> { <statement> <varDecl> Reserved Word: Scanner
IDENTIFIER: userInput [local Scanner] = Reserved Word: new Reserved Word: Scanner ( Reserved Word: System . Reserved Word: in ) ; ... node has no more children ... node has no more children <statement> <outputStmt> Reserved Word: System . Reserved Word: out . Reserved Word: print ( <printArgument> *** Generating: 10: WRITESTRING 55 77 CHARACTER STRING LITERAL: "Enter number of rings: " ... node has no more children ) ; ... node has no more children ... node has no more children <statement> <assignmentOrInvoc> IDENTIFIER: numrings [static var (address = 0)] *** Generating: 11: PUSHSTATADDR 0 = <expr3> <expr2> <expr1> IDENTIFIER: userInput [local Scanner] . Reserved Word: nextInt

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 06/05/2010 for the course COMPUTER S 700 taught by Professor Joewhite during the Spring '10 term at Universidad San Martín de Porres.

### Page1 / 25

2 - Reserved Word: import Reserved...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online