<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>letterParser -- a parser that accepts a single letter and returns it</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_const__Parser.html">next</a> | <a href="_future__Parser.html">previous</a> | <a href="_const__Parser.html">forward</a> | <a href="_future__Parser.html">backward</a> | <a href="___Parser.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <div><a href="index.html" title="a framework for building parsers">Parsing</a> > <a href="___Parser.html" title="the class of all parsers">Parser</a> > <a href="_letter__Parser.html" title="a parser that accepts a single letter and returns it">letterParser</a></div> <hr/> <div><h1>letterParser -- a parser that accepts a single letter and returns it</h1> <div class="single"><h2>Description</h2> <div><table class="examples"><tr><td><pre>i1 : p = letterParser "a" o1 = p o1 : Parser</pre> </td></tr> <tr><td><pre>i2 : p "b"</pre> </td></tr> <tr><td><pre>i3 : p null o3 = a</pre> </td></tr> </table> </div> </div> <div class="waystouse"><div class="single"><h2>Code</h2> <pre>../Parsing.m2:60:26-60:87: --source code: letterParser = Parser (c -> if alpha#?c then new Parser from (b -> if b === null then c))</pre> </div> </div> </div> </body> </html>