You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ Text file describing the tokens the Lexer uses and the rules the Parser follows.
58
58
This file contains some example code that counts the number of primes from 1-1000.
59
59
The Java code equivalent is also present in that file, in case the bytecode is confusing.
60
60
61
-
**Bad code:***VMInstruction.java*. Personally I dislike how coupled this enum is to the different `Instruction` classes and the `ReflectionSupplier` class.
61
+
**What I would change:***VMInstruction.java*. Personally I dislike how coupled this enum is to the different `Instruction` classes and the `ReflectionSupplier` class.
62
62
During development I thought about some different ideas and one of them was annotation pre-processing which would look something like this:
63
63
```java
64
64
@LinkVMInstruction("MyInstruction")
@@ -68,4 +68,4 @@ class MyInstruction extends Instruction {
68
68
```
69
69
The annotation pre-processor would then find all `Instruction`s with the @VMInstruction annotation and generate the `VMInstruction` enum file from
70
70
scratch. Magic! I ended up going with the simple coupling solution anyways since I did not want to spend time implementing this for a minor coupling problem.
71
-
I will definitely re-visit the magic of annotation pre-processors, though!
71
+
I will definitely re-visit the magic of annotation pre-processors, though!
0 commit comments