<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Jacob&apos;s Program Design Blog</title>
    <link rel="alternate" type="text/html" href="http://blog.lib.umn.edu/grime070/myblog/" />
    <link rel="self" type="application/atom+xml" href="http://blog.lib.umn.edu/grime070/myblog/atom.xml" />
    <id>tag:blog.lib.umn.edu,2012-03-17:/grime070/myblog//16118</id>
    <updated>2012-03-19T06:33:31Z</updated>
    <subtitle>A blog for CSCI 3081.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Enterprise 4.31-en</generator>

<entry>
    <title>Translator Iteration 1</title>
    <link rel="alternate" type="text/html" href="http://blog.lib.umn.edu/grime070/myblog/2012/03/translator-iteration-1.html" />
    <id>tag:blog.lib.umn.edu,2012:/grime070/myblog//16118.346415</id>

    <published>2012-03-17T21:26:02Z</published>
    <updated>2012-03-19T06:33:31Z</updated>

    <summary>The first challenge for the translater was to create a scanner. To do this I wrote up the scan method on paper, using a variety of functions my partner and I did not actually have yet. These functions were: 1....</summary>
    <author>
        <name>grime070</name>
        
    </author>
    
    <category term="scanneriteration_1" label="#scanner #iteration_1" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.lib.umn.edu/grime070/myblog/">
        <![CDATA[<p>The first challenge for the translater was to create a scanner. To do this I wrote up the scan method on paper, using a variety of functions my partner and I did not actually have yet. These functions were:<br />
1. to make the regular expressions<br />
2. to recognize the regular expressions<br />
3. to eat whitespace<br />
4. to remove the first x characters of a string and return them as a string<br />
5. to add a node to the end of a list given the list's head.<br />
Then we wrote and tested each function, and once these were done, I wrote and tested the scan method.</p>

<p>I wrote functions 1-3. This was not especially hard because I took most of the code from lab 3. I stored the regular expressions in global variables. I know using global variables is poor practice, but I didn't know how else to avoid passing 50+ variables between functions. Another problem was matching keywords. At first I tried matching word boundaries, but for some reason the tests didn't pass. I ended up ignoring the issue and relying on the fact that "mainbar" would match more characters as a variable than as a keyword.</p>

<p>To test, I merely used the testing structure that the website provided us. Every time I implemented a small feature, I would create a test for the feature. I made tests for the first lexeme, after a few more lexemes, and then after all lexemes were done.</p>

<p>When the time came to integrate the functions, some of the tests for scan did not pass. I opened the program in gdb and stepped through until I found anything strange happened. It turned out that my whitespace function was wrong and I hadn't tested it properly.</p>

<p>Working with a partner was slightly challenging, because he is new to programming and required some assistance building his functions.</p>

<p>Overall there were no major hangups and we plan to employ a similar iterative design process for Iteration 2.</p>]]>
        
    </content>
</entry>

</feed>
