Hi Eric,
> Hope you had fun.
Yes thanks! I was very happy to see my friends in Germany :-)
> I just got back from a trip running some of my catapults all day for
> people I work with. It was a good time. We were throwing 2 liter
> bottles 160ft with our human powered machine. Wee!
Nice!
[...]
> > So, I just added a (require 'semantic-bovine) in such files to fix
> > errors.
[...]
> That makes sense. I hadn't bumped into that problem yet.
I finally reverted back these changes (see below).
[...]
> > - I wonder if it is really necessary to add new syntax in BNF or
> > WY files to define the lexer. I found the various macros
> > provided in semantic-lex convenient enough to easily create a
> > new lexer that can be self contained in one ELisp file. I can't
> > see any advantage of duplicating this code in a BNF or WY file,
> > in a different form.
>
> I'm not sure either. I haven't been able to divine what a good new
> syntax would be. If the syntax table (which the lexer depends on)
> also were to be defined, that could certainly benefit from a less
> obscure mechanism than the existing syntax table code in Emacs.
Probably. But as you I haven't been able to find a good new syntax
that don't simply duplicate the Elisp code!
> > - I noticed that you moved the functions
> > `semantic-bovinate-from-nonterminal' and
> > `semantic-bovinate-from-nonterminal-full' in the new
> > semantic-bovine file.
[...]
> That makes sense to do. If you see more functions like that, feel
> free to move them about. I don't think they are a part of partial
> reparsing only, which is what semantic-edit was pulled out for.
[...]
I finally moved back these runtime functions into semantic.el. IMO
this is the best place where to put them for now. Consequently there
is no more need to (require 'semantic-bovine) in files that use them
:)
> > - IMO the variable `semantic-lex-analyzer' should be
> > `make-variable-buffer-local'. I got strange bug when writing
> > the new Java lexer because I forgot to make it buffer local!
>
> I noticed that too but had not yet checked it in.
Done (see change log at end).
> > I think I improved the compatibility between the old and new
> > lexers. Now `semantic-lex-analyzer' is buffer local and its
> > default value is `semantic-flex' for compatibility with Semantic
> > 1.x API. I also replaced all direct calls to `semantic-flex' by
> > calls to `semantic-lex'.
>
> That's a good idea. I'd like to remove semantic-flex someday, and
> this is a good transition strategy. My preference would be to have
> it at the end of semantic-lex.el though to steer focus away from it.
[...]
Done (see change log at end).
> > In the Wisent part, I improved the code in wisent-java-lex.el. It
> > now contains a new lexer for wisent-java.el ;-) plus some new test
> > code. I made some minor change to wisent-java-tags.el and
> > wisent-java.el so they now work with the new lexers.
>
> That's great. You had mentioned earlier about converting the LL
> parser to use similar input as the LALR parser. I am not yet sure
> what that means, but perhaps it can be converged after these bigger
> changes stabilize.
For now I added a new very simple function `wisent-lex' in
wisent-flex.el, that simply converts lexical tokens produced by
`semantic-lex' into ones suitable for wisent.
[...]
> You occasionally generate performance numbers. Would it make sense
> to capture some of the code that creates them in the `test'
> directory. We could periodically run them and capture the results in
> a log to see how we're doing.
Good idea! I will do that as soon as possible.
[...]
> This is some great stuff and worth checking in. I too have some
> changes pending which would do well to go in after yours.
[...]
OK, I checked my changes in (see change log at end).
Sincerely,
David
------------------- Change Log --------------------------------------
* semantic.el:
(semantic-version): Updated to 2.0alpha2
(require 'semantic-lex): Added.
(semantic-flex-start, semantic-flex-end, semantic-flex-text)
(semantic-flex-keywords-obarray, semantic-flex-make-keyword-table)
(semantic-flex-keyword-p, semantic-flex-keyword-put)
(semantic-flex-keyword-get, semantic-flex-map-keywords)
(semantic-flex-keywords, semantic-flex-tokens)
(semantic-flex-unterminated-syntax-end-function)
(semantic-flex-extensions, semantic-flex-syntax-modifications)
(semantic-ignore-comments, semantic-flex-enable-newlines)
(semantic-flex-enable-whitespace, semantic-flex-enable-bol)
(semantic-number-expression, semantic-flex-depth, semantic-flex)
(semantic-flex-buffer, semantic-flex-list): Moved to semantic-lex.el.
(semantic-token-docstring, semantic-bovinate-toplevel): Call
`semantic-lex' instead of `semantic-flex'.
(semantic-lambda, semantic-bovinate-from-nonterminal)
(semantic-bovinate-from-nonterminal-full)
(semantic-bovinate-region-until-error): Moved back here from
semantic-bovine.el. Use `semantic-lex' instead of `semantic-flex'.
* semantic-bovine.el:
(semantic-lambda, semantic-bovinate-from-nonterminal)
(semantic-bovinate-from-nonterminal-full)
(semantic-bovinate-region-until-error): Moved these runtime
functions into semantic.el.
* semantic-edit.el:
(semantic-rebovinate-token): Call `semantic-lex' instead of
`semantic-flex'.
* semantic-util.el:
(semantic-find-doc-snarf-comment): Call `semantic-lex' instead of
`semantic-flex'.
* semantic-lex.el:
(with-syntax-table): Moved.
(semantic-lex-make-keyword-table, semantic-lex-keyword-p)
(semantic-lex-keyword-put, semantic-lex-keyword-get)
(semantic-lex-map-keywords, semantic-lex-keywords): New functions.
(semantic-lex-analyzer): Default to `semantic-flex'. buffer-local
when set in any fashion.
(semantic-lex-depth): Fixed `make-variable-buffer-local'.
(define-lex): Use value of `semantic-lex-depth' as the default depth
if it is not specified.
(semantic-lex-token-class, semantic-lex-token-start)
(semantic-lex-token-end, semantic-lex-token-text): New functions.
(semantic-lex-symbol-or-keyword): Use `semantic-lex-keyword-p'
instead of `semantic-flex-keyword-p'.
Compatibility with Semantic 1.x API.
(semantic-flex-start, semantic-flex-end, semantic-flex-text)
(semantic-flex-make-keyword-table, semantic-flex-keyword-p)
(semantic-flex-keyword-put, semantic-flex-keyword-get)
(semantic-flex-map-keywords, semantic-flex-keywords): Aliased to
their counterparts in 2.x API.
(semantic-flex-keywords-obarray, semantic-flex-tokens)
(semantic-flex-unterminated-syntax-end-function)
(semantic-flex-extensions, semantic-flex-syntax-modifications)
(semantic-ignore-comments, semantic-flex-enable-newlines)
(semantic-flex-enable-whitespace, semantic-flex-enable-bol)
(semantic-number-expression, semantic-flex-depth, semantic-flex)
(semantic-flex-buffer, semantic-flex-list): Moved from semantic.el.
(semantic-flex-tokens): Default to value of `semantic-lex-tokens'.
(semantic-number-expression): Default to value of
`semantic-lex-number-expression'.
* wisent-flex:
(wisent-lex): New function.
|