sglri — parse a text file using sglri and implode using implode-asfix


sglri [-i file] [-o file] [-p file] [-s symbol | --start symbol] [--no-heuristic-filters] [--sglr opt] [--impl opt] [-b] [-S | --silent] [--verbose level] [-k level | --keep level] [-h | -? | --help] [--about] [--version]


The sglri utility combines the functionality of the sglr parser and the implode-asfix implosion tool into one convenient bundle. sglri will first invoke sglr with the parse table provided by the -p option, then apply implode-asfix to the resulting parse tree. The imploded tree is then the final result of sglri.

See documentation for sglr and implode-asfix for details on each of the components. Note that sglri changes the default behaviour of sglri by disabling the heuristic filters -fi and -fe and uses the AsFix2 parse tree format.


Parser and Imploder Options

-s symbol

Specific start symbol to use in the input grammar. Default is unspecified.

--heuristic-filters on|off

Use heuristic disambiguation filters or not. The heuristic disambiguation filters (the sglr options -fi and -fi) are disabled by default.

--sglr opt

Pass the option opt to sglr.

--impl opt

Pass the option opt to implode-asfix.

-s symbol

Specific start symbol to use in the input grammar. Default is unspecified.

Common Input/Output Options

-i file

The input term given by the file name file.

In the absence of the -i option, input will be read from stdin.

-o file

The output will be written to the file given by the file name file.

In the absence of the -o option, output will be written to stdout.


The output will be written in the binary (BAF) ATerm format.

ATerms in the BAF format require a lot less space than ones in the TAF format, but the Java ATerm library does not currently support baf ATerms. ATerms in the baf format is the preferred format of exchange between Stratego tools.

Common Debugging Options


See --version.

-h, -?, --help

Display usage information.

--keep int

Keep intermediate results produced by the internal stages in the pretty-printing process. This is only useful for debugging. A high value of int indicates increased eagerness for keeping intermediate results.

Default setting is 0, indicating that no intermediates will be kept.

-S, --silent

Silent execution. Same as --verbose 0.

--verbose int

Set verbosity level to numerical value int. The higher the number, the more information about pp-aterm's inner workings are printed.

Alternatively, int can be set to either of the following verbosity levels, given in increasing order of verbosity: emergency, alert, critical, error, warning, notice, info, debug, vomit.


Displays the tool name and version.


See the commands sglr and implode-asfix for examples.

Reporting Bugs

Please report bugs to


Copyright (C) 2002-2005 Eelco Visser

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.