mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-06 16:52:40 +02:00
+ support sealed/abstract Java classes (todo: allow abstract Java classes
to only partially implement an interface, and check in first non-abstract class in inheritance tree whether it implements all interface methods) git-svn-id: branches/jvmbackend@18393 -
This commit is contained in:
parent
2d5a542984
commit
3d4323a75d
@ -421,10 +421,14 @@ implementation
|
|||||||
|
|
||||||
|
|
||||||
procedure parse_object_options;
|
procedure parse_object_options;
|
||||||
|
var
|
||||||
|
gotexternal: boolean;
|
||||||
begin
|
begin
|
||||||
case current_objectdef.objecttype of
|
case current_objectdef.objecttype of
|
||||||
odt_object,odt_class:
|
odt_object,odt_class,
|
||||||
|
odt_javaclass:
|
||||||
begin
|
begin
|
||||||
|
gotexternal:=false;
|
||||||
while true do
|
while true do
|
||||||
begin
|
begin
|
||||||
if try_to_consume(_ABSTRACT) then
|
if try_to_consume(_ABSTRACT) then
|
||||||
@ -432,14 +436,24 @@ implementation
|
|||||||
else
|
else
|
||||||
if try_to_consume(_SEALED) then
|
if try_to_consume(_SEALED) then
|
||||||
include(current_structdef.objectoptions,oo_is_sealed)
|
include(current_structdef.objectoptions,oo_is_sealed)
|
||||||
|
else if (current_objectdef.objecttype=odt_javaclass) and
|
||||||
|
(token=_ID) and
|
||||||
|
(idtoken=_EXTERNAL) then
|
||||||
|
begin
|
||||||
|
get_cpp_or_java_class_external_status(current_objectdef);
|
||||||
|
gotexternal:=true;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
if [oo_is_abstract, oo_is_sealed] * current_structdef.objectoptions = [oo_is_abstract, oo_is_sealed] then
|
if [oo_is_abstract, oo_is_sealed] <= current_structdef.objectoptions then
|
||||||
Message(parser_e_abstract_and_sealed_conflict);
|
Message(parser_e_abstract_and_sealed_conflict);
|
||||||
|
{ set default external name in case of no external directive }
|
||||||
|
if (current_objectdef.objecttype=odt_javaclass) and
|
||||||
|
not gotexternal then
|
||||||
|
get_cpp_or_java_class_external_status(current_objectdef)
|
||||||
end;
|
end;
|
||||||
odt_cppclass,
|
odt_cppclass,
|
||||||
odt_javaclass,
|
|
||||||
odt_interfacejava:
|
odt_interfacejava:
|
||||||
get_cpp_or_java_class_external_status(current_objectdef);
|
get_cpp_or_java_class_external_status(current_objectdef);
|
||||||
odt_objcclass,odt_objcprotocol,odt_objccategory:
|
odt_objcclass,odt_objcprotocol,odt_objccategory:
|
||||||
|
Loading…
Reference in New Issue
Block a user