8 - <program> <importStmt> Reserved Word:...

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

View Full Document Right Arrow Icon
<program> <importStmt> Reserved Word: import Reserved Word: java . Reserved Word: util . Reserved Word: Scanner ; ... node has no more children Reserved Word: class IDENTIFIER: CS316ex8 [not in symbol table] { <dataFieldDecl> Reserved Word: static <varDecl> Reserved Word: int <singleVarDecl> IDENTIFIER: i [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> <varDecl> Reserved Word: Scanner IDENTIFIER: KB [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
Background image of page 1

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

View Full DocumentRight Arrow Icon
( <printArgument> <expr3> <expr2> <expr1> *** Generating: 1: PUSHNUM 9999 UNSIGNED INTEGER LITERAL: 9999 ... node has no more children ... node has no more children ... node has no more children *** Generating: 2: WRITEINT ... node has no more children ) ; ... node has no more children ... node has no more children <statement> <outputStmt> Reserved Word: System . Reserved Word: out . Reserved Word: println ( <printArgument> *** Generating: 3: WRITESTRING 1 6 CHARACTER STRING LITERAL: " quits" ... node has no more children ) ; *** Generating: 4: WRITELNOP ... node has no more children ... node has no more children <statement> <outputStmt> Reserved Word: System . Reserved Word: out . Reserved Word: print ( <printArgument> *** Generating: 5: WRITESTRING 7 36 CHARACTER STRING LITERAL: "Enter a non-negative integer: " ... node has no more children ) ; ... node has no more children ... node has no more children <statement> <assignmentOrInvoc> IDENTIFIER: i [static var (address = 0)] *** Generating: 6: PUSHSTATADDR 0 = <expr3> <expr2> <expr1> IDENTIFIER: KB [local Scanner] .
Background image of page 2
Reserved Word: nextInt ( ) *** Generating: 7: READINT ... node has no more children ... node has no more children ... node has no more children *** Generating: 8: SAVETOADDR ; ... node has no more children ... node has no more children <statement> <whileStmt> Reserved Word: while ( <expr7> <expr6> <expr5> <expr4> <expr3> <expr2> <expr1> IDENTIFIER: i [static var (address = 0)] *** Generating: 9: PUSHSTATADDR 0 *** Generating: 10: LOADFROMADDR ... node has no more children ... node has no more children ... node has no more children ... node has no more children != <expr4> <expr3> <expr2> <expr1> *** Generating: 11: PUSHNUM 9999 UNSIGNED INTEGER LITERAL: 9999 ... node has no more children ... node has no more children ... node has no more children ... node has no more children *** Generating: 12: NE ... node has no more children ... node has no more children ... node has no more children ) *** Generating:
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

8 - &lt;program&gt; &lt;importStmt&gt; Reserved Word:...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online