1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd"> 3<article id="code_block" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude"> 4 <title>Code Block</title> 5 <section id="code_block.test_1"> 6 <title>Test 1</title> 7 <para> 8 A code block with proper indentation ;-) 9 </para> 10<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase> 11 12<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> 13<phrase role="special">{</phrase> 14 <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"Hello, World!"</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> 15 <phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase> 16<phrase role="special">}</phrase> 17</programlisting> 18 </section> 19 <section id="code_block.test_2"> 20 <title>Test 2</title> 21 <para> 22 A code block with proper indentation ;-) 23 </para> 24 <para> 25<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">iostream</phrase><phrase role="special">></phrase> 26 27<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase> 28<phrase role="special">{</phrase> 29 <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"Hello, World!"</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> 30 <phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase> 31<phrase role="special">}</phrase> 32</programlisting> 33 </para> 34 </section> 35 <section id="code_block.test_3"> 36 <title>Test 3</title> 37 <para> 38<programlisting><phrase role="keyword">print</phrase> <phrase role="string">"\xfabln\xeck"</phrase> 39</programlisting> 40 </para> 41 </section> 42 <section id="code_block.test_4"> 43 <title>Test 4</title> 44 <para> 45 This isn't valid C++ but I think we should accept it; 46 </para> 47 <para> 48<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase><phrase role="special"><<</phrase><phrase role="string">"\xfabln\xeck"</phrase><phrase role="special"><<</phrase><phrase role="string">"\n"</phrase><phrase role="special">;</phrase> 49</programlisting> 50 </para> 51 </section> 52</article> 53