Your IP : 216.73.216.213


Current Path : /opt/alt/python35/share/doc/alt-python35-pyparsing-doc/htmldoc/
Upload File :
Current File : //opt/alt/python35/share/doc/alt-python35-pyparsing-doc/htmldoc/pyparsing.SkipTo-class.html

<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pyparsing.SkipTo</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pyparsing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >pyparsing</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pyparsing-module.html">Module&nbsp;pyparsing</a> ::
        Class&nbsp;SkipTo
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pyparsing.SkipTo-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class SkipTo</h1><p class="nomargin-top"><span class="codelink"><a href="pyparsing-pysrc.html#SkipTo">source&nbsp;code</a></span></p>
<pre class="base-tree">
     object --+        
              |        
  <a href="pyparsing.ParserElement-class.html">ParserElement</a> --+    
                  |    
<a href="pyparsing.ParseElementEnhance-class.html">ParseElementEnhance</a> --+
                      |
                     <strong class="uidshort">SkipTo</strong>
</pre>

<hr />
<p>Token for skipping over all undefined text until the matched 
  expression is found.</p>
  <p>Parameters:</p>
  <ul>
    <li>
      expr - target expression marking the end of the data to be skipped
    </li>
    <li>
      include - (default=<code>False</code>) if True, the target expression
      is also parsed (the skipped text and target expression are returned 
      as a 2-element list).
    </li>
    <li>
      ignore - (default=<code>None</code>) used to define grammars 
      (typically quoted strings and comments) that might contain false 
      matches to the target expression
    </li>
    <li>
      failOn - (default=<code>None</code>) define expressions that are not 
      allowed to be included in the skipped test; if found before the 
      target expression is found, the SkipTo is not a match
    </li>
  </ul>
  <p>Example:</p>
<pre class="literalblock">
   report = '''
       Outstanding Issues Report - 1 Jan 2000

          # | Severity | Description                               |  Days Open
       -----+----------+-------------------------------------------+-----------
        101 | Critical | Intermittent system crash                 |          6
         94 | Cosmetic | Spelling error on Login ('log|n')         |         14
         79 | Minor    | System slow when running too many reports |         47
       '''
   integer = Word(nums)
   SEP = Suppress('|')
   # use SkipTo to simply match everything up until the next SEP
   # - ignore quoted strings, so that a '|' character inside a quoted string does not match
   # - parse action will call token.strip() for each matched token, i.e., the description body
   string_data = SkipTo(SEP, ignore=quotedString)
   string_data.setParseAction(tokenMap(str.strip))
   ticket_expr = (integer(&quot;issue_num&quot;) + SEP 
                 + string_data(&quot;sev&quot;) + SEP 
                 + string_data(&quot;desc&quot;) + SEP 
                 + integer(&quot;days_open&quot;))
   
   for tkt in ticket_expr.searchString(report):
       print tkt.dump()
</pre>
  <p>prints:</p>
<pre class="literalblock">
   ['101', 'Critical', 'Intermittent system crash', '6']
   - days_open: 6
   - desc: Intermittent system crash
   - issue_num: 101
   - sev: Critical
   ['94', 'Cosmetic', &quot;Spelling error on Login ('log|n')&quot;, '14']
   - days_open: 14
   - desc: Spelling error on Login ('log|n')
   - issue_num: 94
   - sev: Cosmetic
   ['79', 'Minor', 'System slow when running too many reports', '47']
   - days_open: 47
   - desc: System slow when running too many reports
   - issue_num: 79
   - sev: Minor
</pre>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pyparsing.SkipTo-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>,
        <span class="summary-sig-arg">include</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">ignore</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">failOn</span>=<span class="summary-sig-default">None</span>)</span><br />
      x.__init__(...) initializes x; see help(type(x)) for signature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyparsing-pysrc.html#SkipTo.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pyparsing.SkipTo-class.html#parseImpl" class="summary-sig-name">parseImpl</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">instring</span>,
        <span class="summary-sig-arg">loc</span>,
        <span class="summary-sig-arg">doActions</span>=<span class="summary-sig-default">True</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyparsing-pysrc.html#SkipTo.parseImpl">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="pyparsing.ParseElementEnhance-class.html">ParseElementEnhance</a></code></b>:
      <code><a href="pyparsing.ParseElementEnhance-class.html#__str__">__str__</a></code>,
      <code><a href="pyparsing.ParseElementEnhance-class.html#checkRecursion">checkRecursion</a></code>,
      <code><a href="pyparsing.ParseElementEnhance-class.html#ignore">ignore</a></code>,
      <code><a href="pyparsing.ParseElementEnhance-class.html#leaveWhitespace">leaveWhitespace</a></code>,
      <code><a href="pyparsing.ParseElementEnhance-class.html#streamline">streamline</a></code>,
      <code><a href="pyparsing.ParseElementEnhance-class.html#validate">validate</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="pyparsing.ParserElement-class.html">ParserElement</a></code></b>:
      <code><a href="pyparsing.ParserElement-class.html#__add__">__add__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__and__">__and__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__call__">__call__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__eq__">__eq__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__hash__">__hash__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__invert__">__invert__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__mul__">__mul__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__ne__">__ne__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__or__">__or__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__radd__">__radd__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__rand__">__rand__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__repr__">__repr__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__req__">__req__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__rmul__">__rmul__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__rne__">__rne__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__ror__">__ror__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__rsub__">__rsub__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__rxor__">__rxor__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__sub__">__sub__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#__xor__">__xor__</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#addCondition">addCondition</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#addParseAction">addParseAction</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#canParseNext">canParseNext</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#copy">copy</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#matches">matches</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#parseFile">parseFile</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#parseString">parseString</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#parseWithTabs">parseWithTabs</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#postParse">postParse</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#preParse">preParse</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#runTests">runTests</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#scanString">scanString</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#searchString">searchString</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#setBreak">setBreak</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#setDebug">setDebug</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#setDebugActions">setDebugActions</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#setFailAction">setFailAction</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#setName">setName</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#setParseAction">setParseAction</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#setResultsName">setResultsName</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#setWhitespaceChars">setWhitespaceChars</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#split">split</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#suppress">suppress</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#transformString">transformString</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#tryParse">tryParse</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== STATIC METHODS ==================== -->
<a name="section-StaticMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Static Methods</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="pyparsing.ParserElement-class.html">ParserElement</a></code></b>:
      <code><a href="pyparsing.ParserElement-class.html#enablePackrat">enablePackrat</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#inlineLiteralsUsing">inlineLiteralsUsing</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#resetCache">resetCache</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#setDefaultWhitespaceChars">setDefaultWhitespaceChars</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Class Variables</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="pyparsing.ParserElement-class.html">ParserElement</a></code></b>:
      <code><a href="pyparsing.ParserElement-class.html#DEFAULT_WHITE_CHARS">DEFAULT_WHITE_CHARS</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#packrat_cache">packrat_cache</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#packrat_cache_lock">packrat_cache_lock</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#packrat_cache_stats">packrat_cache_stats</a></code>,
      <code><a href="pyparsing.ParserElement-class.html#verbose_stacktrace">verbose_stacktrace</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Properties</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">other</span>,
        <span class="sig-arg">include</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">ignore</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">failOn</span>=<span class="sig-default">None</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pyparsing-pysrc.html#SkipTo.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>x.__init__(...) initializes x; see help(type(x)) for signature</p>
  <dl class="fields">
    <dt>Overrides:
        object.__init__
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="parseImpl"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">parseImpl</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">instring</span>,
        <span class="sig-arg">loc</span>,
        <span class="sig-arg">doActions</span>=<span class="sig-default">True</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pyparsing-pysrc.html#SkipTo.parseImpl">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Overrides:
        <a href="pyparsing.ParserElement-class.html#parseImpl">ParserElement.parseImpl</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pyparsing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >pyparsing</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Oct 06 20:32:30 2016
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>