1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>UnaryLexer</title> 5<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../../index.html" title="Spirit 2.5.8"> 8<link rel="up" href="../lexer_concepts.html" title="Lexer Concepts"> 9<link rel="prev" href="primitivelexer.html" title="PrimitiveLexer"> 10<link rel="next" href="narylexer.html" title="NaryLexer"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="primitivelexer.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../lexer_concepts.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="narylexer.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h5 class="title"> 27<a name="spirit.lex.reference.lexer_concepts.unarylexer"></a><a class="link" href="unarylexer.html" title="UnaryLexer">UnaryLexer</a> 28</h5></div></div></div> 29<h6> 30<a name="spirit.lex.reference.lexer_concepts.unarylexer.h0"></a> 31 <span class="phrase"><a name="spirit.lex.reference.lexer_concepts.unarylexer.description"></a></span><a class="link" href="unarylexer.html#spirit.lex.reference.lexer_concepts.unarylexer.description">Description</a> 32 </h6> 33<p> 34 <span class="emphasis"><em>UnaryLexer</em></span> is a composite lexer component that has 35 a single subject. The UnaryLexer may change the behavior of its subject 36 following the Delegate Design Pattern. 37 </p> 38<h6> 39<a name="spirit.lex.reference.lexer_concepts.unarylexer.h1"></a> 40 <span class="phrase"><a name="spirit.lex.reference.lexer_concepts.unarylexer.refinement_of"></a></span><a class="link" href="unarylexer.html#spirit.lex.reference.lexer_concepts.unarylexer.refinement_of">Refinement 41 of</a> 42 </h6> 43<div class="blockquote"><blockquote class="blockquote"><p> 44 <a class="link" href="lexer.html" title="Lexer"><code class="computeroutput"><span class="identifier">Lexer</span></code></a> 45 </p></blockquote></div> 46<div class="variablelist"> 47<p class="title"><b>Notation</b></p> 48<dl class="variablelist"> 49<dt><span class="term"><code class="computeroutput"><span class="identifier">l</span></code></span></dt> 50<dd><p> 51 A UnaryLexer. 52 </p></dd> 53<dt><span class="term"><code class="computeroutput"><span class="identifier">L</span></code></span></dt> 54<dd><p> 55 A UnaryLexer type. 56 </p></dd> 57</dl> 58</div> 59<h6> 60<a name="spirit.lex.reference.lexer_concepts.unarylexer.h2"></a> 61 <span class="phrase"><a name="spirit.lex.reference.lexer_concepts.unarylexer.valid_expressions"></a></span><a class="link" href="unarylexer.html#spirit.lex.reference.lexer_concepts.unarylexer.valid_expressions">Valid 62 Expressions</a> 63 </h6> 64<p> 65 In addition to the requirements defined in <a class="link" href="lexer.html" title="Lexer"><code class="computeroutput"><span class="identifier">Lexer</span></code></a>, for any UnaryLexer the 66 following must be met: 67 </p> 68<div class="informaltable"><table class="table"> 69<colgroup> 70<col> 71<col> 72<col> 73</colgroup> 74<thead><tr> 75<th> 76 <p> 77 Expression 78 </p> 79 </th> 80<th> 81 <p> 82 Semantics 83 </p> 84 </th> 85<th> 86 <p> 87 Return type 88 </p> 89 </th> 90</tr></thead> 91<tbody><tr> 92<td> 93 <p> 94 <code class="computeroutput"><span class="identifier">l</span><span class="special">.</span><span class="identifier">subject</span></code> 95 </p> 96 </td> 97<td> 98 <p> 99 Subject lexer component. 100 </p> 101 </td> 102<td> 103 <p> 104 <a class="link" href="lexer.html" title="Lexer"><code class="computeroutput"><span class="identifier">Lexer</span></code></a> 105 </p> 106 </td> 107</tr></tbody> 108</table></div> 109<h6> 110<a name="spirit.lex.reference.lexer_concepts.unarylexer.h3"></a> 111 <span class="phrase"><a name="spirit.lex.reference.lexer_concepts.unarylexer.type_expressions"></a></span><a class="link" href="unarylexer.html#spirit.lex.reference.lexer_concepts.unarylexer.type_expressions">Type 112 Expressions</a> 113 </h6> 114<div class="informaltable"><table class="table"> 115<colgroup> 116<col> 117<col> 118</colgroup> 119<thead><tr> 120<th> 121 <p> 122 Expression 123 </p> 124 </th> 125<th> 126 <p> 127 Description 128 </p> 129 </th> 130</tr></thead> 131<tbody> 132<tr> 133<td> 134 <p> 135 <code class="computeroutput"><span class="identifier">L</span><span class="special">::</span><span class="identifier">subject_type</span></code> 136 </p> 137 </td> 138<td> 139 <p> 140 The subject lexer component type. 141 </p> 142 </td> 143</tr> 144<tr> 145<td> 146 <p> 147 <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_unary_lexer</span><span class="special"><</span><span class="identifier">L</span><span class="special">>::</span><span class="identifier">type</span></code> 148 </p> 149 </td> 150<td> 151 <p> 152 Metafunction that evaluates to <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></code> 153 if a certain type, <code class="computeroutput"><span class="identifier">L</span></code> 154 is a UnaryLexer, <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span></code> 155 otherwise (See <a href="../../../../../../../../libs/mpl/doc/refmanual/integral-constant.html" target="_top">MPL 156 Boolean Constant</a>). 157 </p> 158 </td> 159</tr> 160</tbody> 161</table></div> 162<h6> 163<a name="spirit.lex.reference.lexer_concepts.unarylexer.h4"></a> 164 <span class="phrase"><a name="spirit.lex.reference.lexer_concepts.unarylexer.invariants"></a></span><a class="link" href="unarylexer.html#spirit.lex.reference.lexer_concepts.unarylexer.invariants">Invariants</a> 165 </h6> 166<p> 167 For any UnaryLexer, <code class="computeroutput"><span class="identifier">L</span></code>, 168 the following invariant always holds: 169 </p> 170<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> 171 <code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_lexer</span><span class="special"><</span><span class="identifier">L</span><span class="special">::</span><span class="identifier">subject_type</span><span class="special">>::</span><span class="identifier">type</span></code> evaluates to <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></code> 172 </li></ul></div> 173<h6> 174<a name="spirit.lex.reference.lexer_concepts.unarylexer.h5"></a> 175 <span class="phrase"><a name="spirit.lex.reference.lexer_concepts.unarylexer.models"></a></span><a class="link" href="unarylexer.html#spirit.lex.reference.lexer_concepts.unarylexer.models">Models</a> 176 </h6> 177<p> 178 The following lexer components conform to this model: 179 </p> 180<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> 181 action lexer component (allowing to attach semantic actions) 182 </li></ul></div> 183<p> 184 <span class="bold"><strong>FIXME</strong></span> Add more links to models of UnaryLexer 185 concept 186 </p> 187</div> 188<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 189<td align="left"></td> 190<td align="right"><div class="copyright-footer">Copyright © 2001-2011 Joel de Guzman, Hartmut Kaiser<p> 191 Distributed under the Boost Software License, Version 1.0. (See accompanying 192 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 193 </p> 194</div></td> 195</tr></table> 196<hr> 197<div class="spirit-nav"> 198<a accesskey="p" href="primitivelexer.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../lexer_concepts.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="narylexer.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 199</div> 200</body> 201</html> 202