add table of contents to each chapter.
authorChris Lattner <sabre@nondot.org>
Mon, 5 Nov 2007 19:06:59 +0000 (19:06 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 5 Nov 2007 19:06:59 +0000 (19:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43723 91177308-0d34-0410-b5e6-96231b3b80d8

docs/tutorial/LangImpl1.html
docs/tutorial/LangImpl2.html
docs/tutorial/LangImpl3.html
docs/tutorial/LangImpl4.html
docs/tutorial/LangImpl5.html
docs/tutorial/LangImpl6.html
docs/tutorial/LangImpl7.html

index 6325d3c28970ad9c974e414abd535779dc35087c..8d967508238ecf33cb54f172c52dc56fffcd69d0 100644 (file)
 
 <div class="doc_title">Kaleidoscope: The basic language, with its lexer</div>
 
+<ul>
+<li>Chapter 1
+  <ol>
+    <li><a href="#intro">Tutorial Introduction</a></li>
+    <li><a href="#language">The Basic Language</a></li>
+    <li><a href="#lexer">The Lexer</a></li>
+  </ol>
+</li>
+</ul>
+
 <div class="doc_author">
   <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
 </div>
@@ -32,7 +42,7 @@ can extend to other languages and to play with other things.
 </div>
 
 <!-- *********************************************************************** -->
-<div class="doc_section"><a name="language">The basic language</a></div>
+<div class="doc_section"><a name="language">The Basic Language</a></div>
 <!-- *********************************************************************** -->
 
 <div class="doc_text">
@@ -99,7 +109,7 @@ a lot of fun to play with languages!</p>
 </div>
 
 <!-- *********************************************************************** -->
-<div class="doc_section"><a name="language">The Lexer</a></div>
+<div class="doc_section"><a name="lexer">The Lexer</a></div>
 <!-- *********************************************************************** -->
 
 <div class="doc_text">
index edf19a8b483315d184b91294b358027fa68518a4..2339d96a91292e380746dc6915e6f5d291e74052 100644 (file)
 
 <div class="doc_title">Kaleidoscope: Implementing a Parser and AST</div>
 
+<ul>
+<li>Chapter 2
+  <ol>
+    <li><a href="#intro">Chapter 2 Introduction</a></li>
+    <li><a href="#ast">The Abstract Syntax Tree (AST)</a></li>
+    <li><a href="#parserbasics">Parser Basics</a></li>
+    <li><a href="#parserprimexprs">Basic Expression Parsing</a></li>
+    <li><a href="#parserbinops">Binary Expression Parsing</a></li>
+    <li><a href="#parsertop">Parsing the Rest</a></li>
+    <li><a href="#driver">The Driver</a></li>
+    <li><a href="#conclusions">Conclusions</a></li>
+    <li><a href="#code">Full Code Listing</a></li>
+  </ol>
+</li>
+</ul>
+
 <div class="doc_author">
   <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
 </div>
 
 <!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 2 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 2 Introduction</a></div>
 <!-- *********************************************************************** -->
 
 <div class="doc_text">
 
-<p>Welcome to part 2 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial.  This chapter shows you how to use the <a 
+<p>Welcome to Chapter 2 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial.  This chapter shows you how to use the <a 
 href="LangImpl1.html">Lexer built in Chapter 1</a> to build a full <a
 href="http://en.wikipedia.org/wiki/Parsing">parser</a> for
 our Kaleidoscope language and build an <a 
@@ -725,7 +741,7 @@ type "4+5;" and the parser will know you are done.</p>
 </div>
 
 <!-- *********************************************************************** -->
-<div class="doc_section"><a name="code">Conclusions and the Full Code</a></div>
+<div class="doc_section"><a name="conclusions">Conclusions</a></div>
 <!-- *********************************************************************** -->
 
 <div class="doc_text">
index 59513ab3f66f6188ce5d45a1aecd022287894ee3..2e961d2f610a2de050e84375ec1d2b2e204a9e7b 100644 (file)
 
 <div class="doc_title">Kaleidoscope: Code generation to LLVM IR</div>
 
+<ul>
+<li>Chapter 3
+  <ol>
+    <li><a href="#intro">Chapter 3 Introduction</a></li>
+    <li><a href="#basics">Code Generation setup</a></li>
+    <li><a href="#exprs">Expression Code Generation</a></li>
+    <li><a href="#funcs">Function Code Generation</a></li>
+    <li><a href="#driver">Driver Changes and Closing Thoughts</a></li>
+    <li><a href="#code">Full Code Listing</a></li>
+  </ol>
+</li>
+</ul>
+
 <div class="doc_author">
   <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
 </div>
 
 <!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 3 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 3 Introduction</a></div>
 <!-- *********************************************************************** -->
 
 <div class="doc_text">
 
-<p>Welcome to part 3 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial.  This chapter shows you how to transform the <a 
+<p>Welcome to Chapter 3 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial.  This chapter shows you how to transform the <a 
 href="LangImpl2.html">Abstract Syntax Tree built in Chapter 2</a> into LLVM IR.
 This will teach you a little bit about how LLVM does things, as well as
 demonstrate how easy it is to use.  It's much more work to build a lexer and
index 6fb2c8824d8fe2a27128bdf6acd1c7dbe9a93ae9..6bafacba46153424f0835f73e41e421bfea610c8 100644 (file)
 
 <div class="doc_title">Kaleidoscope: Adding JIT and Optimizer Support</div>
 
+<ul>
+<li>Chapter 4
+  <ol>
+    <li><a href="#intro">Chapter 4 Introduction</a></li>
+    <li><a href="#trivialconstfold">Trivial Constant Folding</a></li>
+    <li><a href="#optimizerpasses">LLVM Optimization Passes</a></li>
+    <li><a href="#jit">Adding a JIT Compiler</a></li>
+    <li><a href="#code">Full Code Listing</a></li>
+  </ol>
+</li>
+</ul>
+
 <div class="doc_author">
   <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
 </div>
 
 <!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 4 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 4 Introduction</a></div>
 <!-- *********************************************************************** -->
 
 <div class="doc_text">
 
-<p>Welcome to part 4 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial.  Parts 1-3 described the implementation of a simple language
-and included support for generating LLVM IR.  This chapter describes two new
-techniques: adding optimizer support to your language, and adding JIT compiler
-support.  This shows how to get nice efficient code for your language.</p>
+<p>Welcome to Chapter 4 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial.  Parts 1-3 described the implementation of a simple
+language and included support for generating LLVM IR.  This chapter describes
+two new techniques: adding optimizer support to your language, and adding JIT
+compiler support.  This shows how to get nice efficient code for your
+language.</p>
 
 </div>
 
index 09477faba6e2fe83eafae5ec523a3a635bd5b545..a57975801425c938700790c95597276177c7ec5a 100644 (file)
 
 <div class="doc_title">Kaleidoscope: Extending the Language: Control Flow</div>
 
+<ul>
+<li>Chapter 5
+  <ol>
+    <li><a href="#intro">Chapter 5 Introduction</a></li>
+    <li><a href="#ifthen">If/Then/Else</a>
+    <ol>
+      <li><a href="#iflexer">Lexer Extensions</a></li>
+      <li><a href="#ifast">AST Extensions</a></li>
+      <li><a href="#ifparser">Parser Extensions</a></li>
+      <li><a href="#ifir">LLVM IR</a></li>
+      <li><a href="#ifcodegen">Code Generation</a></li>
+    </ol>
+    </li>
+    <li><a href="#for">'for' Loop Expression</a>
+    <ol>
+      <li><a href="#forlexer">Lexer Extensions</a></li>
+      <li><a href="#forast">AST Extensions</a></li>
+      <li><a href="#forparser">Parser Extensions</a></li>
+      <li><a href="#forir">LLVM IR</a></li>
+      <li><a href="#forcodegen">Code Generation</a></li>
+    </ol>
+    </li>
+    <li><a href="#code">Full Code Listing</a></li>
+  </ol>
+</li>
+</ul>
+
 <div class="doc_author">
   <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
 </div>
 
 <!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 5 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 5 Introduction</a></div>
 <!-- *********************************************************************** -->
 
 <div class="doc_text">
 
-<p>Welcome to Part 5 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial.  Parts 1-4 described the implementation of the simple
+<p>Welcome to Chapter 5 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial.  Parts 1-4 described the implementation of the simple
 Kaleidoscope language and included support for generating LLVM IR, following by
 optimizations and a JIT compiler.  Unfortunately, as presented, Kaleidoscope is
 mostly useless: it has no control flow other than call and return.  This means
@@ -116,7 +143,7 @@ stuff:</p>
 
 <!-- ======================================================================= -->
 <div class="doc_subsubsection"><a name="ifast">AST Extensions for
- If/Then/Else </a></div>
+ If/Then/Else</a></div>
 <!-- ======================================================================= -->
 
 <div class="doc_text">
@@ -142,7 +169,7 @@ public:
 
 <!-- ======================================================================= -->
 <div class="doc_subsubsection"><a name="ifparser">Parser Extensions for
-If/Then/Else </a></div>
+If/Then/Else</a></div>
 <!-- ======================================================================= -->
 
 <div class="doc_text">
index 5a184c2c1817d466de465af432bf12dc3bc9faa0..978ba8e1cd67022bb6717518aaab48c32d3f53aa 100644 (file)
 
 <div class="doc_title">Kaleidoscope: Extending the Language: User-defined Operators</div>
 
+<ul>
+<li>Chapter 6
+  <ol>
+    <li><a href="#intro">Chapter 6 Introduction</a></li>
+    <li><a href="#idea">User-defined Operators: the Idea</a></li>
+    <li><a href="#binary">User-defined Binary Operators</a></li>
+    <li><a href="#unary">User-defined Unary Operators</a></li>
+    <li><a href="#example">Kicking the Tires</a></li>
+    <li><a href="#code">Full Code Listing</a></li>
+  </ol>
+</li>
+</ul>
+
 <div class="doc_author">
   <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
 </div>
 
 <!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 6 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 6 Introduction</a></div>
 <!-- *********************************************************************** -->
 
 <div class="doc_text">
 
-<p>Welcome to Part 6 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial.  At this point in our tutorial, we now have a fully
+<p>Welcome to Chapter 6 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial.  At this point in our tutorial, we now have a fully
 functional language that is fairly minimal, but also useful.  One big problem
 with it though is that it doesn't have many useful operators (like division,
 logical negation, or even any comparisons other than less-than.</p>
index 07dd5c620f80364aa99f5c4f2409b2cf59cc467e..bea97e51dada9ced8b840f0a868b79c3afb05f76 100644 (file)
 
 <div class="doc_title">Kaleidoscope: Extending the Language: Mutable Variables</div>
 
+<ul>
+<li>Chapter 7
+  <ol>
+    <li><a href="#intro">Chapter 7 Introduction</a></li>
+    <li><a href="#why">Why is this a hard problem?</a></li>
+    <li><a href="#memory">Memory in LLVM</a></li>
+    <li><a href="#kalvars">Mutable Variables in Kaleidoscope</a></li>
+    <li><a href="#adjustments">Adjusting Existing Variables for
+     Mutation</a></li>
+    <li><a href="#assignment">New Assignment Operator</a></li>
+    <li><a href="#localvars">User-defined Local Variables</a></li>
+    <li><a href="#code">Full Code Listing</a></li>
+  </ol>
+</li>
+</ul>
+
 <div class="doc_author">
   <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
 </div>
 
 <!-- *********************************************************************** -->
-<div class="doc_section"><a name="intro">Part 7 Introduction</a></div>
+<div class="doc_section"><a name="intro">Chapter 7 Introduction</a></div>
 <!-- *********************************************************************** -->
 
 <div class="doc_text">
 
-<p>Welcome to Part 7 of the "<a href="index.html">Implementing a language with
-LLVM</a>" tutorial.  In parts 1 through 6, we've built a very respectable,
-albeit simple, <a 
+<p>Welcome to Chapter 7 of the "<a href="index.html">Implementing a language
+with LLVM</a>" tutorial.  In chapters 1 through 6, we've built a very
+respectable, albeit simple, <a 
 href="http://en.wikipedia.org/wiki/Functional_programming">functional
 programming language</a>.  In our journey, we learned some parsing techniques,
 how to build and represent an AST, how to build LLVM IR, and how to optimize