contents
 

stypp Pretty Printer


'stypp' serves as a pretty printer for source files written in a styx-conform language. Beside that it can be used to port source files, provided that the abstract syntax of the source and target language are equivalent. The conversion includes all comments, but there is currently no supplement for a conversion of the token classes themselves, that means the tokens are taken as is.
The work on this program, especially on the pretty printer layout, ist still in progress.

Arguments


NameTypeSemantic
srclang name source language name
dstlang name target language name
filename path path of source file to transform



Options

An option will be specified as follows: -<Name>=<Value>
A flag is toggled that way: -<Name>
The default value will be applied when the option wasn't specified.

NameTypeDefault valueSemantic
charset string"" source file character set ( UTF-8, UCS4, ... )
wprint flagfalse unicode output ( on non-default character set )
prepar string"" standard preprocessing: yes or list index~value , ...
premac string"" standard preprocessing: pre-defined macro , ...
prefun string"" user-defined preprocessing: Function@Library ( not with prepar-option )
Start string"" start symbol
xaron flagfalse create a derivation tree ( lisp like representation )
early flagfalse use early reduction
shiftfun string"" user-defined token conversion: Function@Library ( see [ptm_gen] )
reducefun string"" user-defined nonterminal conversion: Function@Library ( see [ptm_gen] )
ppfun string"" user-defined token conversion: Function@Library ( see [ptm_pp] )

The options 'prepar' and 'premac' are only useful with styx-like preprocessing.

If your language uses the same preprocessing directives as specified in [styx.sty], but differnt macro token identifiers and keywords, the option 'prepar' can be used to enable preprocessing and specify the differences as a comma separated list:

  1. 0~name of identifier token
  2. 1~name of macro definition token
  3. 2~name of argument separator token
  4. 3~name of include token
  5. 4~name of conditional token
  6. 5~#macro keyword
  7. 6~#end keyword
  8. 7~#ifdef keyword
  9. 8~#ifndef keyword
  10. 9~#else keyword
  11. 10~#include keyword
  12. 11~environment variable or path list as search path for include files
  13. 12~include file character set ( default: charset-option )

The option 'premac' supports pre-defined macros in connection with styx-like preprocessing.

Dynamic library support is a prerequisite for the user-defined callback handler.

Environment

An environment variable will be specified as followed: -<Name>=<Value>
The default value will be applied when no environment variable was specified.

NameTypeDefault valueSemantic
PATH path search path for [srclang.pim], [srclang.lim], [dstlang.pim] and [dstlang.lim]