Invitation to Computer Science 8th Edition

Published by Cengage Learning
ISBN 10: 1337561916
ISBN 13: 978-1-33756-191-4

Chapter 11 - 11.2 - The Compilation Process - Practice Problems - Page 550: 3

Answer

\begin{array}{l}{\text { A scanner is not involved in the determination of the legality or illegality }} \\ {\text { of a programming language statement; that is done in the next two steps. }} \\ {\text { A scanner is only concerned with finding and classifying tokens. So it }} \\ {\text { would simply return the following six tokens: }}\end{array} \begin{array}{ccc} {\textbf {Name} } & {\textbf {Classification} }\\ {\mathrm{X}} & {1} \\ {=} & {3} \\ { ;} & {6} \\ {( } & {10} \\ {14} & {2} \\ {\text { hello }} & {1} \end{array}

Work Step by Step

\begin{array}{l}{\text { A scanner is not involved in the determination of the legality or illegality }} \\ {\text { of a programming language statement; that is done in the next two steps. }} \\ {\text { A scanner is only concerned with finding and classifying tokens. So it }} \\ {\text { would simply return the following six tokens: }}\end{array} \begin{array}{ccc} {\textbf {Name} } & {\textbf {Classification} }\\ {\mathrm{X}} & {1} \\ {=} & {3} \\ { ;} & {6} \\ {( } & {10} \\ {14} & {2} \\ {\text { hello }} & {1} \end{array}
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.