A Java Virtual Machine for Basic Software's course.
This program checks the following in a .class
file:
- Constant pools
- Fields
- Methods
- Attributes
Convert .java
to .class
file:
$ javac HelloWorld.java
To check .class
files uses:
$ javap HelloWorld.class
This system covers .java
files that contains:
- String StringDemo.class
- Simulação de impressão PrintDemo.class
- Arrays unidimensionais ArrayUniDemo.class
- Arrays multidimensionais ArrayMultDemo.class
- Herança InheritanceDemo.class and SuperClassInheritanceDemo.class
- Reescrita RewrittenDemo.class, SubClassRewriteDemo.class and SuperClassRewriteDemo.class
- Métodos estáticos MethodStaticDemo.class
- Atributos de classe AttributeClassDemo.class
- Atributos de instância AttributeInstDemo.class
- Polimorfismo PolDemo.class
- Inteiro IntegerDemo.class
- Float FloatDemo.class
- Double DoubleDemo.class
- Métodos dinâmicos MethodDynamicDemo.class
- Long LongDemo.class
- Classe Abstrata AbstractClassDemo.class
Future additions:
- Objetos ObjDemo.class
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.
$ sudo apt-get install doxygen graphviz
$ sudo apt-get install openjdk-9-jdk-headless
We use Cppcheck 1.83 as static analyser for our code.
$ sudo apt-get install cppcheck
- Check up result:
$ which cppcheck
$ /usr/bin/cppcheck
- 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