skeet70 / pascal-compiler

A project Pascal compiler written in Haskell.
5 stars 1 forks source link

High-level Conceptual Model #18

Closed iduhetonas closed 11 years ago

iduhetonas commented 11 years ago

I created a working thought process towards the "flow" of how we'll implement the scanner and the overall structure of the program. It's unfinished, and just a draft, but I've added the .dia and .png files to the "develop" branch in case you want to amend.

This isn't exactly a UML diagram, so I've defined the shapes as follows.

Essentially, I'm hoping we build our Scanner in such a way that it doesn't load the file into memory each time, but rather acts as a variable loaded into the Driver. I believe this will help us later on if we end up having to compile a program that spans across multiple files on the hard disk.

Hopefully we can make this extensible enough so that the Dispatcher doesn't need to be redesigned as we learn more about the project.

I've attached the .png to this thread as well; please add any thoughts.

High-level Conceptual Model

skeet70 commented 11 years ago

I'm not really sure if this is any different from the way he already described it. Isn't this still going to have to load the file into memory? Maybe I'm confused... Also, whats the Delegator?

One thing to change is that the Scanner (containing the getToken method) is the Dispatcher.

iduhetonas commented 11 years ago

It's almost exactly as he had described, with a small difference. I had wanted to make sure that we don't accidentally design it so that we're forced to read in a file more than once.

I also wanted to make sure that the three of us are on the same page, that we can change the design, and that we're all aware of what's going on.

skeet70 commented 11 years ago

I know, I just don't get it haha. Whats the Delegator, how does this avoid loading this into memory (every time?), and what is the small difference (other than breaking out the dispatcher into it's own section, which I'm assuming was just a mistake not intentional?)

iduhetonas commented 11 years ago

Whoops, Delegator was a mistake. I've rectified it. They're interchangeable in my mind, but I'll try to remain consistent.

The only small difference is that we read a list, and not a file when performing the "getLineNumber" "getColumnNumber" functions, and we only do it once. Therefore, in my mind, they're related to the list that we call, but are a subset of "Scanner" functions.

It's still a draft, so I'm still not 100% sure how we'll do it. I might also not be displaying this in the best way.

iduhetonas commented 11 years ago

I believe that tomorrow (Wednesday, January 23rd) we should have a meeting to discuss what we can do about these for the next couple of days. How does that sound?

skeet70 commented 11 years ago

Just adding an updated version of this: Scanner Toplevel