Hi David,
This is great. If as you say, the change don't effect existing
grammars, I recommend checking it in. I may not get a chance to play
with it much until the weekend.
>>> David Ponce <david.ponce@...> seems to think that:
[ ... ]
>I attached a sample grammar gr-test.wy that you can use to experiment
>lexical analyzer generation ;-)
I did not find this file, but it may be wise to check it into the
'test' directory so it can be regularly tested along with the other
items in there.
[ ... ]
>Index: semantic/semantic-grammar.el
>===================================================================
>RCS file: /cvsroot/cedet/cedet/semantic/semantic-grammar.el,v
>retrieving revision 1.47
>diff -c -r1.47 semantic-grammar.el
>*** semantic/semantic-grammar.el 9 Jan 2004 21:01:24 -0000 1.47
>--- semantic/semantic-grammar.el 13 Jan 2004 16:25:38 -0000
[ ... ]
>--- 430,468 ----
> (setcdr assoc (cons (cons term value) (cdr assoc)))))
> alist))
>
>! (defun semantic-grammar-types-properties (tokens &optional props)
>! "Return the list of type properties for lexical tokens TOKENS.
>! If optional argument PROPS is non-nil, it is an existing list of
>! properties where to add type properties."
I'm having trouble following some of your more advanced code in here.
In this function, and several others, I am confused by the names
again.
Since % is a valid character for symbols in Emacs Lisp, perhaps
functions and variable that refer to a "token" or "tokens" that
represent output from %token or %type, or %start could use "%token"
to distinguish from what the lexer produces which are also tokens.
This is particularly important since you are referencing special
tokens which are really tags (in our parser speak) that describe
tokens from a lexer.
Unfortunately, that implies renaming vast amounts in this file since
most commands that reference any %keyword type thing would need a new
name to be consistent. :(
[ ... ]
>+ (defun semantic-grammar-token-properties (tokens)
>+ "Return the list of type properties for lexical tokens TOKENS."
This function name is also misleading as I was thinking lexical first.
Then thinking of %token, but it refers to %type statement elements?
Unfortunately I don't really have time for a detailed look today.
If you check it in, I will use it to port my dot grammar to see how
it works. That would be a good excuse to test my new idle completion
tool in a .wy file too. ;)
Thanks!
Eric
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org
|