5 - <program>...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: <program> <importStmt> Reserved Word: import Reserved Word: java . Reserved Word: util . Reserved Word: Scanner ; ... node has no more children Reserved Word: class IDENTIFIER: CS316ex5 [not in symbol table] { <dataFieldDecl> Reserved Word: static <varDecl> Reserved Word: Scanner IDENTIFIER: input [static Scanner] = Reserved Word: new Reserved Word: Scanner ( Reserved Word: System . Reserved Word: in ) ; ... 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: argv [not in symbol table] [ ] ) *** Generating: 0: INITSTKFRM ? <compoundStmt> { <statement> <outputStmt> Reserved Word: System . Reserved Word: out . Reserved Word: print ( <printArgument> *** Generating: 1: WRITESTRING 0 38 CHARACTER STRING LITERAL: "Enter a positive integer less than 10: " ... node has no more children ) ; ... node has no more children ... node has no more children <statement> <varDecl> Reserved Word: int <singleVarDecl> IDENTIFIER: amtOfInput [not in symbol table] = *** Generating: 2: PUSHLOCADDR 1 <expr3> <expr2> <expr1> IDENTIFIER: input [static Scanner] . Reserved Word: nextInt ( ) *** Generating: 3: READINT ... node has no more children ... node has no more children ... node has no more children *** Generating: 4: SAVETOADDR ... node has no more children ; ... node has no more children ... node has no more children <statement> <varDecl> Reserved Word: int <singleVarDecl> IDENTIFIER: counter1 [not in symbol table] = *** Generating: 5: PUSHLOCADDR 2 <expr3> <expr2> <expr1> *** Generating: 6: PUSHNUM 1 UNSIGNED INTEGER LITERAL: 1 ... node has no more children ... node has no more children ... node has no more children *** Generating: 7: SAVETOADDR ... node has no more children ; ... node has no more children ... node has no more children <statement> <whileStmt> Reserved Word: while ( <expr7> <expr6> <expr5> <expr4> <expr3> <expr2> <expr1> IDENTIFIER: counter1 [local var (stackframe offset = 2)] *** Generating: 8: PUSHLOCADDR 2 *** Generating: 9: LOADFROMADDR ... node has no more children ... node has no more children ... node has no more children <= <expr3> <expr2> <expr1> IDENTIFIER: amtOfInput [local var (stackframe offset = 1)] *** Generating: 10: PUSHLOCADDR 1 *** Generating: 11: LOADFROMADDR ... node has no more children ... node has no more children ... node has no more children *** Generating: 12: LE ... node has no more children ... node has no more children ... node has no more children ... node has no more children ) *** Generating: 13: JUMPONFALSE ? <statement> <compoundStmt> { <statement> <outputStmt> Reserved Word: System . Reserved Word: out ....
View Full Document

Page1 / 16

5 - <program>...

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