Pearson eText for Concepts of Programming Languages -- Instant Access (Pearson+)
Pearson eText for Concepts of Programming Languages -- Instant Access (Pearson+)
12th Edition
ISBN: 9780135102268
Author: Robert Sebesta
Publisher: PEARSON+
Expert Solution & Answer
Book Icon
Chapter 4, Problem 13RQ

Explanation of Solution

The reason named constants are used:

The lexical analyzers collect the characters of the input string and group them into logical groups according to the pattern matching rules. These logical groupings are called as lexemes.

Lexical analyzer assigns some internal (numeric) codes to the lexemes (logical groupings) according to their structure. Instead of assigning numeric codes, named constants are used for token codes due to the following reasons:

  • Gives better readability to the code...

Blurred answer
Students have asked these similar questions
As it relates to methods, what is the difference between passing primitive data types versus passing objects?
Return the Remainder from Two Numbers Language: Java Script There is a single operator in JavaScript, capable of providing the remainder of a division operation. Two numbers are passed as parameters. The first parameter divided by the second parameter will have a remainder, possibly zero. Return that value. Examples remainder(1, 3) 1 remainder (3, 4) 3 remainder (-9, 45) -9 remainder(5, 5) 0
What is the difference between and ?
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT