Skip to content

Commit

Permalink
Perlito5 - misc/Java-Asm-Interpreter/MethodExecutorAsm TODO update
Browse files Browse the repository at this point in the history
  • Loading branch information
fglock committed Aug 1, 2024
1 parent c57be46 commit 102bb8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
1 change: 0 additions & 1 deletion misc/Java-Asm-Interpreter/MethodExecutorAsm/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public static void main(String[] args) {
+ "print \"Finished; value is $a\\n\"; "
+ "return 5;";


// Parse command-line arguments
for (int i = 0; i < args.length; i++) {
if (args[i].equals("-e") && i + 1 < args.length) {
Expand Down
23 changes: 11 additions & 12 deletions misc/Java-Asm-Interpreter/MethodExecutorAsm/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@
## Cleanup
- Cleanup the closure code to only add the lexical variables mentioned in the AST

## Format Error Messages and Warnings
- Compile time: get file position from lexer
- Run-time: add annotations to the bytecode
## Runtime Format Error Messages and Warnings
- add annotations to the bytecode (Line Numbers)
```java
Label thisLabel = new Label();
ctx.mv.visitLabel(thisLabel);
ctx.mv.visitLineNumber(10, thisLabel); // Associate line number 10 with thisLabel
```

- catch and reformat errors like division by zero

## Test Different Perl Data Types
- Array, hash, string, double, references
Expand All @@ -41,16 +47,9 @@
- Perl classes

## Local Variables
- Set up the cleanup before `RETURN`
- Set up restoring the `local` value before `RETURN`
- Set up exception handling

## Add Debug Information (Line Numbers)
```java
Label thisLabel = new Label();
ctx.mv.visitLabel(thisLabel);
ctx.mv.visitLineNumber(10, thisLabel); // Associate line number 10 with thisLabel
```

## Tests

## Implement Thread-Safety
Expand All @@ -67,7 +66,7 @@ ctx.mv.visitLineNumber(10, thisLabel); // Associate line number 10 with thisLabe

## `BEGIN` Block

## Read Code from STDIN
## Main.java Read Code from STDIN
```java
// Read input from STDIN
Scanner scanner = new Scanner(System.in);
Expand Down

0 comments on commit 102bb8b

Please sign in to comment.