A PLATYPUS compiler for a course-wide assignment
Go to file
Victor Fernandes 24af981412 Fix non-C89 comments
Do not store into str_LTBL while checking for legal string
2017-03-16 17:54:28 -04:00
buffer Fix transition table. Need to fix string literal read 2017-03-15 20:57:28 -04:00
orig_big_file_test Bulk commit 2017-02-02 16:44:26 -05:00
orig_test_files Bulk commit 2017-02-02 16:44:26 -05:00
output_files Output test files: All working according to specs 2017-02-07 12:40:37 -05:00
.gitattributes BNF: Add C's syntax for conditional expressions as potential solution 2017-02-21 14:25:21 -05:00
.gitignore .gitignore: add VS-related project files 2017-02-13 18:39:58 -05:00
Ass01_W17.pdf Remove junk files, add program specs sheet 2017-02-01 18:16:33 -05:00
Assignment1_Victor Fernandes_040772243.docx Add Test Plan 2017-02-07 14:02:43 -05:00
INSTRUCTIONS.txt Mathematical fixes 2017-01-31 08:31:36 -05:00
Makefile make: default to build gcc+clang 2017-02-02 15:09:35 -05:00
PLATYPUS Grammar Specification.md merge 2017-03-13 19:14:01 -04:00
PLATYPUS_Regex.md merge regex conflict 2017-03-14 19:44:03 -04:00
PLATYPUS_Transition_Table.xlsx Fix transition table. Need to fix string literal read 2017-03-15 20:57:28 -04:00
README.md Fix README 2017-02-02 16:48:04 -05:00
buffer.c New "Project" for Scanner 2017-03-15 03:19:27 -04:00
buffer.h Fix non-C89 comments 2017-03-16 17:54:28 -04:00
platy_bt.c Fix mixed measurements, begin big file edge case tests 2017-02-02 12:28:13 -05:00
platy_st.c Scanner: oops wrong file 2017-03-06 10:58:14 -05:00
scanner.c Fix non-C89 comments 2017-03-16 17:54:28 -04:00
table.h Fix non-C89 comments 2017-03-16 17:54:28 -04:00
templates.txt First commit 2017-01-30 12:29:09 -05:00
token.h Do most of the switch cases 2017-03-14 22:35:12 -04:00

README.md

PLATYPUS

Buffer Descriptor for the PLATYPUS language specification

Building

In macOS/Linux

Requires

gcc (tested in version 6.3.x) or clang (tested under LLVM clang-0800.0.42.1)

  • make [gcc | clang]
    • Default is to build both versions (this is an aftermath of testing behaviour from different compilers)
    • It is safe to modify the default to either gcc or clang if you don't have one of them

Windows

Requires

  • msvc (tested under Visual Studio 2015 with Update 3, however VS2013 shouldn't behave abnormally either)
  • Disable language extensions (use ANSI C)

Running

  • macOS/linux
    • $ ./buffer_<compiler> <file> [f | a | m] > <out_file>
  • Windows
    • $ buffer <file> f | a | m] > <out_file>

Usage

  • F: fixed capacity mode. Buffe will not auto-resize if not enough space for the file
  • A: additive mode: Buffer will resize in a linear increment.
  • M: multiplicative mode: Buffer will resize based on a pre-set multiplier based on remaining allowed memory space ($SHRT_MAX bytes)

Notes

This is in no way complete, it is missing a scanner implementation, parser, symbol table, etc.

You can modify the initial capacity and increment factor defined in platy_bt.c (should really make that a command line parameter in a future release)

  • Increment factor range for additive mode: 1 - 255. (setting this to 0 implies fixed mode, regardless of the mode given in the command line)
  • Initial capacity range (in bytes): 0 - 32767 (SHRT_MAX)
  • This is due to my environment's install locations for the C include libraries:
    • Inside buffer.h, change the #include statement from mm_malloc.h to malloc.h, depending on what your compiler uses. Homebrew gcc6 installs on macOS might need this, but Linux and Windows generally will use malloc.h