Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > dd7a95aabe1c049ac9f84beede8143d3 > files > 1966

synopsis-doc-0.12-4.fc14.i686.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Option Handling</title><link rel="stylesheet" href="synopsis.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><link rel="start" href="index.html" title="Synopsis Tutorial" /><link rel="up" href="using.html" title="Chapter 2. Using the synopsis tool" /><link rel="prev" href="using.html" title="Chapter 2. Using the synopsis tool" /><link rel="next" href="parsing.html" title="Parsing Source-code" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Option Handling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Using the synopsis tool</th><td width="20%" align="right"> <a accesskey="n" href="parsing.html">Next</a></td></tr></table></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="options"></a>Option Handling</h2></div></div></div><p>The synopsis tool combines three optional types of processors: parsers (specified with the
        <code class="option">-p</code> option), linker processors (specified with the <code class="option">-l</code> option, 
        and formatters (specified with the <code class="option">-f</code> option). If a parser is selected,
        any input is interpreted as source files of the respective language. Otherwise it will
        be read in as a stored IR. Similarly, if a formatter is selected, output is generated
        according to the formatter. Otherwise it will contain a stored IR.</p><p>For all of the three main processors, arguments can be passed down using the
        <code class="option">-W</code>. For example, to find out what parameters are available with the
        <span class="type">Cxx</span> parser, use the <code class="option">--help</code> option:</p><pre class="screen">
$ synopsis -p Cxx -h
Parameters for processor 'Synopsis.Parsers.Cxx.Parser':
   profile               output profile data
   cppflags              list of preprocessor flags such as -I or -D
   preprocess            whether or not to preprocess the input
   ...
      </pre><p>Then, to pass a <code class="varname">preprocess</code> option, either of:</p><pre class="programlisting">synopsis -p Cxx -Wp,--preprocess ...</pre><pre class="programlisting">synopsis -p Cxx -Wp,preprocess=True ...</pre><p>The first form expects an optional string argument, while the second form
        expects a python expression, thus allowing to pass python objects such as lists.
        (But be careful to properly escape characters to get the expression through the
        shell !)</p><p>But passing options via the command line has its limits, both, in terms of
        usability, as well as for the robustness of the interface (all data have to be
        passed as strings !). Therefor, for any tasks demanding more flexibility a
        scripting interface is provided, which will be discussed in the next chapter.
      </p></div><div class="navfooter"><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="parsing.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Using the synopsis tool </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Parsing Source-code</td></tr></table></div></body></html>