Package scale.frontend

This package contains the separate parsers for each language that Scale can compile.

See:
          Description

Class Summary
Parser This is the base class for all source code parsers.
SourceLanguage An abstract class for supporting multiple source languages.
 

Package scale.frontend Description

This package contains the separate parsers for each language that Scale can compile. Each sub-directory contains the parser for that particular language (some are empty). Each parser must be derived from Parser.

Adding a New Parser

To add a new parser for a language follow these steps:
  1. Create the subdirectory for that parser. The subdirectory name should be mnemonic.
  2. Create the class for the parser in that directory. The name for the new parser class should be mnemonic. Context-free languages may use the ANTLR parser builder; See scale/frontend/c/c99.g for an example.
  3. If the language uses a preprocessor, create the runPreprocessor() method that invokes the preprocessor without invoking the parser.
  4. Create the source language class for the language, that is derived from the SourceLanguage class, which specifies various language features that the compiler needs to know about.
  5. Add the mapping, for the new file extension to be used, to the new parser class in the Parser class.
  6. Add the subdirectory name to the scale/Makefile file javadoc rule.