Re: [cedet-semantic] Java Generics
Brought to you by:
zappo
From: David P. <da...@or...> - 2009-07-07 16:12:13
|
Hi Eric, > The Semantic grammar is based on a Java 1.5 grammar, as specified in > some of the comments. It also says that production of template > specifiers is on the TODO list. > > I don't know much more beyond what is in those comments. If someone > would like to augment this grammar if needed, patches are welcome. I tried the example from Alexander and it seems to work. M-x bovinate gave me : (("T" type (:typemodifiers ("public") :interfaces ("Iterable<T.e>") :members (("T" function (:constructor-flag t :typemodifiers ("public")) (reparse-symbol constructor_declaration) #<overlay from 47 to 62 in TS.java>) ("a" function (:typemodifiers ("public") :type "void") (reparse-symbol method_declaration) #<overlay from 68 to 85 in TS.java>) ("b" function (:typemodifiers ("public") :type "void") (reparse-symbol method_declaration) #<overlay from 91 to 108 in TS.java>)) :type "class") (reparse-symbol class_declaration) #<overlay from 1 to 110 in TS.java>)) The grammar fully parses java 1.5 syntax, but you need to enable the "full parser" instead of the light iterative parser which is enabled by default. I do that in my .emacs, before to load cedet stuff, like that : ;; Use the full Java 1.5 grammar to parse Java files (autoload 'wisent-java-default-setup "wisent-java" "Hook run to setup Semantic in `java-mode'." nil nil) Finally, you're right, the grammar doesn't produce TAG structures for template specifiers, and just returns type names like "Iterable<T.e>". When I wrote the grammar, if I remember well, the output structure for template specifiers was missing in the semantic TAG specification. And, if it is still the case, most of the work to be done is probably to specify that generic tag structure for template specifiers in various languages. It then will be trivial to update the grammar. Best regards David |