<h1><i>PComb

<div><i>This is meant to be a complete reference for all of the functions and
data types that comprise PComb. Being complete, they can not necessarily be in
order of how a programmer would use them. If the information that is presented
here is too confusing, consider looking at the
<a
Started</a> page. Also, the PComb repo has a full demo application in the
and that would be an excellent starting point for learning how to use the


<div><i><br>


<div><i><font color="#ff0000"><b>This document is incomplete. It is still being


<div><i><br>


<pre><i><font face="Courier New">export type Parser = (input: ParserInput, output: ParserOutput, action?: ParserAction) =&gt;

<div><i>The Parser type is a function signature that should be implemented by
any function that wants to acts as a parser. All the standard parsers that are
supplied by the PComb library do so, but client code can also implement its own
special-purpose parsers by implementing this

<div><i><br>


<pre><i><font face="Courier New">export type ParseResult = <a ParserInput,

<p><font face="Arial"><i>The <b>ParseResult </b>tuple is returned by all parser
functions. The first value indicates if the parser successfully matched its
input. If the value if <b>false, </b>the remaining parameters will be identical
to the objects that were supplied in the call to the <b>Parse</b>&nbsp;function.
If <b>true</b>&nbsp;is returned, the <b>ParserInput</b>&nbsp;returned will have
its <b>text</b>&nbsp;field set to have only the input data that was not
consumed by parsing, and the <b>ParserOutput</b>&nbsp;will have its <b>matched</b>&nbsp;list
set to contain all of the individual strings that were matched by each discrete
parsing step as well as any application-specific fields that were set by

<h3><br>
</h3>

<h3>ParserOutput</h3>
<pre><font face="Courier New">export interface ParserOutput {<br>


&nbsp; &nbsp; /** The text that was matched by the parser. */<br>


&nbsp; &nbsp; matched: Array&lt;string&gt;;<br>


&nbsp; &nbsp; copy(): ParserOutput;<br>


<div><i>The ParserOutput interface must be implemented by a class that is
supplied by the client code. The object may implement any number of other
properties and methods, but any such custom values must be copied by the
implementation of the

<div><i><br>


<div><i>
<pre><font face="Courier New">export interface ParserInput {<br>


&nbsp; &nbsp; /** What is the text that is being parsed? */<br>


&nbsp; &nbsp; text: string;<br>


&nbsp; &nbsp; copy(): ParserInput;<br>


<div>The <b>ParserInput</b>&nbsp;interface must be implemented by a class that
is supplied by the client