XDoc Search Logo
Package:
stratego/xtc
Proc
Link to XDoc
Author: Eelco Visser<visser@acm.org>
Since: Unknown
Summary: This module contains a strategies for workin on the XTC universe. This includes composing components, passing data between components, and basic file handling. The XTC model is based around Unix pipes and ATerm stored as (temporary) files on disk. Each XT component is a an executable program, which reads an ATerm as input (either from stdin or from a file), processes it, and then writes the result to another file (or stdout). The lowlevel details of creating temporary files, opening pipes, and executing components have been hidden behind the strategies found in this module. You will find many examples of wrapper strategies, which perform bookkeeping of temporary files, opened file descriptors, and similar, to ensure that these are removed and freed upon program termination.
Definitions:
check-options No additional information available
copy-to Copies one file to another. If the new file has the same name as the old, no action is taken. In addition to a real file, the new file can be stdout (or stderr). In this case, the contents of the old file will be written to stdout (or stderr) before the file is removed.
copy-to No additional information available
DIR No additional information available
FILE No additional information available
print-to Writes a (list of) string(s) to a temporary file. A single string, or a list of strings is written to a text file. The file name is generated automatically, and returned by this strategy.
read-from Reads a term from a stdin. The input on stdin is assumed to be an ATerm. It will be parsed, and returned as a term.
rename-to Renames one file to another, on disk. If the new name is identical to the old, no action is taken. The old file can also be 'renamed' to stdout, in which case the content of the old file is written to stdout before the file is removed.
rename-to No additional information available
TEMP No additional information available
TempDirs No additional information available
TempFiles No additional information available
write-to Write a term to a temporary file, in binary. The name of the file is generated automatically, the term is written to it in the binary ATerm format (BAF), and a handle is returned by this strategy.
write-to-text Write a term to a temporary file, as text. The name of the file is generated automatically, the term is written to it in the textual ATerm format (TAF), and a handle is returned by this strategy.
xtc-check-dependencies Succeeds if all necessary components for the running program are available, and the user has specified --check. The check-options strategy must have been added to the command line options of the running program, see check-options for details. Additionally, xtc-check-dependencies will only run if the user specified --check on the command line when invoking the program.
xtc-ensure-file Succeeds if the input term is a FILE
xtc-ensure-file Succeeds if the input term is stdin, and it can be successfully copied to a FILE.
xtc-exit Clean up temporary files and exit program. In normal operation, XT components create temporary files, which should be cleaned up on program exit. Calling this strategy instead of<tt>exit</tt>ensures that no files are left behind.
xtc-filter-text-file No additional information available
xtc-find-file Searches for an XT component, by name. The input to this strategy is the name of the component, as registered in the XTC registry. If found, a FILE representing its location (path) is returned.
xtc-input No additional information available
xtc-input-wrap Option parsing wrapper for XTC programs that only read data. This strategy functions like xtc-io-wrap, except that it only exposes the -i option, and will not write any output to pipe (or file). Typically, s will start with a call to read-from. Example: xtc-input-wrap(read-from ; id)
xtc-input-wrap Option parsing wrapper for XTC programs that only read data. This strategy functions like xtc-io-wrap, except that it only exposes the -i option, and will not write any output to pipe (or file). Typically, s will start with a call to read-from. Example: xtc-input-wrap(ArgOption(....), read-from ; id)
xtc-io No additional information available
xtc-io-exit No additional information available
xtc-io-wrap No additional information available
xtc-iowrap No additional information available
xtc-output Applies the strategy s to the current term, then writes the result to output. The output file is taken from the -o option on the command line, if given, or defaults to stdout, if not.
xtc-output-wrap Option parsing wrapper for XTC programs that only generate data. This strategy functions like xtc-io-wrap, except that it only exposes the -o option, and will read any output from stdin (or file). Typically, s will will end with a call to write-to. Example: xtc-output-wrap(!"foo"; write-to)
xtc-output-wrap Option parsing wrapper for XTC programs that only generate data. This strategy functions like xtc-io-wrap, except that it only exposes the -o option, and will read any output from stdin (or file). Typically, s will end with a call to write-to. Example: xtc-output-wrap(!"foo"; write-to)
xtc-remove-temporaries No additional information available
xtc-temp-files Wrapper strategy that automatically cleans all temporary files created by s. This strategy is used to wrap a strategy<tt>s</tt>, which can create one or multiple temporary files. All temporary files will be cleaned up automatically, and the result of<tt>s</tt>will be returned.
xtc-write-output Writes a FILE to the output of this component. The output is file is retrieved from the -o option given to the program; if -o was not given, stdout is used.
xtc-write-output No additional information available