Hi,
you have done a great job of improvement for the
C++-parsing in semantic 1.4.4.
However, I still have some proposals:
- 'short int' is not recognized, althought
'long int' has been added now, I think this
should be added too.
- nested classes or structs defined outside
of the containing class/struct are not parsed,
as e.g. in:
class container
{
public:
struct contained;
container();
~container();
}
struct container::contained
{
public:
contained();
~contained();
}
This is valid C++ syntax, but the definition
of container::contained will not be parsed
and therefore not shown int the ECB method
window.
For myself, I changed the 'typesimple'-rule
in c.bnf like so:
# Jens Rock: added an opt-class befor the type names, and a parent
# property to the respective extra-spec
typesimple : struct-or-class opt-class opt-name opt-template-specifier
opt-class-parents semantic-list
( ,$3 type ,$1
(let ((semantic-c-classname (cons (car ,$3) (car ,$1))))
(EXPANDFULL $6 classsubparts))
$5
(ASSOC 'template-specifier $4 'parent (car ,$2))
nil )
| struct-or-class opt-class opt-name opt-template-specifier
opt-class-parents
( ,$3 type ,$1 nil $5
(ASSOC 'template-specifier $4 'parent (car ,$2))
nil )
| UNION opt-class opt-name unionparts
( ,$3 type $1 $4 nil (ASSOC 'parent (car ,$2)) nil )
| ENUM opt-class opt-name enumparts
( ,$3 type $1 $4 nil (ASSOC 'parent (car ,$2)) nil )
# Klaus Berndl <klaus.berndl@...>: a typedef can be a typeformbase
# with all this declmods stuff.
| TYPEDEF declmods typeformbase cv-declmods typedef-symbol-list
## We put the type this typedef renames into PARENT
## but will move it in the expand function.
( $5 type $1 nil $3 nil nil )
;
This seems to work for me and I can navigate better now.
- the difference between type declarations and definitions
is not mirrored in c.bnf. I'd propose to handle types
in this regard just like functions and to add a (prototype . t)
to the extra-spec of the declaration. This could enable
tools looking for the definition of a given symbol as opposed
to a mere declaration. (If anyone wishes something like this).
Kind Regards
Jens Rock
|