mjtest merge requestshttps://git.scc.kit.edu/IPDSnelting/mjtest/-/merge_requests2021-11-15T10:36:25+01:00https://git.scc.kit.edu/IPDSnelting/mjtest/-/merge_requests/5Add a preprocessor for array literals and basic generics2021-11-15T10:36:25+01:00johannes.bechbergerjohannes.bechberger@kit.eduAdd a preprocessor for array literals and basic genericsBack in the days when I developed mjtest I also wrote some other,
more sophisticated, preprocessors. This pull request contains
one of them. Examples can be found under `extpreproc/examples`.
Why?
----
It allows to write array creation...Back in the days when I developed mjtest I also wrote some other,
more sophisticated, preprocessors. This pull request contains
one of them. Examples can be found under `extpreproc/examples`.
Why?
----
It allows to write array creation literals like `new int[]{1, 2, 3}`
and using simple generics.
It eases the development in MiniJava and gives lot's of possibilities
to extend the MiniJava language without changing the compilers.
Why another preprocessor?
-------------------------
This one only operates on single files and utilizes the powerful javaparser.
Thereby allowing to create more sophisticated preprocessing stages that
just can't be done without parsing the MiniJava code properly.
Usage
-----
```
run INPUT_FILE OUTPUT_FILE
```
Be sure to run `build` once in a time.
Generics
--------
It replaces generic types instantiations like `B<Integer>` with a new class
with a mangled name and a occurrences of the type argument replaced with
`int` (as `Integer` and `Boolean` are converted to their unboxed versions).
The behave (in their simplicity) mostly like class templates in C++.
What doesn't work:
- Any kind of type inference
- Using uninstantiated generic types
- Using `int` as a type argument and having a class named `Integer`
- The same for `boolean` and `Boolean`https://git.scc.kit.edu/IPDSnelting/mjtest/-/merge_requests/4Multimodal test runs2021-11-04T15:42:25+01:00uxrogMultimodal test runsWhile the `mjt.py` CLI allowed users to run `all` tests, there was no option to run only a specific subset of tests.
These changes add the possibility to specify multiple test modes to be run, for example:
```
./mjt.py lexer syntax
```While the `mjt.py` CLI allowed users to run `all` tests, there was no option to run only a specific subset of tests.
These changes add the possibility to specify multiple test modes to be run, for example:
```
./mjt.py lexer syntax
```johannes.bechbergerjohannes.bechberger@kit.edujohannes.bechbergerjohannes.bechberger@kit.edu