A discipline of tree processing

  • Authors:
  • Axel T. Schreiner;James E. Heliotis

  • Affiliations:
  • Rochester Institute of Technology, Rochester, NY;Rochester Institute of Technology, Rochester, NY

  • Venue:
  • PPPJ '09 Proceedings of the 7th International Conference on Principles and Practice of Programming in Java
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper discusses a set of new tools to facilitate the implementation of language processors in Java. First, by decoupling recognition based on grammars from tree building based on semantic actions we can choose to represent grammars in BNF or EBNF, and to parse based on LL, LR, or functional engines, and still completely control how trees represent structured input. Second, we use a Java custom annotation to generate tree factories, thus encouraging a more functional approach to backend processing by tree transformation. Third, we replace the traditional visitor design pattern in the backend by a more rule-oriented approach using inheritance on tree node classes for pattern matching. Taken together, language implementation turns into a problem of tree creation and transformation with concise, Java-based notations to focus on the algorithms.