Hi Eric,
After a little more work, I think I finally got a relatively stable
version of the new API to plug-in parsers :-)
I use it for some days now and not noticed particular problems!
Attached you will find a tarball of all the updated file in semantic
and wisent. The complete change log follows.
I would like to know your opinion on all that ;-)
For now I have to wait until next 1.4 release to check it in.
Thanks!
David
----- ChangeLog
* semantic.el
(semantic-bovinate-parser): New variable.
(semantic-bovinate-parser-name): New variable.
(semantic-bovinate-nonterminal): Use it.
(semantic-bovinate-nonterminal-default): New function.
(semantic-bovination-working-message): New function.
(semantic-rebovinate-token): Removed unnecessary reference to
'bovine-toplevel nonterminal.
(semantic-bovinate-toplevel): Ditto. Use
`semantic-bovination-working-message'.
(semantic-cooked-token-p): New function.
(semantic-raw-to-cooked-token): Use it.
(semantic-bovinate-nonterminals): Update the 'reparse-symbol property
of cooked tokens.
* semantic-ctxt.el:
(semantic-get-local-variables): Handle working stuff here. Removed
unnecessary call to `semantic-deoverlay-list'.
(semantic-get-local-variables-default): The working stuff is now
handled by the `semantic-get-local-variables' wrapper.
* semantic-java.el:
(semantic-java-get-local-variables): The working stuff is now handled
by the `semantic-get-local-variables' wrapper.
* wisent-bovine.el:
(wisent-token): No more setup the 'reparse-symbol property. Return a
single raw token instead of a list of one token.
(wisent-cooked-token): New function.
(wisent-lexer-wrapper): No more provide working goodies.
(wisent-bovinate-nonterminal): Push back the `wisent-lookahead' token
into the input stream. Thus, it no more depends on external
initialization of `wisent-lexer-lookahead'. Return one nonterminal
token at a time. Ensure that unmatched tokens are collected here, not
in `semantic-bovinate-nonterminals'.
(wisent-bovinate-nonterminals): Removed.
(wisent-bovinate-toplevel): Ditto.
(wisent-bovinate-toplevel): Ditto.
(wisent-bovinate-from-nonterminal-full): Ditto.
(wisent-bovinate-region-until-error): Ditto.
(semantic-bovinate-toplevel): Advice removed.
* wisent-wy.wy:
(code): Setup `semantic-expand-nonterminal'.
(put_names): Return a single token instead of a list of one token.
(put_values): Ditto.
(rhs): New nonterminal.
(rules): Use it.
(action_opt): Removed.
(elements): Removed.
(element): Removed.
* wisent-wy.el:
(wisent-wy-automaton): Re-generated.
(wisent-wy-keywords): Ditto.
(wisent-wy-tokens): Ditto.
(wisent-wy-setup-semantic): Ditto.
(wisent-wy-EXPAND): Generate call to
`semantic-bovinate-from-nonterminal' instead of
`wisent-bovinate-from-nonterminal'.
(wisent-wy-EXPANDFULL): Generate call to
`semantic-bovinate-from-nonterminal-full' instead of
`wisent-bovinate-from-nonterminal-full'.
(wisent-wy-setupcode): Generate setup of `semantic-bovinate-parser'
and `semantic-bovinate-parser-name' instead of
`semantic-bovinate-toplevel-override'.
* wisent-java.wy:
(code): Setup `semantic-expand-nonterminal' and
`wisent-skip-token-hook'.
(goal): Produce a 'goal raw token.
(field_declarations_opt): Ditto.
(package_declaration): Use `wisent-cooked-token' to produce a cooked
token.
(import_declaration): Ditto.
(class_declaration): Ditto.
(field_declaration): Ditto.
(method_declaration): Ditto.
(formal_parameter): Ditto.
(constructor_declaration): Ditto.
(interface_declaration): Ditto.
(abstract_method_declaration): Ditto.
* wisent-java.el:
(wisent-java-expand-nonterminal): Moved. No more needed at compile
time. Expand 'goal tokens too.
(wisent-java-parser-tables): Re-generated.
(wisent-java-keywords): Ditto.
(wisent-java-tokens): Ditto.
(wisent-java-default-setup): Ditto.
* wisent-java-tags.wy:
(code): Setup `semantic-expand-nonterminal'.
(formal_parameters): Skip RPAREN.
(field_declaration): No more call `wisent-java-expand-nonterminal'.
It is now handled via the standard `semantic-expand-nonterminal'
mechanism.
* wisent-java-tags.el:
(wisent-java-parser-tables): Re-generated.
(wisent-java-keywords): Ditto.
(wisent-java-default-setup): Ditto.
(wisent-java-get-local-variables): Use
`semantic-bovinate-from-nonterminal-full' instead of
`wisent-bovinate-from-nonterminal-full'. The working stuff is now
handled by the `semantic-get-local-variables' wrapper.
* wisent-awk.el:
(wisent-awk-automaton): Re-generated.
(wisent-awk-keywords): Ditto.
(wisent-awk-tokens): Ditto.
(wisent-awk-setup-parser): Ditto.
* wisent-calc.el:
(wisent-calc-automaton): Re-generated.
(wisent-calc-tokens): Ditto.
(wisent-calc-setup-parser): Ditto.
* wisent-cim.wy:
(outputfile): Fixed bad file name.
* wisent-cim.el:
(wisent-cim-automaton): Re-generated.
(wisent-cim-keywords): Ditto.
(wisent-cim-tokens): Ditto.
(wisent-cim-default-setup): Ditto.
|