An attribute-grammar framework for specifying the accessibility in Java programs

  • Authors:
  • Jien-Tsai Chan;Wuu Yang

  • Affiliations:
  • Department of Computer and Information Science, National Chiao Tung University, PO Box 25-75, Hsinchu 300, Taiwan, ROC;Department of Computer and Information Science, National Chiao Tung University, PO Box 25-75, Hsinchu 300, Taiwan, ROC

  • Venue:
  • Computer Languages, Systems and Structures
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

The three access modifiers-public, protected, and private-control the accessibility of the members of a type in the Java programming language. Furthermore, the accessibility may be transmitted along the two structures-package structure and inheritance structure. It is difficult to identify the weaknesses of the access modifiers from the informal semantics stated in the language manual. We develop a formal framework for specifying the accessibility in Java programs based on attribute grammars. With the help of this framework, we found several situations in the language specification that are irregular or counter-intuitive or ambiguous. These situations may confuse the programmers and hence may create weaknesses in Java programs.