Note This project is part of a M1 study done at the University of Strasbourg, France.
To install qtspim, please ensure you have the right minimal dependencies installed :
cd vm && sudo dpkg -i qtspim.deb
sudo apt-get install libgl1 libxkbcommon-x11-0Then compile a release version of the program with :
make releaseThe produced executable binary is to be found inside of the bin folder.
The program takes command line arguments from (.. indicating no short option, <> that an argument is required and * mutual incompatibility) :
| command | hint | required ? | default |
|---|---|---|---|
-h, --help |
display help and exit | ❔ | |
-v, --version |
display version and exit | ❔ | |
-l, --license |
display license and exit | ❔ | |
-i, --in <> |
path to input file | ✔️ | |
-o, --out <> |
path to output file | ❌ | a.s |
.., --tos |
display the Symbol Table on running time | ❌ | |
.., --verbose |
be very noisy | ❌ | |
.., --no-exe |
do not execute output file | ❌ | |
-O, --optlvl <> |
set optimization level (from 0 or 1) |
❌ | 0 |
Note that at the time of writing, the only optimization level implemented is 0. Furthermore, -i and -o can be omitter, provided that both (if both) are typed in order. If only one option is used without the hint, you can specify it wherever you want in the command line.
A legal launching instruction could be :
./bin/sos -o out.s examples/hello_world.sos --tos --verboseOh god... please don't.
Still, make sure you have valgrind up and ready and then run :
cd tests && make check_quietIf you ever want to contribute, please begin by reading our Contributing Guidelines.
The standard procedure is :
fork -> git branch -> push -> pull requestNote that we won't accept any PR :
- that does not follow our Contributing Guidelines
- that is not sufficiently commented or isn't well formated
- without any proper test suite
- with a failing or incomplete test suite
Happy coding ! 🙂
This project is licensed under the GPL-3.0 new or revised license. Please read the LICENSE file.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the SoS2MIPS authors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
V1 First Release Version (click here to expand)
v1.1 boy do i hate makefiles
- properly linked lex/yacc objects file this time
dispose_on_exitwas being changed on-iinstead of-o- removed
-Werrorcompile flag untilstatic int input(void)is either used or no longer static - added
-Werrorback (with%option noinputin./gen/lexer.l) - created grammar (shoutout to ThomasD !)
v1.2 but what is a quad ?
quad,symtableandvecheader filesvecshould now be thread safe (still need unit tests for that)- updated doc
- implemented
symtable(not based ondict- might change that later) quadis a struct with atypeand avalue- do I go along the AST route? send help
v1.3 memory
- implemented
.datasegment - assembly instructions stack
- now we compile
--no-exeflag to not run the compiled assembly file
v1.4 the end is near
- more to assembly instructions stack for
jandjal - wrote control flow structures and some more logical expressions
- now we use
sbrk - default
exit, can be omitted
v1.5 looooooooooops
- added
whileandforloops - rewrote
ifandelse - some
echofixes
v1.6 functions
- added
functionandreturnkeywords - we can use loops inside functions now
- some more
echofixes - runtime errors are now handled by
_errorblock
known bugs (final correction patch version) see Issues
(not a bug, please just do not useqtspim -file ./vm/qtspim/helloworld.sis failing to parse the assembly file-bare)
todo (first implementation version)
- add lex/yacc to makefiles
(throw
.hto inc folder and.cto src folder ; then add files to wildcard) [v0.2.1] - make sure qtspim is properly working (dump in some example files) [v0.1.1]
- create grammar (that's a big fish, please send help) [v1.1]
- improve error messages on
yylexandyyparse(point the current line and make a suggestion) - standard console i/o
(
echoandread) [v1.4] - primitive types
(
int,float,char-> dynamic types) - variable declaration
(support scope : all variables are global by default ?, unless
localis used) [v1.3] - function declaration
(no keywords, no arguments :
funname() { ... }) [v1.6, nolocal] - first order keywords
(
ifthenfordodoneinwhileuntilcaseesacechoreadreturnexitlocalelifelsefideclaretestexpr) [v1.5 for some of them] - comments
(with
/**/from/*until*/) [v1.2] - optimization level 1.0 (evaluate constant expression at compile time)
- optimization level 1.1 (do not evaluate anything related to unused objects)
- optimization level 1.2 (group first order lazy instructions : eval + test -> test)
- support multiple files (multi-core compiling)