xtc — registers, unregisters and queries XTC components in a repository
xtc
[-r rep
| --repository rep
]
[i rep
| import rep
]
[r | register]
[-t name
| --tool name
]
[-l loc
| --location loc
]
[-V name
| --Version name
]
[query | q]
[-a | --all]
[-L | --Location]
[-R | --Repository]
[--verbose int
]
[-h | -? | --help]
[--about]
[--version]
The Stratego/XT component model is called XTC. It allows developers to compose XT components (Stratego programs) together, creating new components in a flexible, scalable and modular way. Components live together in XTC repositories, which have an internal directory structure.
The xtc tool is used to administer components in an XTC repository. It can add and remove components from a repository as well as inspect repositories.
Repository Manipulation Options
-r rep
, --repository rep
The repository to work on. rep
is the base path to the
repository. This option is mandatory.
i rep
, import rep
Import the repository in rep
.
This command will import the entire contents (all components) of the repository
rep
.
r
, register
Register a file in the repository. This option must be followed by -t
,
-V
and -l
.
-t name
, --tool name
Name of the tool to register (r
command) or query for (q
command).
-l loc
, --location name
Location inside the repository to place a new tool. Used with the register (r
) command.
-V num
, --Version num
Version of the tool to register (r
command) or query for (q
).
q
, query
Queries the repository for all installed components. May be used with -L
.
By using the -a
, -t
and -V
option, filtering
may be done.
-a
, --all
List all registered tools. Used with the q
command.
-L
, --Location
List only locations. Used with the q
command.
-R
, --Repository
List the location of the repository as a Bash-compatible shell environment variable setting.
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
.
-b
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
--about
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
.
--version
Displays the tool name and version.
Consider the following command.
$
xtc -r /usr/share/StrategoXT/XTC register -t sglr -l /bin -V 3.8
This will register version 3.8 of sglr with the XTC repository located in
/usr/share/StrategoXT
. It will be placed in the /bin
directory inside the repository.
Note that the generic Makefile.xt
provided by AutoXT automatically
registers all installed tools with the package repository.
XTC repositories can be used to find the installation location of a tool without needing to know all the installation paths. For example, the following query can be used to find out where sglr is installed:
$
xtc -r /usr/share/StrategoXT/XTC query -t sglr
sglr (3.8) : /bin/sglr
An existing repository can be inherited by importing it:
$
xtc -r /home/user/share/tiger/XTC import /usr/share/StrategoXT/XTC
Copyright (C) 2002-2005 Eelco Visser <visser@acm.org>
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.