+ parsing of dispinterface properties

git-svn-id: trunk@3383 -
This commit is contained in:
florian 2006-04-30 14:29:16 +00:00
parent 7b0821c08a
commit c81f34aeee
4 changed files with 116 additions and 90 deletions

View File

@ -88,7 +88,7 @@ implementation
p : tpropertysym; p : tpropertysym;
begin begin
{ check for a class } { check for a class }
if not((is_class_or_interface(aktobjectdef)) or if not((is_class_or_interface_or_dispinterface(aktobjectdef)) or
(not(m_tp7 in aktmodeswitches) and (is_object(aktobjectdef)))) then (not(m_tp7 in aktmodeswitches) and (is_object(aktobjectdef)))) then
Message(parser_e_syntax_error); Message(parser_e_syntax_error);
consume(_PROPERTY); consume(_PROPERTY);

View File

@ -352,7 +352,7 @@ implementation
begin begin
{ do an property override } { do an property override }
overriden:=search_class_member(aclass.childof,p.name); overriden:=search_class_member(aclass.childof,p.name);
if assigned(overriden) and (overriden.typ=propertysym) then if assigned(overriden) and (overriden.typ=propertysym) and not(is_dispinterface(aclass)) then
begin begin
p.dooverride(tpropertysym(overriden)); p.dooverride(tpropertysym(overriden));
end end
@ -362,10 +362,12 @@ implementation
message(parser_e_no_property_found_to_override); message(parser_e_no_property_found_to_override);
end; end;
end; end;
if (sp_published in current_object_option) and if ((sp_published in current_object_option) or is_dispinterface(aclass)) and
not(p.proptype.def.is_publishable) then not(p.proptype.def.is_publishable) then
Message(parser_e_cant_publish_that_property); Message(parser_e_cant_publish_that_property);
if not(is_dispinterface(aclass)) then
begin
if try_to_consume(_READ) then if try_to_consume(_READ) then
begin begin
p.readaccess.clear; p.readaccess.clear;
@ -453,7 +455,27 @@ implementation
end; end;
end; end;
end; end;
if assigned(aclass) then end
else
begin
if try_to_consume(_READONLY) then
begin
end
else if try_to_consume(_WRITEONLY) then
begin
end;
if try_to_consume(_DISPID) then
begin
pt:=comp_expr(true);
if is_constintnode(pt) then
// tprocdef(pd).extnumber:=tordconstnode(pt).value
else
Message(parser_e_dispid_must_be_ord_const);
pt.free;
end;
end;
if assigned(aclass) and not(is_dispinterface(aclass)) then
begin begin
include(p.propoptions,ppo_stored); include(p.propoptions,ppo_stored);
if try_to_consume(_STORED) then if try_to_consume(_STORED) then

View File

@ -5473,7 +5473,7 @@ implementation
result:= result:=
assigned(def) and assigned(def) and
(def.deftype=objectdef) and (def.deftype=objectdef) and
(tobjectdef(def).objecttype in [odt_dispinterface]); (tobjectdef(def).objecttype=odt_dispinterface);
end; end;

View File

@ -207,6 +207,7 @@ type
_OVERRIDE, _OVERRIDE,
_PLATFORM, _PLATFORM,
_PROPERTY, _PROPERTY,
_READONLY,
_REGISTER, _REGISTER,
_REQUIRES, _REQUIRES,
_RESIDENT, _RESIDENT,
@ -223,6 +224,7 @@ type
_PUBLISHED, _PUBLISHED,
_SOFTFLOAT, _SOFTFLOAT,
_THREADVAR, _THREADVAR,
_WRITEONLY,
_DEPRECATED, _DEPRECATED,
_DESTRUCTOR, _DESTRUCTOR,
_IMPLEMENTS, _IMPLEMENTS,
@ -452,6 +454,7 @@ const
(str:'OVERRIDE' ;special:false;keyword:m_none;op:NOTOKEN), (str:'OVERRIDE' ;special:false;keyword:m_none;op:NOTOKEN),
(str:'PLATFORM' ;special:false;keyword:m_none;op:NOTOKEN), (str:'PLATFORM' ;special:false;keyword:m_none;op:NOTOKEN),
(str:'PROPERTY' ;special:false;keyword:m_property;op:NOTOKEN), (str:'PROPERTY' ;special:false;keyword:m_property;op:NOTOKEN),
(str:'READONLY' ;special:false;keyword:m_none;op:NOTOKEN),
(str:'REGISTER' ;special:false;keyword:m_none;op:NOTOKEN), (str:'REGISTER' ;special:false;keyword:m_none;op:NOTOKEN),
(str:'REQUIRES' ;special:false;keyword:m_none;op:NOTOKEN), (str:'REQUIRES' ;special:false;keyword:m_none;op:NOTOKEN),
(str:'RESIDENT' ;special:false;keyword:m_none;op:NOTOKEN), (str:'RESIDENT' ;special:false;keyword:m_none;op:NOTOKEN),
@ -468,6 +471,7 @@ const
(str:'PUBLISHED' ;special:false;keyword:m_none;op:NOTOKEN), (str:'PUBLISHED' ;special:false;keyword:m_none;op:NOTOKEN),
(str:'SOFTFLOAT' ;special:false;keyword:m_none;op:NOTOKEN), (str:'SOFTFLOAT' ;special:false;keyword:m_none;op:NOTOKEN),
(str:'THREADVAR' ;special:false;keyword:m_all;op:NOTOKEN), (str:'THREADVAR' ;special:false;keyword:m_all;op:NOTOKEN),
(str:'WRITEONLY' ;special:false;keyword:m_none;op:NOTOKEN),
(str:'DEPRECATED' ;special:false;keyword:m_all;op:NOTOKEN), (str:'DEPRECATED' ;special:false;keyword:m_all;op:NOTOKEN),
(str:'DESTRUCTOR' ;special:false;keyword:m_all;op:NOTOKEN), (str:'DESTRUCTOR' ;special:false;keyword:m_all;op:NOTOKEN),
(str:'IMPLEMENTS' ;special:false;keyword:m_none;op:NOTOKEN), (str:'IMPLEMENTS' ;special:false;keyword:m_none;op:NOTOKEN),