Using Standard Tools to Create
Lexers and Parsers for CASL

Axel Schairer

28 April 1999

This document is available by FTP in various formats. It was converted to HTML using Hyperlatex 2.3.

Abstract

The CASL language as described in [CoF98] defines a concrete syntax for comments and announces a concrete syntax for annotations, which is proposed in [RM99] and was discussed at the CoFI WG meeting, March 1999, in Amsterdam. The discussion also addressed the question how comments and annotations should be handled by approved CASL tools.

The approach discussed requires CASL parsers to handle all comments and annotations by representing them in the abstract syntax tree which they construct from a CASL input. This gives rise to pragmatic problems when parser generator tools using a technique similar to flex/bison are used to implement the lexing and context free parsing components of CASL parsers.

This note proposes a solution that allows specialized CASL frontends to handle only the comments and annotations that are relevant for the tool the frontend is a part of, allowing the construction of specialized CASL parsers using a wide range of existing parser generator tools.

This note only considers annotations present in the source text, not annotations that are created while parsing or further processing.

  • 1 Introduction
  • 2 Annotations to be handled uniformly
  • 3 Comments and special purpose annotations
  • 4 Solution adopted for the INKA frontend
  • 5 Conclusion
  • References
  • Footnotes

  • CoFI Note: T-7 -- Version: 1 -- 28 April 1999.
    Comments to schairer@dfki.de