[llvm-commits] [llvm] r43810 - /llvm/trunk/docs/tutorial/LangImpl6.html

Chris Lattner sabre at nondot.org
Tue Nov 6 22:06:39 PST 2007


Author: lattner
Date: Wed Nov  7 00:06:38 2007
New Revision: 43810

URL: http://llvm.org/viewvc/llvm-project?rev=43810&view=rev
Log:
edits for chapter 7

Modified:
    llvm/trunk/docs/tutorial/LangImpl6.html

Modified: llvm/trunk/docs/tutorial/LangImpl6.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl6.html?rev=43810&r1=43809&r2=43810&view=diff

==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl6.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl6.html Wed Nov  7 00:06:38 2007
@@ -52,9 +52,9 @@
 decide what is good or bad.  In this tutorial we'll assume that it is okay and
 use this as a way to show some interesting parsing techniques.</p>
 
-<p>At the end of this tutorial, we'll <a href="#example">run through a nice
-little example</a> that shows an example application that you can build with
-Kaleidoscope and the feature set it now has.</p>
+<p>At the end of this tutorial, we'll run through an example Kaleidoscope 
+application that <a href="#example">renders the Mandelbrot set</a>.  This gives 
+an example of what you can build with Kaleidoscope and its feature set.</p>
 
 </div>
 
@@ -69,8 +69,8 @@
 languages like C++.  In C++, you are only allowed to redefine existing
 operators: you can't programatically change the grammar, introduce new
 operators, change precedence levels, etc.  In this chapter, we will add this
-capability to Kaleidoscope, which will allow us to round out the set of
-operators that are supported, culminating in a more interesting example app.</p>
+capability to Kaleidoscope, which will let the user round out the set of
+operators that are supported.</p>
 
 <p>The point of going into user-defined operators in a tutorial like this is to
 show the power and flexibility of using a hand-written parser.  The parser we
@@ -262,7 +262,7 @@
 that sets up <tt>FnName</tt> for binary operators.  This builds names like
 "binary@" for a newly defined "@" operator.  This takes advantage of the fact
 that symbol names in the LLVM symbol table are allowed to have any character in
-them, inluding embedded nul characters.</p>
+them, even including embedded nul characters.</p>
 
 <p>The next interesting piece is codegen support for these binary operators.
 Given our current structure, this is a simple addition of a default case for our
@@ -335,7 +335,7 @@
 
 <p>With that, we have useful user-defined binary operators.  This builds a lot
 on the previous framework we built for other operators.  Adding unary operators
-is a bit more challenging, because we don't have any framework for it yet, lets
+is a bit more challenging, because we don't have any framework for it yet - lets
 see what it takes.</p>
 
 </div>
@@ -347,7 +347,7 @@
 <div class="doc_text">
 
 <p>Since we don't currently support unary operators in the Kaleidoscope
-langugage, we'll need to add everything for them.  Above, we added simple
+language, we'll need to add everything for them.  Above, we added simple
 support for the 'unary' keyword to the lexer.  In addition to that, we need an
 AST node:</p>
 
@@ -530,8 +530,7 @@
 def unary-(v)
   0-v;
 
-# Define > with the same precedence as >.  We could also easily define
-# <= etc.
+# Define > with the same precedence as >.
 def binary> 10 (LHS RHS)
   !(LHS < RHS);
 
@@ -615,13 +614,13 @@
 <tt>mandelconverge</tt> function returns the number of iterations that it takes
 for a complex orbit to escape, saturating to 255.  This is not a very useful
 function by itself, but if you plot its value over a two-dimensional plane,
-you can see the mandelbrot set.  Given that we are limited to using putchard
+you can see the Mandelbrot set.  Given that we are limited to using putchard
 here, our amazing graphical output is limited, but we can whip together
 something using the density plotter above:</p>
 
 <div class="doc_code">
 <pre>
-# compute and plot the mandlebrot set with the specified 2 dimentional range
+# compute and plot the mandlebrot set with the specified 2 dimensional range
 # info.
 def mandelhelp(xmin xmax xstep   ymin ymax ystep)
   for y = ymin, y < ymax, ystep in (
@@ -631,7 +630,7 @@
   )
  
 # mandel - This is a convenient helper function for ploting the mandelbrot set
-# from the specified position with the specified magnification.
+# from the specified position with the specified Magnification.
 def mandel(realstart imagstart realmag imagmag) 
   mandelhelp(realstart, realstart+realmag*78, realmag,
              imagstart, imagstart+imagmag*40, imagmag);
@@ -782,12 +781,12 @@
 <p>With this, we conclude the "adding user-defined operators" chapter of the
 tutorial.  We successfully extended our language with the ability to extend the
 language in the library, and showed how this can be used to build a simple but
-interesting end user application in Kaleidoscope.  At this point, Kaleidoscope
+interesting end-user application in Kaleidoscope.  At this point, Kaleidoscope
 can build a variety of applications that are functional and can call functions
 with side-effects, but it can't actually define and mutate a variable itself.
 </p>
 
-<p>Strikingly, lack of this feature is an important limitation for some
+<p>Strikingly, variable mutation is an important feature of some
 languages, and it is not at all obvious how to <a href="LangImpl7.html">add
 support for mutable variables</a> without having to add an "SSA construction"
 phase to your front-end.  In the next chapter, we will describe how you can





More information about the llvm-commits mailing list