For most modern programming languages scanners require


For most modern programming languages, scanners require little context information. That is, a token can be recognized by examining its text and perhaps one or two look ahead characters. In Ada, however, additional context is required to distinguish between a single tic (comprising an attribute operator, as in data' size) and a tic-character-tic sequence (comprising a quoted character, as in #x#). Assume that a Boolean flag can parse char is set by the parser when a quoted character can be parsed. If the next input character is a tic, can parse char can be used to control how the tic is scanned. Explain how the can parse char flag can be cleanly integrated into a Lex-created scanner. The changes you suggest should not unnecessarily complicate or slow the scanning of ordinary tokens.

Request for Solution File

Ask an Expert for Answer!!
Basic Statistics: For most modern programming languages scanners require
Reference No:- TGS01474293

Expected delivery within 24 Hours