/jvm-sb

Primary LanguageC++MIT LicenseMIT

JVM-SB

A Java Virtual Machine for Basic Software's course.

This program checks the following in a .class file:

  • Constant pools
  • Fields
  • Methods
  • Attributes

Reader and Exhibitor

Compile and check with javac/javap

Convert .java to .class file:

$ javac HelloWorld.java

To check .class files uses:

$ javap HelloWorld.class

Test files

This system covers .java files that contains:

Future additions:

Run

To execute this software follow these commands:

$ make

It will first clean all binaries, than check static code, compile all necessary files, check coverage and finally execute the software that reads and prints informations about a .class file.

To generate documentation:

$ doxygen Doxyfile

After the command above, open the file index.html with a browser.

Setup

Doxygen

$ sudo apt-get install doxygen graphviz

Javac/Javap

Install on Linux (package-manager)

$ sudo apt-get install openjdk-9-jdk-headless

Cppcheck

We use Cppcheck 1.83 as static analyser for our code.

Install on Linux (package-manager)

$ sudo apt-get install cppcheck

Test cppcheck

  1. Check up result:
$ which cppcheck
$ /usr/bin/cppcheck
  1. Testing it.
$ touch simple.c
$ echo "int main(){ int a; a + 1; return 0}" > simple.c
$ cppcheck simple.c
Checking simple.c ...
[simple.c:1]: (error) Uninitialized variable: a