Pete's Log: compile it, yo!

Entry #793, (Coding, Hacking, & CS stuff)
(posted when I was 22 years old.)

so one of the things I need to write is methods that print out the IR I generate as compilable C code. Easy enough. But I want the C code to look pretty. So it wants to be indented so this isn't anything particularly novel, but I thought it was fun: I created an "indenter" class which has methods to increase and decrease the indentation level, and then I wrote an operator<< for the indenter so that now I can have code that looks pretty when I output code.
indenter indent(0);
//...
cout << indent << "int main(int argc, char* argv[])" << endl;
cout << indent << "{" << endl;
indent.Right();
cout << indent << "return 0;" << endl;
indent.Left();
cout << indent << "}" << endl;

Just another one of those small things that makes me like C++... it's trivial, yet it makes the code look so pretty... imho, at least...

frustration sets in again as I realize I don't have access to data structures I need access to. Blargh. Punt for now.

I've been promised a 21" monitor if I am willing to wait a few months. Sweetness. This monitor I use now is el suckage royal. Or is that royale? It's hard to know the gender of made up words in other languages. I've not a clue what I'm talking bout.

this STL concept is sheer brilliance. Unfortunately my code for compilers is gonna contain a lot of hand-coded linked lists. Not exactly my choice, but oh well. It's all good. good progress is finally being made on the IR. I should have it done this weekend. Hopefully with time left over to do a literature search for Dr Freeh.

This IR code I'm generating is funny. A few simple optimizations would cut it significantly in size. But in its current state it's a bit better suited for use during code generation...