Skip to content

Latest commit

 

History

History
227 lines (196 loc) · 3.79 KB

README.md

File metadata and controls

227 lines (196 loc) · 3.79 KB

compiler

Note: Use Joel's compilerFastCheck.sh! Read the instructions. I should have the config set up properly but you'll need to copy the stage0 dat files:

From the compiler directory on csunix:

cp /usr/local/4301/data/stage0 input

Then, while still in the compiler directory:

mkdir output

Once you make stage0 you can run ./compilerFastCheck.sh and it will print all kinds of magical information!

DIFF CHECKLIST

  • 001
  • 002
  • 003
  • 004
  • 005
  • 006
  • 007
  • 008
  • 009
  • 010
  • 011
  • 012
  • 013
  • 014
  • 015
  • 016
  • 017
  • 018
  • 019
  • 020
  • 021
  • 022
  • 023
  • 024
  • 025
  • 026
  • 027
  • 028
  • 029
  • 030
  • 031
  • 032
  • 033
  • 034
  • 035
  • 036
  • 037
  • 038
  • 039
  • 040
  • 041
  • 042
  • 043
  • 044
  • 045
  • 046
  • 047
  • 048
  • 049
  • 050
  • 051
  • 052 - Joel submitted this one last year!
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161 -- wrong error!
  • 162
  • 163
  • 164
  • 165 -- wrong error!
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178

Compiler project for Algorithmic Languages and Compilers — Fall 2022

CS 4301 Jeff Caldwell Kangmin Kim

Lecture references

First look at project

Week 9, October 20, 50:00

Producing two other files

  • Listing file

  • Object file

  • Errors should be printed to listing file and compilation should stop

    • Motl says "You should find that first error and stop"
  • Symbol table entries will be stored as maps

    • key will be the name the user has given to the symbol (external name)
    • value: internal name, data type, data mode, value, allocation, units
      • Values added during insert statement in progStmt

Womack gave us some scripts!

setup.sh and createData.sh

To run them:

chmod 771 setup.sh
chmod 771 createData.sh

"setup can be ran anywhere and will make a data folder in that directory, createData needs to be moved into the data folder and will create an output file and diffs and whatnot"

"Note that to use to use shell scripts after the chmod they can be activated like:"

./setup.sh

"Note that this does not make a stage0.cpp in the data folder. You need to copy or move one in there before calling createData

Also calling setup again will clean out and remake said data folder"

"Also if your wondering why it says you have diffs and there's no obvious difference, instead of using"

<< "\n"

Do instead 

<< "\r\n"

Notes

The focus of Stage 0 is just the declaration of our data.

We have the benefit of being in very different time zones! One of us can be working on the project at almost all times this weekend.

Check the lecture from November 3, 2022 — Dr. Motl talks about the need to patch something that's not in the pseudocode.

Page 9 of Overall Compiler Structure near the code block:

if (y == "not")
{
if (nextToken() is not a BOOLEAN)
processError(boolean expected after “not”)
if (token == "true")
y = "false"
else
y = "true"
}

He also mentions something about a while loop

Motl says unit will be either 0 or 1