-
Recent Posts
Archives
- May 2022
- April 2021
- June 2020
- May 2020
- April 2020
- November 2019
- July 2019
- October 2018
- May 2018
- October 2017
- May 2017
- April 2017
- January 2017
- December 2016
- September 2016
- August 2016
- June 2016
- May 2016
- April 2016
- February 2016
- December 2015
- October 2015
- September 2015
- August 2015
- July 2015
- May 2015
- March 2015
- February 2015
- January 2015
- December 2014
- October 2014
- September 2014
- November 2012
- October 2012
- September 2012
Monthly Archives: October 2012
JSON Pretty Printer
Just learning from a book and not getting anything working was starting to bother me, so I decided to throw together a quick JSON pretty printer. It’s just a tiny little C# project, thrown together in about 2-3 hours this … Continue reading
Posted in computer science, software
Leave a comment
Input Buffering and Regular Expressions (3.2 and 3.3)
The section on input buffering was pretty short. Basically, buffering input saves you time and is more convenient than jumping around an input stream a lot. Nothing groundbreaking. The chapter on regexes probably would be groundbreaking if you weren’t, you … Continue reading
Posted in computer science
Leave a comment
Lexical Analysis: The Role of the Lexical Analyzer Section 3.1
This chapter was mostly just a recap of things that were already covered about lexers. 3.1.1: Divide the following C++ program into appropriate lexemes. Which lexemes should get associated lexical values? What should those values be? float limitedSquare(x) float x; … Continue reading
Posted in computer science, Dragon book
Leave a comment
Ending Chapter 2
Section 2.7 is about symbol tables and has no exercises. Basically, the technique they talk about is, as you’re parsing the source, you move symbol tables around. So you start out with a null symbol table, and each time you … Continue reading
Posted in computer science, Dragon book
Leave a comment
Exercises from 2.6 are up
All of the exercises are up on my github. Here’s a few things I’ve discovered: 1) Don’t try to be too smart. I’m using C# so fuck it, I’m gonna use int.Parse() and stream.Peek() 2) I’m using inheritance over composition … Continue reading
Posted in Dragon book
Leave a comment
Lexical Analysis (2.6)
Lexers! I’ve sort of written lexers before, although not of this generality, so this material is mostly familiar to me. The chapter provides a simple lexer (below), in Java. Old Java (pre-generics, so, what, 1.4 or someting?). I’m doing the … Continue reading
Posted in computer science, Dragon book
Leave a comment
Unit tests!
Added a few unit tests for the program used in 2.4.1. Check it out here! I’m using the new Visual Studio 2012 Express, which is nice so far – allows me to do unit testing, at least, and I have … Continue reading
Posted in Dragon book
Leave a comment
Syntax-Directed Translation, Parsing (2.3, 2.4)
So I skipped the section 2.3 exercises. They were asking for a bunch of translation schemes that were almost identical to the ones given in the chapter, which is boring. I was thinking about just writing code for them, but … Continue reading
Posted in Dragon book
Leave a comment