Machine-translated by Google. Questions are authored in English.
Top

Discussion

Blanks being insignificant in early Fortran made scanning harder because

  • A.the scanner must insert blanks into the source before it scans it at all
  • B.the parser then receives tokens in an unpredictable order
  • C.the symbol table cannot store names containing blank characters
  • D.the scanner cannot use white space to delimit one lexeme from the next

Answer: D

Correct answer: the scanner cannot use white space to delimit one lexeme from the next

If blanks are insignificant then DO 10 I = 1, 25 and DO10I=1,25 are the same statement, and worse, DO10I=1.25 is an assignment to a variable called DO10I. The scanner cannot tell which until it reaches the comma or the point, so it needs arbitrary lookahead - which is exactly what the design of a scanner is meant to avoid.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.