Giter Club home page Giter Club logo

c415-compiler's People

Contributors

dchui1 avatar james-osgood avatar mnbujold avatar

Watchers

 avatar

c415-compiler's Issues

Escape Characters

As per the discussion in class today, we need to be able to escape any characters and (I think) let the interpreter deal with what those symbols mean.

Test these changes on the cp1/21.pal test program.

Man Page

Man page needs to be written.

Seg fault

We get a segmentation fault in g04.pal. Not good. Maybe we should have an "exit gracefully" wrapper ...

Also get a seg fault in:
g07.pal

Built-ins are on two levels

For some reason, the built-ins are spread between level -1 and level 0, thus reducing the number of levels of scope that we can support from 15 to 14.

Change symbol_rec

Change symbol_rec so that all symbols have a struct type_desc. This will make type checking waay easier than having to check which object class it is, then get the tyep description based on that object class, etc...

Array stuff may no longer work

I am changing the way that variables are pushed onto the stack, so we can actually keep track of the address of each variable (it was not actually tracked before). So this will PROBABLY break your array access code. But it's for the best, right?

Comments

On nt01.pal, the line number is off by 1 after the big block comment at the top. I suyspect it's because we forget to count the newline at the end of the block comment

Comments

We should do our best to follow good coding practice and comment code when appropriate.

print out all line numbers for comments

For comments, print out all the line numbers instead of just printing out the last line of the commment at the beginning

ie:

{8} { asdgasdgasdgasgas

.....

}

Division with real numbers?

In test g11.pal, the '/' operator does not allow for division by integers, according to our compiler.

Is this actually legal?

String lengths do not match

Probably because of the null end character (?), strings do not actually have the same size as arrays that should have the same size.

Command line options not working properly

The compiler still produces a .lst file when the -n option is used, contrary to specifications (although the entire listing is not printed out to stdout - so that part works).

Add these builtins

read, readln, write, writeln
intger, real, character, string io

ord
chr
trunc
round

succ
pred

odd

abs
sqr
sqrt
sin
exp
ln

true
false
maxint
minint

Strings and escaped characters

Test g20.pal, on line 159, has a string with many escaped characters. What is the length of the string when assigning it to another string?

Newlines in strings will screw up line count

Having non escaped new lines (eg the user hitting the return key) within a string will screw up the line count; these are not counted towards the newline and so the line count will be off by however many newlines there are in there

Scope 1 level too small

Running the compiler on 8.pal causes "scope too big errors" on level 14 (procedure layer14()), which it should not.

We aren't doing constant folding

Turns out we're not doing constant folding. Either that, or the syntax tree does not actually return teh folded constant value and instead returns the 2 constants

0.pal output formatting

Our compiler adds an extra empty line to every line in the 0.pal listing and output. Doesn't seem to happen with the other tests.

Carets not indicating correct position

On some test, the '^' symbol does not correctly indicate where the error occurred on the line. The caret is in the correct location for our tests (0.pal and 1.pal specifically), but not for all of Piotr's tests.

Errors on same line have same error number

If more than one error occurs on a single line, all those errors have the same line number. However, subsequent error numbers and the total error count are still correct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.