>>> "David PONCE" <David.Ponce@...> seems to think that:
>Hi Eric,
>
>> Based on this discussion, I checked in some changes to
>> semantic. Specifically, I used `define-override' to create
>> `semantic-bovinate-region' which is loosely based on
>> `semantic-edits-bovinate-region'. It does not take a table, lex
>> stream nor anything else. Just start, end, and a parser symbol. I
>> found that it didn't need a table.
>[...]
>
>I had a look at your last changes that introduce the new overload
>function `semantic-bovinate-region'.
>
>It appears that we have now the following parse functions defined:
>
> - semantic-bovinate-nonterminals
> (stream nonterm &optional depth returnonerror)
>
> - semantic-bovinate-region
> (start end &optional reparse-symbol)
>
> - semantic-bovinate-from-nonterminal-full
> (start end nonterm &optional depth)
>
> - semantic-bovinate-region-until-error
> (start end nonterm &optional depth)
>
>IMO, it is no more necessary to have all the above function defined.
>What I propose:
>
> 1. Remove `semantic-bovinate-from-nonterminal-full' and
This one is a convenience for inside grammar rule actions. Perhaps a
macro would be better?
> `semantic-bovinate-region-until-error'.
Ok.
> 2. Merge `semantic-bovinate-nonterminals' and
> `semantic-bovinate-region'.
This is a rather complex function which handles an iterative step
through the file, cooks tokens, and displays a working message.
Perhaps instead it should be abstracted a little more so that
`stream' could be anything, not just a lexical stream. Regex parsers
could then use it as a buffer position, returning nil when completing
a file.
Leaving as is would allow specialized functions to be simple things
that set up `stream' and other downward flags. I could also use it
for the texinfo regexp parser.
Perhaps a different name would help, such as:
semantic-bovinate-nonterminals-iterativly-from-stream
>So `semantic-bovinate-region' signature would become:
>
> - semantic-bovinate-region
> (start end &optional reparse-symbol depth returnonerror)
>
>In `semantic-bovinate-region-default' we would add the code from
>`semantic-bovinate-nonterminals'.
>
>The BNF and WY generators should be updated to generate calls to
>`semantic-bovinate-region' with required parameters.
>
>An advantage of that is simplification of code and, more important,
>that the bovination mechanism implemented in
>`semantic-bovinate-nonterminals' would be overridable :-)
>
>So we would have a full parser plug-in architecture:
>
> - the parser
> - the incremental parser
> - the "bovinator"
>
>What do you think?
I am not yet convinced because I think the iterative token collector
that is `semantic-bovinate-nonterminals' which is abstract from a
buffer has some difficult logic in it that is not fun to write for
each parser specialization. I do agree with you API arguments,
however.
Override functions can be:
`bovinate-region' -> does set up from buffer. Calls
`bovinate-nonterminals', though a better name might be needed.
`bovinate-nonterminal' -> Core parser
`bovinate-incrementally' -> Analyze changes, and rebuild using
`bovinate-region'.
`lex' -> convert buffer into a `stream'.
A regex parser (like imenu) could override `lex' to return the imenu
cache, and then override `bovinate-nonterminal' to convert one imenu
hit into a semantic token, all without knowing about overlays, nor
cooking.
Eric
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ultranet.com/~zappo Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org
|