SableCC

Description

Invokes the SableCC Translator generator on a grammar file(s).

To use the SableCC task, set the src attribute to the name of the grammar file to process, or to the directory containing grammar files. In the latter case you have to specify via include mechanism which files should be included for processing. SableCC follows standard MatchingTask conventions. Optionally, you can also set the outputdirectory to write the generated file to a specific directory. Otherwise sablecc writes the generated files to the base directory.

Parameters

Attribute Description Required
src The grammar file or directory to process. Yes
outputdirectory The directory to write the generated files to. If not set, the files are written to the directory containing the grammar file. No
withtools Boolean flag. Default to false (off). Sets the generation of tools for the generated parser. No

Example 1

<sablecc
    src="etc/java.grammar"
    outputdirectory="build/src"
/>

This invokes SableCC on grammar file etc/java.grammar, writing the generated files to build/src.

Example 2

<sablecc
    src="etc"
    outputdirectory="build/src" withtools="on" includes="*.grammar" 
/>

This invokes SableCC on all grammar files from etc directory, writing the generated files to build/src.