+ correct semantics of private and protected

* small fix in variable scope:
     a id can be used in a parameter list of a method, even it is used in
     an anchestor class as field id
This commit is contained in:
florian 1998-05-01 09:01:20 +00:00
parent f700edae4d
commit 258d6968af
4 changed files with 158 additions and 119 deletions

View File

@ -118,8 +118,8 @@ parser_e_destructorname_must_be_done,
parser_e_illegal_open_parameter, parser_e_illegal_open_parameter,
parser_e_proc_inline_not_supported, parser_e_proc_inline_not_supported,
parser_w_priv_meth_not_virtual, parser_w_priv_meth_not_virtual,
parser_e_constructor_cannot_be_private, parser_w_constructor_should_be_public,
parser_e_destructor_cannot_be_private, parser_w_destructor_should_be_public,
parser_n_only_one_destructor, parser_n_only_one_destructor,
parser_e_no_local_objects, parser_e_no_local_objects,
parser_e_no_anonym_objects, parser_e_no_anonym_objects,
@ -155,7 +155,8 @@ parser_w_should_use_override,
parser_e_nothing_to_be_overridden, parser_e_nothing_to_be_overridden,
parser_e_no_procedure_to_access_property, parser_e_no_procedure_to_access_property,
parser_e_ill_property_access_sym, parser_e_ill_property_access_sym,
parser_e_cant_write_protected_member, parser_e_cant_access_protected_member,
parser_e_cant_access_private_member,
parser_e_overloaded_are_not_both_virtual, parser_e_overloaded_are_not_both_virtual,
parser_e_overloaded_methodes_not_same_ret, parser_e_overloaded_methodes_not_same_ret,
parser_e_dont_nest_export, parser_e_dont_nest_export,

View File

@ -1,4 +1,4 @@
const msgtxt : array[1..14076] of char=( const msgtxt : array[1..14106] of char=(
'I','_','$','1',' ','k','B',' ','f','r','e','e',#000,'L','_', 'I','_','$','1',' ','k','B',' ','f','r','e','e',#000,'L','_',
'$','1',' ','l','i','n','e','s',' ','$','2',' ','k','B',' ', '$','1',' ','l','i','n','e','s',' ','$','2',' ','k','B',' ',
'f','r','e','e',#000,'I','_','$','1',' ','s','t','r','e','a', 'f','r','e','e',#000,'I','_','$','1',' ','s','t','r','e','a',
@ -120,116 +120,118 @@ const msgtxt : array[1..14076] of char=(
'N','E',' ','n','o','t',' ','s','u','p','p','o','r','t','e', 'N','E',' ','n','o','t',' ','s','u','p','p','o','r','t','e',
'd',#000,'W','_','P','r','i','v','a','t','e',' ','m','e','t', 'd',#000,'W','_','P','r','i','v','a','t','e',' ','m','e','t',
'h','o','d','s',' ','s','h','o','u','l','d','n',#039,'t',' ', 'h','o','d','s',' ','s','h','o','u','l','d','n',#039,'t',' ',
'b','e',' ','V','I','R','T','U','A','L',#000,'E','_','C','o', 'b','e',' ','V','I','R','T','U','A','L',#000,'W','_','C','o',
'n','s','t','r','u','c','t','o','r',' ','c','a','n',#039,'t', 'n','s','t','r','u','c','t','o','r',' ','s','h','o','u','l',
' ','b','e',' ','p','r','i','v','a','t','e',' ','o','r',' ', 'd',' ','b','e',' ','p','u','b','l','i','c',#000,'W','_','D',
'p','r','o','t','e','c','t','e','d',#000,'E','_','D','e','s', 'e','s','t','r','u','c','t','o','r',' ','s','h','o','u','l',
't','r','u','c','t','o','r',' ','c','a','n',#039,'t',' ','b', 'd',' ','b','e',' ','p','u','b','l','i','c',#000,'N','_','C',
'e',' ','p','r','i','v','a','t','e',' ','o','r',' ','p','r', 'l','a','s','s',' ','s','h','o','u','l','d',' ','h','a','v',
'o','t','e','c','t','e','d',#000,'N','_','C','l','a','s','s', 'e',' ','o','n','e',' ','d','e','s','t','r','u','c','t','o',
' ','s','h','o','u','l','d',' ','h','a','v','e',' ','o','n', 'r',' ','o','n','l','y',#000,'E','_','L','o','c','a','l',' ',
'e',' ','d','e','s','t','r','u','c','t','o','r',' ','o','n', 'c','l','a','s','s',' ','d','e','f','i','n','i','t','i','o',
'l','y',#000,'E','_','L','o','c','a','l',' ','c','l','a','s', 'n','s',' ','a','r','e',' ','n','o','t',' ','a','l','l','o',
's',' ','d','e','f','i','n','i','t','i','o','n','s',' ','a', 'w','e','d',#000,'E','_','A','n','o','n','y','m',' ','c','l',
'r','e',' ','n','o','t',' ','a','l','l','o','w','e','d',#000, 'a','s','s',' ','d','e','f','i','n','i','t','i','o','n','s',
'E','_','A','n','o','n','y','m',' ','c','l','a','s','s',' ', ' ','a','r','e',' ','n','o','t',' ','a','l','l','o','w','e',
'd','e','f','i','n','i','t','i','o','n','s',' ','a','r','e', 'd',#000,'E','_','O','r','d','i','n','a','l',' ','v','a','l',
' ','n','o','t',' ','a','l','l','o','w','e','d',#000,'E','_', 'u','e',' ','e','x','p','e','c','t','e','d',#000,'E','_','I',
'O','r','d','i','n','a','l',' ','v','a','l','u','e',' ','e', 'l','l','e','g','a','l',' ','p','a','r','a','m','e','t','e',
'x','p','e','c','t','e','d',#000,'E','_','I','l','l','e','g', 'r',' ','l','i','s','t',#000,'E','_','o','v','e','r','l','o',
'a','l',' ','p','a','r','a','m','e','t','e','r',' ','l','i', 'a','d','e','d',' ','i','d','e','n','t','i','f','i','e','r',
's','t',#000,'E','_','o','v','e','r','l','o','a','d','e','d', ' ','i','s','n',#039,'t',' ','a',' ','f','u','n','c','t','i',
' ','i','d','e','n','t','i','f','i','e','r',' ','i','s','n', 'o','n',' ','i','d','e','n','t','i','f','i','e','r',#000,'E',
#039,'t',' ','a',' ','f','u','n','c','t','i','o','n',' ','i', '_','o','v','e','r','l','o','a','d','e','d',' ','f','u','n',
'd','e','n','t','i','f','i','e','r',#000,'E','_','o','v','e', 'c','t','i','o','n','s',' ','h','a','v','e',' ','t','h','e',
'r','l','o','a','d','e','d',' ','f','u','n','c','t','i','o', ' ','s','a','m','e',' ','p','a','r','a','m','e','t','e','r',
'n','s',' ','h','a','v','e',' ','t','h','e',' ','s','a','m', ' ','l','i','s','t',#000,'E','_','f','u','n','c','t','i','o',
'e',' ','p','a','r','a','m','e','t','e','r',' ','l','i','s', 'n',' ','h','e','a','d','e','r',' ','d','o','e','s','n',#039,
't',#000,'E','_','f','u','n','c','t','i','o','n',' ','h','e', 't',' ','m','a','t','c','h',' ','t','h','e',' ','f','o','r',
'a','d','e','r',' ','d','o','e','s','n',#039,'t',' ','m','a', 'w','a','r','d',' ','d','e','c','l','a','r','a','t','i','o',
't','c','h',' ','t','h','e',' ','f','o','r','w','a','r','d', 'n',' ','$','1',#000,'N','_','o','n','l','y',' ','v','a','l',
' ','d','e','c','l','a','r','a','t','i','o','n',' ','$','1', 'u','e','s',' ','c','a','n',' ','b','e',' ','j','u','m','p',
#000,'N','_','o','n','l','y',' ','v','a','l','u','e','s',' ', 'e','d',' ','o','v','e','r',' ','i','n',' ','e','n','u','m',
'c','a','n',' ','b','e',' ','j','u','m','p','e','d',' ','o', 'e','r','a','t','i','o','n',' ','t','y','p','e','s',#000,'N',
'v','e','r',' ','i','n',' ','e','n','u','m','e','r','a','t', '_','I','n','t','e','r','f','a','c','e',' ','a','n','d',' ',
'i','o','n',' ','t','y','p','e','s',#000,'N','_','I','n','t', 'i','m','p','l','e','m','e','n','t','a','t','i','o','n',' ',
'e','r','f','a','c','e',' ','a','n','d',' ','i','m','p','l', 'n','a','m','e','s',' ','a','r','e',' ','d','i','f','f','e',
'e','m','e','n','t','a','t','i','o','n',' ','n','a','m','e', 'r','e','n','t',' ','!',#000,'E','_','f','u','n','c','t','i',
's',' ','a','r','e',' ','d','i','f','f','e','r','e','n','t', 'o','n',' ','n','e','s','t','i','n','g',' ','>',' ','3','1',
' ','!',#000,'E','_','f','u','n','c','t','i','o','n',' ','n', #000,'E','_','r','a','n','g','e',' ','c','h','e','c','k',' ',
'e','s','t','i','n','g',' ','>',' ','3','1',#000,'E','_','r', 'e','r','r','o','r',' ','w','h','i','l','e',' ','e','v','a',
'a','n','g','e',' ','c','h','e','c','k',' ','e','r','r','o', 'l','u','a','t','i','n','g',' ','c','o','n','s','t','a','n',
'r',' ','w','h','i','l','e',' ','e','v','a','l','u','a','t', 't','s',#000,'E','_','p','o','i','n','t','e','r',' ','t','y',
'i','n','g',' ','c','o','n','s','t','a','n','t','s',#000,'E', 'p','e',' ','e','x','p','e','c','t','e','d',#000,'E','_','c',
'_','p','o','i','n','t','e','r',' ','t','y','p','e',' ','e', 'l','a','s','s',' ','t','y','p','e',' ','e','x','p','e','c',
'x','p','e','c','t','e','d',#000,'E','_','c','l','a','s','s', 't','e','d',#000,'E','_','d','u','p','l','i','c','a','t','e',
' ','t','y','p','e',' ','e','x','p','e','c','t','e','d',#000, ' ','c','a','s','e',' ','l','a','b','e','l',#000,'E','_','t',
'E','_','d','u','p','l','i','c','a','t','e',' ','c','a','s', 'y','p','e','d',' ','c','o','n','s','t','a','n','t','s',' ',
'e',' ','l','a','b','e','l',#000,'E','_','t','y','p','e','d', 'o','f',' ','c','l','a','s','s','e','s',' ','a','r','e',' ',
' ','c','o','n','s','t','a','n','t','s',' ','o','f',' ','c', 'n','o','t',' ','a','l','l','o','w','e','d',#000,'E','_','f',
'l','a','s','s','e','s',' ','a','r','e',' ','n','o','t',' ', 'u','n','c','t','i','o','n','s',' ','v','a','r','i','a','b',
'a','l','l','o','w','e','d',#000,'E','_','f','u','n','c','t', 'l','e','s',' ','o','f',' ','o','v','e','r','l','o','a','d',
'i','o','n','s',' ','v','a','r','i','a','b','l','e','s',' ', 'e','d',' ','f','u','n','c','t','i','o','n','s',' ','a','r',
'o','f',' ','o','v','e','r','l','o','a','d','e','d',' ','f', 'e',' ','n','o','t',' ','a','l','l','o','w','e','d',#000,'E',
'u','n','c','t','i','o','n','s',' ','a','r','e',' ','n','o', '_','s','t','r','i','n','g',' ','l','e','n','g','t','h',' ',
't',' ','a','l','l','o','w','e','d',#000,'E','_','s','t','r', 'm','u','s','t',' ','b','e',' ','a',' ','v','a','l','u','e',
'i','n','g',' ','l','e','n','g','t','h',' ','m','u','s','t', ' ','f','r','o','m',' ','1',' ','t','o',' ','2','5','5',#000,
' ','b','e',' ','a',' ','v','a','l','u','e',' ','f','r','o', 'W','_','u','s','e',' ','e','x','t','e','n','d','e','d',' ',
'm',' ','1',' ','t','o',' ','2','5','5',#000,'W','_','u','s', 's','y','n','t','a','x',' ','o','f',' ','D','I','S','P','O',
'e',' ','e','x','t','e','n','d','e','d',' ','s','y','n','t', 'S','E',' ','a','n','d',' ','N','E','W',' ','t','o',' ','g',
'a','x',' ','o','f',' ','D','I','S','P','O','S','E',' ','a', 'e','n','e','r','a','t','e',' ','i','n','s','t','a','n','c',
'n','d',' ','N','E','W',' ','t','o',' ','g','e','n','e','r', 'e','s',' ','o','f',' ','o','b','j','e','c','t','s',#000,'E',
'a','t','e',' ','i','n','s','t','a','n','c','e','s',' ','o', '_','c','l','a','s','s',' ','i','d','e','n','t','i','f','i',
'f',' ','o','b','j','e','c','t','s',#000,'E','_','c','l','a', 'e','r',' ','e','x','p','e','c','t','e','d',#000,'E','_','m',
's','s',' ','i','d','e','n','t','i','f','i','e','r',' ','e', 'e','t','h','o','d',' ','i','d','e','n','t','i','f','i','e',
'x','p','e','c','t','e','d',#000,'E','_','m','e','t','h','o', 'r',' ','e','x','p','e','c','t','e','d',#000,'E','_','f','u',
'd',' ','i','d','e','n','t','i','f','i','e','r',' ','e','x', 'n','c','t','i','o','n',' ','h','e','a','d','e','r',' ','d',
'p','e','c','t','e','d',#000,'E','_','f','u','n','c','t','i', 'o','e','s','n',#039,'t',' ','m','a','t','c','h',' ','a','n',
'o','n',' ','h','e','a','d','e','r',' ','d','o','e','s','n', 'y',' ','m','e','t','h','o','d',' ','o','f',' ','t','h','i',
#039,'t',' ','m','a','t','c','h',' ','a','n','y',' ','m','e', 's',' ','c','l','a','s','s',#000,'P','_','p','r','o','c','e',
't','h','o','d',' ','o','f',' ','t','h','i','s',' ','c','l', 'd','u','r','e','/','f','u','n','c','t','i','o','n',' ','$',
'a','s','s',#000,'P','_','p','r','o','c','e','d','u','r','e', '1',' ','(','$','2',')',' ','a','t',' ','l','i','n','e',' ',
'/','f','u','n','c','t','i','o','n',' ','$','1',' ','(','$', '$','3',#000,'E','_','I','l','l','e','g','a','l',' ','f','l',
'2',')',' ','a','t',' ','l','i','n','e',' ','$','3',#000,'E', 'o','a','t','i','n','g',' ','p','o','i','n','t',' ','c','o',
'_','I','l','l','e','g','a','l',' ','f','l','o','a','t','i', 'n','s','t','a','n','t',#000,'E','_','F','A','I','L',' ','c',
'n','g',' ','p','o','i','n','t',' ','c','o','n','s','t','a', 'a','n',' ','b','e',' ','u','s','e','d',' ','i','n',' ','c',
'n','t',#000,'E','_','F','A','I','L',' ','c','a','n',' ','b', 'o','n','s','t','r','u','c','t','o','r','s',' ','o','n','l',
'e',' ','u','s','e','d',' ','i','n',' ','c','o','n','s','t', 'y',#000,'E','_','D','e','s','t','r','u','c','t','o','r','s',
'r','u','c','t','o','r','s',' ','o','n','l','y',#000,'E','_', ' ','c','a','n',#039,'t',' ','h','a','v','e',' ','p','a','r',
'D','e','s','t','r','u','c','t','o','r','s',' ','c','a','n', 'a','m','e','t','e','r','s',#000,'E','_','s','t','r','i','n',
#039,'t',' ','h','a','v','e',' ','p','a','r','a','m','e','t', 'g',' ','t','y','p','e','s',' ','d','o','e','s','n',#039,'t',
'e','r','s',#000,'E','_','s','t','r','i','n','g',' ','t','y', ' ','m','a','t','c','h',',',' ','b','e','c','a','u','s','e',
'p','e','s',' ','d','o','e','s','n',#039,'t',' ','m','a','t', ' ','o','f',' ','$','V','+',' ','m','o','d','e',#000,'E','_',
'c','h',',',' ','b','e','c','a','u','s','e',' ','o','f',' ', 'O','n','l','y',' ','c','l','a','s','s',' ','m','e','t','h',
'$','V','+',' ','m','o','d','e',#000,'E','_','O','n','l','y', 'o','d','s',' ','c','a','n',' ','b','e',' ','r','e','f','e',
' ','c','l','a','s','s',' ','m','e','t','h','o','d','s',' ', 'r','r','e','d',' ','w','i','t','h',' ','c','l','a','s','s',
'c','a','n',' ','b','e',' ','r','e','f','e','r','r','e','d', ' ','r','e','f','e','r','e','n','c','e','s',#000,'E','_','O',
' ','w','i','t','h',' ','c','l','a','s','s',' ','r','e','f', 'n','l','y',' ','c','l','a','s','s',' ','m','e','t','h','o',
'e','r','e','n','c','e','s',#000,'E','_','O','n','l','y',' ', 'd','s',' ','c','a','n',' ','b','e',' ','a','c','c','e','s',
'c','l','a','s','s',' ','m','e','t','h','o','d','s',' ','c', 's','e','d',' ','i','n',' ','c','l','a','s','s',' ','m','e',
'a','n',' ','b','e',' ','a','c','c','e','s','s','e','d',' ', 't','h','o','d','s',#000,'E','_','C','o','n','s','t','a','n',
'i','n',' ','c','l','a','s','s',' ','m','e','t','h','o','d', 't',' ','a','n','d',' ','C','A','S','E',' ','t','y','p','e',
's',#000,'E','_','C','o','n','s','t','a','n','t',' ','a','n', 's',' ','d','o',' ','n','o','t',' ','m','a','t','c','h',#000,
'd',' ','C','A','S','E',' ','t','y','p','e','s',' ','d','o', 'E','_','T','h','e',' ','s','y','m','b','o','l',' ','c','a',
' ','n','o','t',' ','m','a','t','c','h',#000,'E','_','T','h', 'n',#039,'t',' ','b','e',' ','e','x','p','o','r','t','e','d',
'e',' ','s','y','m','b','o','l',' ','c','a','n',#039,'t',' ', ' ','f','r','o','m',' ','a',' ','l','i','b','r','a','r','y',
'b','e',' ','e','x','p','o','r','t','e','d',' ','f','r','o', #000,'W','_','A',' ','i','n','h','e','r','i','t','e','d',' ',
'm',' ','a',' ','l','i','b','r','a','r','y',#000,'W','_','A', 'm','e','t','h','o','d',' ','i','s',' ','h','i','d','d','e',
' ','i','n','h','e','r','i','t','e','d',' ','m','e','t','h', 'n',' ','b','y',' ','$','1',#000,'E','_','T','h','e','r','e',
'o','d',' ','i','s',' ','h','i','d','d','e','n',' ','b','y', ' ','i','s',' ','n','o',' ','m','e','t','h','o','d',' ','i',
' ','$','1',#000,'E','_','T','h','e','r','e',' ','i','s',' ', 'n',' ','a','n',' ','a','n','c','e','s','t','o','r',' ','c',
'n','o',' ','m','e','t','h','o','d',' ','i','n',' ','a','n', 'l','a','s','s',' ','t','o',' ','b','e',' ','o','v','e','r',
' ','a','n','c','e','s','t','o','r',' ','c','l','a','s','s', 'r','i','d','d','e','n',':',' ','$','1',#000,'E','_','N','o',
' ','t','o',' ','b','e',' ','o','v','e','r','r','i','d','d', ' ','m','e','m','b','e','r',' ','i','s',' ','p','r','o','v',
'e','n',':',' ','$','1',#000,'E','_','N','o',' ','m','e','m', 'i','d','e','d',' ','t','o',' ','a','c','c','e','s','s',' ',
'b','e','r',' ','i','s',' ','p','r','o','v','i','d','e','d', 'p','r','o','p','e','r','t','y',#000,'E','_','I','l','l','e',
' ','t','o',' ','a','c','c','e','s','s',' ','p','r','o','p', 'g','a','l',' ','s','y','m','b','o','l',' ','f','o','r',' ',
'e','r','t','y',#000,'E','_','I','l','l','e','g','a','l',' ', 'p','r','o','p','e','r','t','y',' ','a','c','c','e','s','s',
's','y','m','b','o','l',' ','f','o','r',' ','p','r','o','p', #000,'E','_','C','a','n','n','o','t',' ','a','c','c','e','s',
'e','r','t','y',' ','a','c','c','e','s','s',#000,'E','_','C', 's',' ','a',' ','p','r','o','t','e','c','t','e','d',' ','f',
'a','n','n','o','t',' ','w','r','i','t','e',' ','a',' ','p', 'i','e','l','d',' ','o','f',' ','a','n',' ','o','b','j','e',
'r','o','t','e','c','t','e','d',' ','f','i','e','l','d',' ', 'c','t',' ','h','e','r','e',#000,'E','_','C','a','n','n','o',
'o','f',' ','a','n',' ','o','b','j','e','c','t',#000,'E','_', 't',' ','a','c','c','e','s','s',' ','a',' ','p','r','i','v',
'a','t','e',' ','f','i','e','l','d',' ','o','f',' ','a','n',
' ','o','b','j','e','c','t',' ','h','e','r','e',#000,'E','_',
'a','l','l',' ','o','v','e','r','l','o','a','d','e','d',' ', 'a','l','l',' ','o','v','e','r','l','o','a','d','e','d',' ',
'm','e','t','h','o','d','s',' ','m','u','s','t',' ','b','e', 'm','e','t','h','o','d','s',' ','m','u','s','t',' ','b','e',
' ','v','i','r','t','u','a','l',' ','i','f',' ','o','n','e', ' ','v','i','r','t','u','a','l',' ','i','f',' ','o','n','e',

View File

@ -525,6 +525,13 @@ unit pass_1;
p^.registers32:=1; p^.registers32:=1;
if p^.symtable^.symtabletype=withsymtable then if p^.symtable^.symtabletype=withsymtable then
p^.registers32:=1; p^.registers32:=1;
{ check semantics of private }
if p^.symtable^.symtabletype=objectsymtable then
begin
if (pobjectdef(pvarsym(p^.symtableentry)^.owner^.defowner)^.owner^.symtabletype=unitsymtable) and
((p^.vs^.properties and sp_private)<>0) then
Message(parser_e_cant_access_private_member);
end;
{ a class variable is a pointer !!! { a class variable is a pointer !!!
yes, but we have to resolve the reference in an yes, but we have to resolve the reference in an
@ -3839,14 +3846,26 @@ unit pass_1;
exit; exit;
p^.resulttype:=p^.vs^.definition; p^.resulttype:=p^.vs^.definition;
{ this must be done in the parser
if count_ref and not must_be_valid then if count_ref and not must_be_valid then
if (p^.vs^.properties and sp_protected)<>0 then if (p^.vs^.properties and sp_protected)<>0 then
Message(parser_e_cant_write_protected_member); Message(parser_e_cant_write_protected_member);
}
p^.registers32:=p^.left^.registers32; p^.registers32:=p^.left^.registers32;
p^.registersfpu:=p^.left^.registersfpu; p^.registersfpu:=p^.left^.registersfpu;
{$ifdef SUPPORT_MMX} {$ifdef SUPPORT_MMX}
p^.registersmmx:=p^.left^.registersmmx; p^.registersmmx:=p^.left^.registersmmx;
{$endif SUPPORT_MMX} {$endif SUPPORT_MMX}
{ check protected and private members }
if (p^.left^.resulttype^.deftype=objectdef) then
begin
if (pobjectdef(p^.vs^.owner^.defowner)^.owner^.symtabletype=unitsymtable) and
((p^.vs^.properties and sp_private)<>0) then
Message(parser_e_cant_access_private_member);
if (pobjectdef(p^.left^.resulttype)^.owner^.symtabletype=unitsymtable) and
((p^.vs^.properties and sp_protected)<>0) then
Message(parser_e_cant_access_protected_member);
end;
{ classes must be dereferenced implicit } { classes must be dereferenced implicit }
if (p^.left^.resulttype^.deftype=objectdef) and if (p^.left^.resulttype^.deftype=objectdef) and
pobjectdef(p^.left^.resulttype)^.isclass then pobjectdef(p^.left^.resulttype)^.isclass then
@ -4827,7 +4846,13 @@ unit pass_1;
end. end.
{ {
$Log$ $Log$
Revision 1.14 1998-04-30 15:59:41 pierre Revision 1.15 1998-05-01 09:01:23 florian
+ correct semantics of private and protected
* small fix in variable scope:
a id can be used in a parameter list of a method, even it is used in
an anchestor class as field id
Revision 1.14 1998/04/30 15:59:41 pierre
* GDB works again better : * GDB works again better :
correct type info in one pass correct type info in one pass
+ UseTokenInfo for better source position + UseTokenInfo for better source position

View File

@ -645,6 +645,11 @@ unit pdecl;
begin begin
repeat repeat
if actmembertype=sp_private then
aktclass^.options:=aktclass^.options or oo_hasprivate;
if actmembertype=sp_protected then
aktclass^.options:=aktclass^.options or oo_hasprotected;
case token of case token of
ID: ID:
begin begin
@ -713,7 +718,7 @@ unit pdecl;
_CONSTRUCTOR: _CONSTRUCTOR:
begin begin
if actmembertype<>sp_public then if actmembertype<>sp_public then
Message(parser_e_constructor_cannot_be_private); Message(parser_w_constructor_should_be_public);
oldparse_only:=parse_only; oldparse_only:=parse_only;
parse_only:=true; parse_only:=true;
constructor_head; constructor_head;
@ -752,7 +757,7 @@ unit pdecl;
there_is_a_destructor:=true; there_is_a_destructor:=true;
if actmembertype<>sp_public then if actmembertype<>sp_public then
Message(parser_e_destructor_cannot_be_private); Message(parser_w_destructor_should_be_public);
oldparse_only:=parse_only; oldparse_only:=parse_only;
parse_only:=true; parse_only:=true;
destructor_head; destructor_head;
@ -831,7 +836,7 @@ unit pdecl;
(pobjectdef(hp1)^.options and oois_class)<>0)) then (pobjectdef(hp1)^.options and oois_class)<>0)) then
begin begin
pcrd:=new(pclassrefdef,init(hp1)); pcrd:=new(pclassrefdef,init(hp1));
object_dec:=pcrd; object_dec:=pcrd;
{I add big troubles here {I add big troubles here
with var p : ^byte in graph.putimage with var p : ^byte in graph.putimage
because a save_forward was called and because a save_forward was called and
@ -1787,7 +1792,13 @@ unit pdecl;
end. end.
{ {
$Log$ $Log$
Revision 1.14 1998-05-01 07:43:56 florian Revision 1.15 1998-05-01 09:01:23 florian
+ correct semantics of private and protected
* small fix in variable scope:
a id can be used in a parameter list of a method, even it is used in
an anchestor class as field id
Revision 1.14 1998/05/01 07:43:56 florian
+ basics for rtti implemented + basics for rtti implemented
+ switch $m (generate rtti for published sections) + switch $m (generate rtti for published sections)