Re: Question about adding new wisent grammar pieces
Eric Ludlam <[email protected]> Wed, 25 Jan 2017 21:13:47 -0500
| Newsgroups | gmane.emacs.semantic |
|---|---|
| Message-ID | <[email protected]> |
On 01/22/2017 11:06 PM, Lee Hinman wrote:
>
> Hi Cedet-semantic,
>
> I'm trying to add support to the Java LALR parser for
> try-with-resources; so far, I have a trivial patch that looks like:
>
> #+BEGIN_SRC diff
> diff --git a/lisp/cedet/semantic/wisent/java.wy b/lisp/cedet/semantic/wisent/java.wy
> index 3abedd5..547c986 100644
> --- a/lisp/cedet/semantic/wisent/java.wy
> +++ b/lisp/cedet/semantic/wisent/java.wy
> @@ -1458,8 +1458,8 @@ synchronized_statement
> ;
>
> try_statement
> - : TRY block catches
> - | TRY block catches_opt finally
> + : TRY resources_opt block catches
> + | TRY resources_opt block catches_opt finally
> ;
>
> catches_opt
> @@ -1476,6 +1476,19 @@ catch_clause
> : CATCH LPAREN formal_parameter RPAREN block
> ;
>
> +resources_opt
> + : ;; EMPTY
> + | LPAREN resources [SEMICOLON] RPAREN
> + ;
Hi,
The parser (for the .wy file) failed on the [ ] in the above line. You
can tell if you enable tag decoration mode because the overline was missing.
I'm not sure what you are trying to do with [] or {} as I'm not that
familiar with this part of Java. Do you mean to use LBRACE or LBRACK
instead? See definitions at beginning of java.wy.
Eric
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot