contents
 

styx A combined parser and scanner generator


'styx' translates the token and syntax description for a language in [$SPESTYX/Language.sty] into scanner and parser tables and a functional interface to the abstract derivation tree.

The generated tables have to be applied to the actual scanner and parser function which are part of the styx library. The result of the parser function will be a derivation tree which can be accessed through the above mentioned interface.

Arguments


NameTypeSemantic
Language name language name



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
diagnose flagfalse additional diagnose and information
verbose flagfalse progress information
conflicts flagtrue prevent parse table generation in case of conflicts
makeIMG flagfalse create binary table images
makeINT flagfalse create interface c source
makeANT flagfalse create abstract interface c source
makeC flagfalse create table c sources
export flagfalse export table definitions
exportTMPL string"" export template file
shortform flagfalse use short form of language name

Dependant on the given options different source and image files will be created:

  1. -makeIMG
    For an interpretative execution you may only need the binary [$BINSTYX/Language.pim] and [$BINSTYX/Language.lim] image files which contain the parser and scanner tables.
  2. -makeINT
    To process the derivation tree within your c/c++ program it's useful to create the interface c source [$GENSTYX/Language(1,4)_int.c].
  3. -makeANT
    To process a derivation tree variant optimized wrt. memory usage it's useful to create the special interface c source [$GENSTYX/Language(1,4)_ant.c].
  4. -makeC
    Instead of using the table image files you can include the c sources [$GENSTYX/Language(1,4)_pim.c] and [$GENSTYX/Language(1,4)_lim.c]. This option implies '-makeINT'.
  5. -export
    In order to use the C++ scanner and parser classes you may only need the file [$BINSTYX/Language.ltbl] which contains the scanner table definition and. [$BINSTYX/Language.ptbl] which contains the parse table definition.
  6. -exportTMPL=template file
    The given template file will be used for the export of the scanner and parse table as constant string definitions in the format of the preferred programming language. The placeholder @TABLE@ will be replaced by the concatenation of table type and language ID. The line containing the placeholder @LINE@ will be replicated for each line of the current definition. Before substituting a quoted placeholder @LINE@ the actual definition line will be converted applying C-style quoting rules.


Environment

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

NameTypeDefault valueSemantic
BINSTYX path. [.pim], [.lim] and [.ltbl] target directory
GENSTYX path. [.c] target directory
SPESTYX path. [.sty] source directory