Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

[Java FFI][Bug 18846] Implement a parser for the Java FFI DSL#4548

Merged
livecodeali merged 27 commits intolivecode:developfrom
livecodeali:feature-java_ffi_dsl_parser
Feb 27, 2017
Merged

[Java FFI][Bug 18846] Implement a parser for the Java FFI DSL#4548
livecodeali merged 27 commits intolivecode:developfrom
livecodeali:feature-java_ffi_dsl_parser

Conversation

@livecodeali
Copy link
Copy Markdown
Member

Replaces #4438

@livecodeali livecodeali added this to the 9.0.0-dp-1 milestone Sep 22, 2016
@livecodeali livecodeali force-pushed the feature-java_ffi_dsl_parser branch 2 times, most recently from ad29e99 to 8750569 Compare September 30, 2016 11:11
@peter-b peter-b modified the milestones: 9.0.0-dp-1, 9.0.0-dp-2 Sep 30, 2016
@livecodeali livecodeali force-pushed the feature-java_ffi_dsl_parser branch from 51649ba to a58622c Compare October 6, 2016 14:34
@livecodeali livecodeali changed the title Feature java ffi dsl parser [[ Java FFI DSL ]] Implement a parser for the Java FFI DSL Oct 6, 2016
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.
@livecodeali livecodeali force-pushed the feature-java_ffi_dsl_parser branch from a58622c to e7e5ad1 Compare October 6, 2016 14:52
@livecodeali livecodeali force-pushed the feature-java_ffi_dsl_parser branch from e7e5ad1 to a2b5f3f Compare October 9, 2016 20:22
@peter-b peter-b changed the title [[ Java FFI DSL ]] Implement a parser for the Java FFI DSL [Java FFI][Bug 18846] Implement a parser for the Java FFI DSL Nov 14, 2016
@peter-b peter-b removed this from the 9.0.0-dp-2 milestone Nov 21, 2016
livecode-vulcan added a commit that referenced this pull request Feb 23, 2017
…arser

[Java FFI][Bug 18846] Implement a parser for the Java FFI DSL

Replaces #4438
@livecode-vulcan
Copy link
Copy Markdown
Contributor

😞 test failure 4468582

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.
@livecodeali livecodeali force-pushed the feature-java_ffi_dsl_parser branch from 50cf68e to cd5c9b0 Compare February 24, 2017 18:08
- 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
@livecodeali livecodeali force-pushed the feature-java_ffi_dsl_parser branch from cbdec86 to b6cc60e Compare February 27, 2017 08:13
@@ -0,0 +1,2 @@
\ { AdvanceCurrentPosition(1); }
\t { } No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]+)? {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@peter-b peter-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to AdvanceCurrentPosition for tab characters, or the incorrect column number will be reported in error and warning messages.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch :-)

@peter-b
Copy link
Copy Markdown
Contributor

peter-b commented Feb 27, 2017

@livecode-vulcan review ok 5e452a7

@livecode-vulcan
Copy link
Copy Markdown
Contributor

💙 review by @peter-b ok 5e452a7

livecode-vulcan added a commit that referenced this pull request Feb 27, 2017
…arser

[Java FFI][Bug 18846] Implement a parser for the Java FFI DSL

Replaces #4438
@livecode-vulcan
Copy link
Copy Markdown
Contributor

😞 test failure 5e452a7

@peter-b
Copy link
Copy Markdown
Contributor

peter-b commented Feb 27, 2017

@livecode-vulcan review ok 33f63c2

@livecode-vulcan
Copy link
Copy Markdown
Contributor

💙 review by @peter-b ok 33f63c2

livecode-vulcan added a commit that referenced this pull request Feb 27, 2017
…arser

[Java FFI][Bug 18846] Implement a parser for the Java FFI DSL

Replaces #4438
@livecode-vulcan
Copy link
Copy Markdown
Contributor

😎 test success 33f63c2

@livecodeali livecodeali merged commit 9b9146b into livecode:develop Feb 27, 2017
@livecodeali livecodeali deleted the feature-java_ffi_dsl_parser branch February 27, 2017 12:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants