parse-cs — parses meta-programs with concrete syntax
dir | --Include
[-pp | -pretty-print]
file | --input
file | --output
[-S | --silent]
level | --keep
[-h | -? | --help]
parse-cs is a generic parser for meta-programs with concrete object syntax, also known as embedded syntax. For proper operation, parse-cs must have information about
the parse table
the pre-explode desugaring component
the exploder for embedded abstract syntax
the post-explode desugaring component
These components do are not provided on the command line, but rather in a meta-data file. For each file to be parsed, a specific meta-data file must be defined. It should have the following components:
Meta([ Syntax(lang), // name of language = main SDF module ParseTable(tbl) PreExplodeDesugar(pre-explode), Explode(explode), PostExplodeDesugar(post-expl), PrettyPrintTable(pp) ])
If the component names are not absolute paths to files, the components are looked up in the XTC repository. Most of these components are optional, only one the syntax component is required.
Include modules from directory
Invoke the pretty-printer as part of the process.
Common Input/Output Options
The input term given by the file name
In the absence of the
-i option, input
will be read from
The output will be written to the file given by the file name
In the absence of the
output will be written to
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
Display usage information.
Keep intermediate results produced by the internal stages in the
pretty-printing process. This is only useful for debugging. A high
int indicates increased eagerness
for keeping intermediate results.
Default setting is 0, indicating that no intermediates will be kept.
Silent execution. Same as
Set verbosity level to numerical value
higher the number, the more information about pp-aterm's inner workings are
int can be set to either of the
following verbosity levels, given in increasing order of verbosity:
Displays the tool name and version.
Given a meta file in
prog.meta and the program in
prog.str, the following will parse a Stratego
program with embedded concrete syntax:
$parse-cs --syntax Stratego -i prog.str -o prog.trm
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.