[Java FFI][Bug 18846] Implement a parser for the Java FFI DSL#4548
[Java FFI][Bug 18846] Implement a parser for the Java FFI DSL#4548livecodeali merged 27 commits intolivecode:developfrom
Conversation
ad29e99 to
8750569
Compare
51649ba to
a58622c
Compare
This parser is written in gentle and is largely based on lc-compile. The main difference is the fact that names are qualified, and accordingly '.' is not allowed in name literals.
Add a --check option to the java-dsl-parse program which combines the input files into one and outputs to the specified file. This is used to check the idempotence of the parsing step.
Add a java dsl parser test runner (base on the lc-compile one) and add tests.
Add an --output option to the java-dsl-parse program which outputs LCB glue code to the specified location. The glue code enables the methods, constructors, variables and constants of the java class described in the target DSL files to be accessed from LCB.
Call the to-be-implemented java.lcb module code when generating constructor glue.
We don't yet support variadic args in LCB, so use a list for the time being. Calling such functions through the JNI will not work until the relevant support is added to the java.lcb libscript module.
Fix an issue whereby parameters qualified names could not be retrieved.
Add a check to ensure generic type parameters match properly.
a58622c to
e7e5ad1
Compare
e7e5ad1 to
a2b5f3f
Compare
…arser [Java FFI][Bug 18846] Implement a parser for the Java FFI DSL Replaces #4438
d0cb8ae to
50cf68e
Compare
We need to be able to use the general type bridging system to call constructors with parameters easily, so this patch adds glue code for constructors which adds a foreign binding string of the form "java:qualified.class.name>new(paramString)" Correspondingly, glue code is generated to call constructors with the appropriate types and return the constructed java object.
This patch adds a special case to generate glue code for converting java byte arrays to Data and back. This means that it is not necessary to hard-code the conversion in libfoundation, so that in future better glue code could be generated to elide conversion when java byteArrays are passed around.
50cf68e to
cd5c9b0
Compare
- Ensure static methods and fields are marked as such in the binding string using !static - Generate getters for variables and constants, and setters for non-final variables
cbdec86 to
b6cc60e
Compare
| @@ -0,0 +1,2 @@ | |||
| \ { AdvanceCurrentPosition(1); } | |||
| \t { } No newline at end of file | |||
There was a problem hiding this comment.
You need to AdvanceCurrentPosition(1); for tab characters, or column numbers will be reported incorrectly when errors occur on lines indented with tabs.
| @@ -0,0 +1,6 @@ | |||
| [0-9]+"."[0-9]+([eE][-+]?[0-9]+)? { | |||
There was a problem hiding this comment.
It looks like 1e1 is not parsed as a numeric literal, although it is a numeric literal in LCB. This isn't necessarily a problem, but it's probably something to be aware of.
peter-b
left a comment
There was a problem hiding this comment.
Oops, I found one minor issue that I didn't flag up properly earlier.
| @@ -0,0 +1,2 @@ | |||
| \ { AdvanceCurrentPosition(1); } | |||
| \t { } No newline at end of file | |||
There was a problem hiding this comment.
You need to AdvanceCurrentPosition for tab characters, or the incorrect column number will be reported in error and warning messages.
|
@livecode-vulcan review ok 5e452a7 |
…arser [Java FFI][Bug 18846] Implement a parser for the Java FFI DSL Replaces #4438
|
@livecode-vulcan review ok 33f63c2 |
…arser [Java FFI][Bug 18846] Implement a parser for the Java FFI DSL Replaces #4438
Replaces #4438