From 7572f3a5392be6b01402ada3c897b70e64413b45 Mon Sep 17 00:00:00 2001 From: olle Date: Sun, 9 Jan 2005 20:24:43 +0000 Subject: [PATCH] * rework of macro subsystem + exportable macros for mode macpas --- compiler/compiler.pas | 8 +- compiler/fmodule.pas | 27 +- compiler/fppu.pas | 107 ++++++-- compiler/globals.pas | 9 +- compiler/msg/errore.msg | 5 +- compiler/msgidx.inc | 7 +- compiler/msgtxt.inc | 535 +++++++++++++++++++------------------- compiler/options.pas | 443 ++++++++++++++++--------------- compiler/parser.pas | 49 ++-- compiler/pmodules.pas | 112 +++++--- compiler/ppu.pas | 12 +- compiler/scandir.pas | 62 ++--- compiler/scanner.pas | 165 +++++------- compiler/symbase.pas | 20 +- compiler/symconst.pas | 9 +- compiler/symsym.pas | 86 +++++- compiler/symtable.pas | 159 ++++++++++- compiler/utils/ppudump.pp | 64 ++++- 18 files changed, 1147 insertions(+), 732 deletions(-) diff --git a/compiler/compiler.pas b/compiler/compiler.pas index 62fabbfaae..331bc758e2 100644 --- a/compiler/compiler.pas +++ b/compiler/compiler.pas @@ -310,7 +310,7 @@ begin do_initSymbolInfo; {$endif BrowserCol} inittokens; - InitSymtable; + InitSymtable; {Must come before read_arguments, to enable macrosymstack} CompilerInited:=true; { this is needed here for the IDE in case of compilation failure @@ -448,7 +448,11 @@ end; end. { $Log$ - Revision 1.50 2004-11-22 19:34:58 peter + Revision 1.51 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.50 2004/11/22 19:34:58 peter * GetHeapStatus added, removed MaxAvail,MemAvail,HeapSize Revision 1.49 2004/10/15 09:14:16 mazen diff --git a/compiler/fmodule.pas b/compiler/fmodule.pas index d5a72a6fab..76598e6d41 100644 --- a/compiler/fmodule.pas +++ b/compiler/fmodule.pas @@ -95,6 +95,7 @@ interface is_unit, in_interface, { processing the implementation part? } in_global : boolean; { allow global settings } + mode_switch_allowed : boolean; { Whether a mode switch is still allowed at this point in the parsing.} mainfilepos : tfileposinfo; recompile_reason : trecompile_reason; { the reason why the unit should be recompiled } crc, @@ -107,6 +108,8 @@ interface derefdata : tdynamicarray; globalsymtable, { pointer to the global symtable of this unit } localsymtable : tsymtable;{ pointer to the local symtable of this unit } + globalmacrosymtable, { pointer to the global macro symtable of this unit } + localmacrosymtable : tsymtable;{ pointer to the local macro symtable of this unit } scanner : pointer; { scanner object used } procinfo : pointer; { current procedure being compiled } loaded_from : tmodule; @@ -396,6 +399,8 @@ implementation derefdataintflen:=0; globalsymtable:=nil; localsymtable:=nil; + globalmacrosymtable:=nil; + localmacrosymtable:=nil; loaded_from:=LoadedFrom; do_reload:=false; do_compile:=false; @@ -410,6 +415,7 @@ implementation islibrary:=false; is_stab_written:=false; is_reset:=false; + mode_switch_allowed:= true; uses_imports:=false; imports:=TLinkedList.Create; _exports:=TLinkedList.Create; @@ -484,6 +490,10 @@ implementation globalsymtable.free; if assigned(localsymtable) then localsymtable.free; + if assigned(globalmacrosymtable) then + globalmacrosymtable.free; + if assigned(localmacrosymtable) then + localmacrosymtable.free; {$ifdef MEMDEBUG} d.free; {$endif} @@ -534,6 +544,16 @@ implementation localsymtable.free; localsymtable:=nil; end; + if assigned(globalmacrosymtable) then + begin + globalmacrosymtable.free; + globalmacrosymtable:=nil; + end; + if assigned(localmacrosymtable) then + begin + localmacrosymtable.free; + localmacrosymtable:=nil; + end; derefdata.free; derefdata:=TDynamicArray.Create(1024); if assigned(map) then @@ -577,6 +597,7 @@ implementation interface_compiled:=false; in_interface:=true; in_global:=true; + mode_switch_allowed:=true; is_stab_written:=false; is_reset:=false; crc:=0; @@ -711,7 +732,11 @@ implementation end. { $Log$ - Revision 1.50 2004-12-28 20:43:01 hajny + Revision 1.51 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.50 2004/12/28 20:43:01 hajny * 8.3 fixes (short target name in paths) Revision 1.49 2004/11/04 23:59:13 peter diff --git a/compiler/fppu.pas b/compiler/fppu.pas index 181f01f528..6aef8875bf 100644 --- a/compiler/fppu.pas +++ b/compiler/fppu.pas @@ -64,20 +64,22 @@ interface procedure load_implementation; procedure load_symtable_refs; procedure load_usedunits; - procedure writeusedmacro(p:TNamedIndexItem;arg:pointer); - procedure writeusedmacros; procedure writesourcefiles; procedure writeusedunit(intf:boolean); procedure writelinkcontainer(var p:tlinkcontainer;id:byte;strippath:boolean); procedure writederefdata; procedure putasmsymbol_in_idx(s:tnamedindexitem;arg:pointer); procedure writeasmsymbols; - procedure readusedmacros; procedure readsourcefiles; procedure readloadunit; procedure readlinkcontainer(var p:tlinkcontainer); procedure readderefdata; procedure readasmsymbols; +{$IFDEF MACRO_DIFF_HINT} + procedure writeusedmacro(p:TNamedIndexItem;arg:pointer); + procedure writeusedmacros; + procedure readusedmacros; +{$ENDIF} end; procedure reload_flagged_units; @@ -88,7 +90,7 @@ implementation uses verbose,systems,version, - symtable, + symtable, symsym, scanner, aasmbase, parser; @@ -398,25 +400,33 @@ uses PPU Reading/Writing Helpers ***********************************} +{$IFDEF MACRO_DIFF_HINT} + var + is_initial: Boolean; + procedure tppumodule.writeusedmacro(p:TNamedIndexItem;arg:pointer); begin - if tmacro(p).is_used or tmacro(p).defined_at_startup then + if tmacro(p).is_used or is_initial then begin ppufile.putstring(p.name); - ppufile.putbyte(byte(tmacro(p).defined_at_startup)); + ppufile.putbyte(byte(is_initial)); ppufile.putbyte(byte(tmacro(p).is_used)); end; end; - procedure tppumodule.writeusedmacros; begin ppufile.do_crc:=false; - tscannerfile(scanner).macros.foreach(@writeusedmacro,nil); + is_initial:= true; + initialmacrosymtable.foreach(@writeusedmacro,nil); + is_initial:= false; + if assigned(globalmacrosymtable) then + globalmacrosymtable.foreach(@writeusedmacro,nil); + localmacrosymtable.foreach(@writeusedmacro,nil); ppufile.writeentry(ibusedmacros); ppufile.do_crc:=true; end; - +{$ENDIF} procedure tppumodule.writesourcefiles; var @@ -588,41 +598,55 @@ uses ppufile.writeentry(ibasmsymbols); end; +{$IFDEF MACRO_DIFF_HINT} +{ + Define MACRO_DIFF_HINT for the whole compiler (and ppudump) + to turn this facility on. There is some problems with this, + thats why it is shut off: + + At the first compilation, consider a macro which is not initially + defined, but it is used (e g the check that it is undefined is true). + Since it do not exist, there is no macro object where the is_used + flag can be set. Later on when the macro is defined, and the ppu + is opened, the check cannot detect this. + + Also, in which macro object should this flag be set ? It cant be set + for macros in the initialmacrosymboltable since this table is shared + between different files. +} + procedure tppumodule.readusedmacros; var hs : string; mac : tmacro; - was_defined_at_startup, + was_initial, was_used : boolean; + {Reads macros which was defined or used when the module was compiled. + This is done when a ppu file is open, before it possibly is parsed.} begin - { only possible when we've a scanner of the current file } - if not assigned(current_scanner) then - exit; while not ppufile.endofentry do begin hs:=ppufile.getstring; - was_defined_at_startup:=boolean(ppufile.getbyte); + was_initial:=boolean(ppufile.getbyte); was_used:=boolean(ppufile.getbyte); - mac:=tmacro(tscannerfile(current_scanner).macros.search(hs)); + mac:=tmacro(initialmacrosymtable.search(hs)); if assigned(mac) then begin {$ifndef EXTDEBUG} { if we don't have the sources why tell } if sources_avail then {$endif ndef EXTDEBUG} - if (not was_defined_at_startup) and - was_used and - mac.defined_at_startup then + if (not was_initial) and was_used then Message2(unit_h_cond_not_set_in_last_compile,hs,mainsource^); end else { not assigned } - if was_defined_at_startup and + if was_initial and was_used then Message2(unit_h_cond_set_in_last_compile,hs,mainsource^); end; end; - +{$ENDIF} procedure tppumodule.readsourcefiles; var @@ -854,8 +878,10 @@ uses end; ibsourcefiles : readsourcefiles; +{$IFDEF MACRO_DIFF_HINT} ibusedmacros : readusedmacros; +{$ENDIF} ibloadunit : readloadunit; iblinkunitofiles : @@ -962,7 +988,9 @@ uses ppufile.writeentry(ibmodulename); writesourcefiles; +{$IFDEF MACRO_DIFF_HINT} writeusedmacros; +{$ENDIF} { write interface uses } writeusedunit(true); @@ -1000,6 +1028,18 @@ uses { write the symtable entries } tstoredsymtable(globalsymtable).ppuwrite(ppufile); + if assigned(globalmacrosymtable) and (globalmacrosymtable.symindex.count > 0) then + begin + ppufile.putbyte(byte(true)); + ppufile.writeentry(ibexportedmacros); + tstoredsymtable(globalmacrosymtable).ppuwrite(ppufile); + end + else + begin + ppufile.putbyte(byte(false)); + ppufile.writeentry(ibexportedmacros); + end; + { everything after this doesn't affect the crc } ppufile.do_crc:=false; @@ -1095,6 +1135,18 @@ uses { write the symtable entries } tstoredsymtable(globalsymtable).ppuwrite(ppufile); + if assigned(globalmacrosymtable) and (globalmacrosymtable.symindex.count > 0) then + begin + ppufile.putbyte(byte(true)); + ppufile.writeentry(ibexportedmacros); + tstoredsymtable(globalmacrosymtable).ppuwrite(ppufile); + end + else + begin + ppufile.putbyte(byte(false)); + ppufile.writeentry(ibexportedmacros); + end; + { save crc } crc:=ppufile.crc; interface_crc:=ppufile.interface_crc; @@ -1180,6 +1232,15 @@ uses internalerror(200208187); globalsymtable:=tglobalsymtable.create(modulename^); tstoredsymtable(globalsymtable).ppuload(ppufile); + + if ppufile.readentry<>ibexportedmacros then + Message(unit_f_ppu_read_error); + if boolean(ppufile.getbyte) then + begin + globalmacrosymtable:=tmacrosymtable.Create(true); + tstoredsymtable(globalmacrosymtable).ppuload(ppufile) + end; + interface_compiled:=true; { read the implementation part, containing @@ -1512,7 +1573,11 @@ uses end. { $Log$ - Revision 1.63 2004-10-15 09:14:16 mazen + Revision 1.64 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.63 2004/10/15 09:14:16 mazen - remove $IFDEF DELPHI and related code - remove $IFDEF FPCPROCVAR and related code diff --git a/compiler/globals.pas b/compiler/globals.pas index 46723cacc8..4a55b43154 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -187,7 +187,6 @@ interface aktexceptblock : integer; { the exceptblock number of the current block (0 if none) } { commandline values } - initdefines : tstringlist; initglobalswitches : tglobalswitches; initmoduleswitches : tmoduleswitches; initlocalswitches : tlocalswitches; @@ -2041,7 +2040,6 @@ end; procedure DoneGlobals; begin - initdefines.free; if assigned(DLLImageBase) then StringDispose(DLLImageBase); librarysearchpath.Free; @@ -2168,7 +2166,6 @@ end; {$endif x86_64} initinterfacetype:=it_interfacecom; initdefproccall:=pocall_default; - initdefines:=TStringList.Create; { memory sizes, will be overriden by parameter or default for target in options or init_parser } @@ -2180,7 +2177,11 @@ end; end. { $Log$ - Revision 1.159 2005-01-06 13:40:41 florian + Revision 1.160 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.159 2005/01/06 13:40:41 florian * 1.0.10 starting patch from Peter Revision 1.158 2005/01/06 09:20:36 karoly diff --git a/compiler/msg/errore.msg b/compiler/msg/errore.msg index f0e5916d2d..296ec48474 100644 --- a/compiler/msg/errore.msg +++ b/compiler/msg/errore.msg @@ -303,6 +303,9 @@ scan_e_error_macro_lacks_value=02065_E_Macro "$1" does not have any value % Thus the conditional compiling expression cannot be evaluated. scan_e_wrong_switch_toggle_default=02066_E_Wrong switch toggle, use ON/OFF/DEFAULT or +/-/* % You need to use ON or OFF or DEFAULT or a + or - or * to toggle the switch +scan_e_mode_switch_not_allowed=02067_E_Mode switch "$1" not allowed here +% A mode switch has already been encountered, or, in case of option -Mmacpas, +% a mode switch occur after UNIT. % \end{description} # # Parser @@ -2076,8 +2079,6 @@ option_interpreting_firstpass_option=11036_D_interpreting firstpass option "$1" option_interpreting_file_option=11033_D_interpreting file option "$1" option_read_config_file=11034_D_Reading config file "$1" option_found_file=11035_D_found source file name "$1" -option_defining_symbol=11037_D_Defining symbol $1 -option_undefining_symbol=11038_D_Undefining symbol $1 % Additional infos about options, displayed % when you have debug option turned on. option_code_page_not_available=11039_E_Unknown code page diff --git a/compiler/msgidx.inc b/compiler/msgidx.inc index 635f622fbc..2d416676b7 100644 --- a/compiler/msgidx.inc +++ b/compiler/msgidx.inc @@ -81,6 +81,7 @@ const scan_e_too_many_pop=02064; scan_e_error_macro_lacks_value=02065; scan_e_wrong_switch_toggle_default=02066; + scan_e_mode_switch_not_allowed=02067; parser_e_syntax_error=03000; parser_e_dont_nest_interrupt=03004; parser_w_proc_directive_ignored=03005; @@ -644,16 +645,14 @@ const option_interpreting_file_option=11033; option_read_config_file=11034; option_found_file=11035; - option_defining_symbol=11037; - option_undefining_symbol=11038; option_code_page_not_available=11039; option_logo=11023; option_info=11024; option_help_pages=11025; - MsgTxtSize = 37959; + MsgTxtSize = 37945; MsgIdxMax : array[1..20] of longint=( - 18,67,213,59,57,46,100,20,35,60, + 18,68,213,59,57,46,100,20,35,60, 40,1,1,1,1,1,1,1,1,1 ); diff --git a/compiler/msgtxt.inc b/compiler/msgtxt.inc index d9c6c69c3f..6b4140f2e6 100644 --- a/compiler/msgtxt.inc +++ b/compiler/msgtxt.inc @@ -89,619 +89,618 @@ const msgtxt : array[0..000158,1..240] of char=( '02064_E_A POP without a preceding PUSH'#000+ '02065_E_M','acro "$1" does not have any value'#000+ '02066_E_Wrong switch toggle, use ON/OFF/DEFAULT or +/-/*'#000+ + '02067_E_Mode switch "$1" not allowed here'#000+ '03000_E_Parser - Syntax Error'#000+ '03004_E_INTERRUPT procedure can'#039't be nested'#000+ - '03005_W_Procedure type "$1" ignored'#000+ - '03006_E_Not all declarations of "$1" ar','e declared with OVERLOAD'#000+ + '03005_W_Procedure type "$1" ignor','ed'#000+ + '03006_E_Not all declarations of "$1" are declared with OVERLOAD'#000+ '03008_E_Duplicate exported function name "$1"'#000+ '03009_E_Duplicate exported function index $1'#000+ '03010_E_Invalid index for exported function'#000+ - '03011_W_Relocatable DLL or executable $1 debug info does not work, dis'+ - 'abled.'#000+ - '030','12_W_To allow debugging for win32 code you need to disable reloca'+ - 'tion with -WN option'#000+ + '03011_W_Relocatable DLL or executable ','$1 debug info does not work, d'+ + 'isabled.'#000+ + '03012_W_To allow debugging for win32 code you need to disable relocati'+ + 'on with -WN option'#000+ '03013_E_Constructor name must be INIT'#000+ '03014_E_Destructor name must be DONE'#000+ - '03016_E_Procedure type INLINE not supported'#000+ - '03018_W_Constructor should be publi','c'#000+ + '03016_E_Procedure type INLINE not sup','ported'#000+ + '03018_W_Constructor should be public'#000+ '03019_W_Destructor should be public'#000+ '03020_N_Class should have one destructor only'#000+ '03021_E_Local class definitions are not allowed'#000+ '03022_F_Anonym class definitions are not allowed'#000+ - '03023_N_The object "$1" has no VMT'#000+ - '03024_E_Illegal paramete','r list'#000+ + '03023_N_The objec','t "$1" has no VMT'#000+ + '03024_E_Illegal parameter list'#000+ '03026_E_Wrong number of parameters specified'#000+ '03027_E_overloaded identifier "$1" isn'#039't a function'#000+ '03028_E_overloaded functions have the same parameter list'#000+ - '03029_E_function header doesn'#039't match the forward declaration "$1"'+ - #000+ - '03030_E_fun','ction header "$1" doesn'#039't match forward : var name ch'+ - 'anges $2 => $3'#000+ + '03029_E_function header doesn'#039't matc','h the forward declaration "$'+ + '1"'#000+ + '03030_E_function header "$1" doesn'#039't match forward : var name chan'+ + 'ges $2 => $3'#000+ '03031_N_Values in enumeration types have to be ascending'#000+ '03033_E_With can not be used for variables in a different segment'#000+ - '03034_E_function nesting > 31'#000+ - '03035_E_range check',' error while evaluating constants'#000+ + '03034_E','_function nesting > 31'#000+ + '03035_E_range check error while evaluating constants'#000+ '03036_W_range check error while evaluating constants'#000+ '03037_E_duplicate case label'#000+ '03038_E_Upper bound of case range is less than lower bound'#000+ - '03039_E_typed constants of classes are not allowed'#000+ - '03040_E_functi','ons variables of overloaded functions are not allowed'#000+ + '03039_E_typed constants',' of classes are not allowed'#000+ + '03040_E_functions variables of overloaded functions are not allowed'#000+ '03041_E_string length must be a value from 1 to 255'#000+ '03042_W_use extended syntax of NEW and DISPOSE for instances of object'+ 's'#000+ - '03043_W_use of NEW or DISPOSE for untyped pointers is meaningl','ess'#000+ + '03043_W_use of NEW o','r DISPOSE for untyped pointers is meaningless'#000+ '03044_E_use of NEW or DISPOSE is not possible for untyped pointers'#000+ '03045_E_class identifier expected'#000+ '03046_E_type identifier not allowed here'#000+ '03047_E_method identifier expected'#000+ - '03048_E_function header doesn'#039't match any method of this cl','ass "'+ + '03048_E_function ','header doesn'#039't match any method of this class "'+ '$1"'#000+ '03049_DL_procedure/function $1'#000+ '03050_E_Illegal floating point constant'#000+ '03051_E_FAIL can be used in constructors only'#000+ '03052_E_Destructors can'#039't have parameters'#000+ - '03053_E_Only class methods can be referred with class references'#000+ - '03054_E','_Only class methods can be accessed in class methods'#000+ + '03053_E_Only class methods can',' be referred with class references'#000+ + '03054_E_Only class methods can be accessed in class methods'#000+ '03055_E_Constant and CASE types do not match'#000+ '03056_E_The symbol can'#039't be exported from a library'#000+ '03057_W_An inherited method is hidden by "$1"'#000+ - '03058_E_There is no method in an ancestor cl','ass to be overridden: "$'+ + '03','058_E_There is no method in an ancestor class to be overridden: "$'+ '1"'#000+ '03059_E_No member is provided to access property'#000+ '03060_W_Stored prorperty directive is not yet implemented'#000+ '03061_E_Illegal symbol for property access'#000+ - '03062_E_Cannot access a protected field of an object here'#000+ - '03063','_E_Cannot access a private field of an object here'#000+ + '03062_E_Cannot access',' a protected field of an object here'#000+ + '03063_E_Cannot access a private field of an object here'#000+ '03066_E_overridden methods must have the same return type: "$2" is ove'+ 'rriden by "$1" which has another return type'#000+ - '03067_E_EXPORT declared functions can'#039't be nested'#000+ - '03068_E_methods can'#039't be',' EXPORTed'#000+ + '03067_E_EXPORT declared function','s can'#039't be nested'#000+ + '03068_E_methods can'#039't be EXPORTed'#000+ '03069_E_call by var parameters have to match exactly: Got "$1" expecte'+ 'd "$2"'#000+ '03070_E_Class isn'#039't a parent class of the current class'#000+ '03071_E_SELF is only allowed in methods'#000+ - '03072_E_methods can be only in other methods called direc','t with type'+ + '03072_E_methods',' can be only in other methods called direct with type'+ ' identifier of the class'#000+ '03073_E_Illegal use of '#039':'#039#000+ '03074_E_range check error in set constructor or duplicate set element'#000+ '03075_E_Pointer to object expected'#000+ - '03076_E_Expression must be constructor call'#000+ - '03077_E_Expression must be d','estructor call'#000+ + '03076_E_Expression must be con','structor call'#000+ + '03077_E_Expression must be destructor call'#000+ '03078_E_Illegal order of record elements'#000+ '03079_E_Expression type must be class or record type'#000+ '03080_E_Procedures can'#039't return a value'#000+ - '03081_E_constructors and destructors must be methods'#000+ + '03081_E_constructors and destructors must be meth','ods'#000+ '03082_E_Operator is not overloaded'#000+ - '030','83_E_Impossible to overload assignment for equal types'#000+ + '03083_E_Impossible to overload assignment for equal types'#000+ '03084_E_Impossible operator overload'#000+ '03085_E_Re-raise isn'#039't possible there'#000+ '03086_E_The extended syntax of new or dispose isn'#039't allowed for a '+ - 'class'#000+ - '03088_E_Procedure overloading is switc','hed off'#000+ + 'cl','ass'#000+ + '03088_E_Procedure overloading is switched off'#000+ '03089_E_It is not possible to overload this operator (overload = inste'+ 'ad)'#000+ '03090_E_Comparative operator must return a boolean value'#000+ '03091_E_Only virtual methods can be abstract'#000+ - '03092_F_Use of unsupported feature!'#000+ - '03093_E_The mix of d','ifferent kind of objects (class, object, interfa'+ - 'ce, etc) isn'#039't allowed'#000+ + '03092_F_Use of',' unsupported feature!'#000+ + '03093_E_The mix of different kind of objects (class, object, interface'+ + ', etc) isn'#039't allowed'#000+ '03094_W_Unknown procedure directive had to be ignored: "$1"'#000+ '03095_E_absolute can only be associated to one variable'#000+ - '03096_E_absolute can only be associated with a var or',' const'#000+ + '03096_E_abs','olute can only be associated with a var or const'#000+ '03097_E_Only one variable can be initialized'#000+ '03098_E_Abstract methods shouldn'#039't have any definition (with funct'+ 'ion body)'#000+ '03099_E_This overloaded function can'#039't be local (must be exported)'+ #000+ - '03100_W_Virtual methods are used without a co','nstructor in "$1"'#000+ + '031','00_W_Virtual methods are used without a constructor in "$1"'#000+ '03101_CL_Macro defined: $1'#000+ '03102_CL_Macro undefined: $1'#000+ '03103_CL_Macro $1 set to $2'#000+ '03104_I_Compiling $1'#000+ '03105_UL_Parsing interface of unit $1'#000+ - '03106_UL_Parsing implementation of $1'#000+ - '03107_DL_Compiling $1 for the second time',#000+ + '03106_UL_Parsing implementation of $1',#000+ + '03107_DL_Compiling $1 for the second time'#000+ '03109_E_No property found to override'#000+ '03110_E_Only one default property is allowed'#000+ '03111_E_The default property must be an array property'#000+ - '03112_E_Virtual constructors are only supported in class object model'#000+ - '03113_E_No default property ava','ilable'#000+ + '03112_E_Virtual constructors are only supported in class ob','ject mode'+ + 'l'#000+ + '03113_E_No default property available'#000+ '03114_E_The class can'#039't have a published section, use the {$M+} sw'+ 'itch'#000+ '03115_E_Forward declaration of class "$1" must be resolved here to use'+ ' the class as ancestor'#000+ - '03116_E_Local operators not supported'#000+ - '03117_E_Procedure directive "$1','" not allowed in interface section'#000+ + '03116_E_Local operators not',' supported'#000+ + '03117_E_Procedure directive "$1" not allowed in interface section'#000+ '03118_E_Procedure directive "$1" not allowed in implementation section'+ #000+ '03119_E_Procedure directive "$1" not allowed in procvar declaration'#000+ - '03120_E_Function is already declared Public/Forward "$1"'#000+ - '03121_E_C','an'#039't use both EXPORT and EXTERNAL'#000+ + '03120_E_Function is alre','ady declared Public/Forward "$1"'#000+ + '03121_E_Can'#039't use both EXPORT and EXTERNAL'#000+ '03123_W_"$1" not yet supported inside inline procedure/function'#000+ '03124_W_Inlining disabled'#000+ '03125_I_Writing Browser log $1'#000+ - '03126_H_may be pointer dereference is missing'#000+ - '03127_F_Selected assembler reader not s','upported'#000+ + '03126_H_may be pointer dereference is missi','ng'#000+ + '03127_F_Selected assembler reader not supported'#000+ '03128_E_Procedure directive "$1" has conflicts with other directives'#000+ '03129_E_Calling convention doesn'#039't match forward'#000+ '03131_E_Property can'#039't have a default value'#000+ - '03132_E_The default value of a property must be constant'#000+ - '03133_E_Symb','ol can'#039't be published, can be only a class'#000+ + '03132_E_The default value o','f a property must be constant'#000+ + '03133_E_Symbol can'#039't be published, can be only a class'#000+ '03134_E_That kind of property can'#039't be published'#000+ '03136_E_An import name is required'#000+ '03138_E_Division by zero'#000+ '03139_E_Invalid floating point operation'#000+ - '03140_E_Upper bound of range is less than lower',' bound'#000+ + '03140','_E_Upper bound of range is less than lower bound'#000+ '03141_W_string "$1" is longer than "$2"'#000+ '03142_E_string length is larger than array of char length'#000+ '03143_E_Illegal expression after message directive'#000+ - '03144_E_Message handlers can take only one call by ref. parameter'#000+ - '03145_E_Duplicate ','message label: "$1"'#000+ + '03144_E_Message handlers can take only one',' call by ref. parameter'#000+ + '03145_E_Duplicate message label: "$1"'#000+ '03146_E_Self can only be an explicit parameter in methods which are me'+ 'ssage handlers'#000+ '03147_E_Threadvars can be only static or global'#000+ - '03148_F_Direct assembler not supported for binary output format'#000+ - '03149_W_Don'#039't load OBJP','AS unit manually, use {$mode objfpc} or {'+ - '$mode delphi} instead'#000+ + '03148_F_Direct assembler not supported for bi','nary output format'#000+ + '03149_W_Don'#039't load OBJPAS unit manually, use {$mode objfpc} or {$m'+ + 'ode delphi} instead'#000+ '03150_E_OVERRIDE can'#039't be used in objects'#000+ '03151_E_Data types which require initialization/finalization can'#039't'+ - ' be used in variant records'#000+ - '03152_E_Resourcestrings can be only stati','c or global'#000+ + ' be used in variant records',#000+ + '03152_E_Resourcestrings can be only static or global'#000+ '03153_E_Exit with argument can'#039't be used here'#000+ '03154_E_The type of the storage symbol must be boolean'#000+ '03155_E_This symbol isn'#039't allowed as storage symbol'#000+ - '03156_E_Only class which are compiled in $M+ mode can be published'#000+ - '03157_E_','Procedure directive expected'#000+ + '03156_E_Only class which are comp','iled in $M+ mode can be published'#000+ + '03157_E_Procedure directive expected'#000+ '03158_E_The value for a property index must be of an ordinal type'#000+ '03159_E_Procedure name to short to be exported'#000+ - '03160_E_No DEFFILE entry can be generated for unit global vars'#000+ - '03161_E_Compile without -WD option'#000, + '03160_E_No DEFFILE entry can be generated for unit globa','l vars'#000+ + '03161_E_Compile without -WD option'#000+ '03162_F_You need ObjFpc (-S2) or Delphi (-Sd) mode to compile this mod'+ 'ule'#000+ '03163_E_Can'#039't export with index under $1'#000+ '03164_E_Exporting of variables is not supported under $1'#000+ - '03165_E_Improper GUID syntax'#000+ - '03168_W_Procedure named "$1" not found ','that is suitable for implemen'+ - 'ting the $2.$3'#000+ + '03165_E_Improper GUID synt','ax'#000+ + '03168_W_Procedure named "$1" not found that is suitable for implementi'+ + 'ng the $2.$3'#000+ '03169_E_interface identifier expected'#000+ '03170_E_Type "$1" can'#039't be used as array index type'#000+ '03171_E_Con- and destructors aren'#039't allowed in interfaces'#000+ - '03172_E_Access specifiers can'#039't be used in INTER','FACES'#000+ + '03172_','E_Access specifiers can'#039't be used in INTERFACES'#000+ '03173_E_An interface can'#039't contain fields'#000+ '03174_E_Can'#039't declare local procedure as EXTERNAL'#000+ '03175_W_Some fields coming before "$1" weren'#039't initialized'#000+ - '03176_E_Some fields coming before "$1" weren'#039't initialized'#000+ - '03177_W_Some fields comi','ng after "$1" weren'#039't initialized'#000+ + '03176_E_Some fields coming before "$1" we','ren'#039't initialized'#000+ + '03177_W_Some fields coming after "$1" weren'#039't initialized'#000+ '03178_E_VarArgs directive without CDecl and External'#000+ '03179_E_Self must be a normal (call-by-value) parameter'#000+ - '03180_E_Interface "$1" has no interface identification'#000+ - '03181_E_Unknown class field or method iden','tifier "$1"'#000+ + '03180_E_Interface "$1" has no interface identification'#000, + '03181_E_Unknown class field or method identifier "$1"'#000+ '03182_W_Overriding calling convention "$1" with "$2"'#000+ '03183_E_Typed constants of the type "procedure of object" can only be '+ 'initialized with NIL'#000+ - '03184_E_Default value can only be assigned to one parameter'#000+ - '03185_E_Default paramete','r required for "$1"'#000+ + '03184_E_Default value can only be assigned',' to one parameter'#000+ + '03185_E_Default parameter required for "$1"'#000+ '03186_W_Use of unsupported feature!'#000+ '03187_H_C arrays are passed by reference'#000+ '03188_E_C array of const must be the last argument'#000+ '03189_H_Type "$1" redefinition'#000+ - '03190_W_cdecl'#039'ared functions have no high parameter'#000+ - '03191_W_c','decl'#039'ared functions do not support open strings'#000+ + '03190_W_cdecl'#039'ared ','functions have no high parameter'#000+ + '03191_W_cdecl'#039'ared functions do not support open strings'#000+ '03192_E_Cannot initialize variables declared as threadvar'#000+ '03193_E_Message directive is only allowed in Classes'#000+ - '03194_E_Procedure or Function expected'#000+ - '03195_W_Calling convention directive ignor','ed: "$1"'#000+ + '03194_E_Procedure or Function expected'#000, + '03195_W_Calling convention directive ignored: "$1"'#000+ '03196_E_REINTRODUCE can'#039't be used in objects'#000+ '03197_E_Each argument must have it'#039's own location'#000+ '03198_E_Each argument must have an explicit location'#000+ '03199_E_Unknown argument location'#000+ - '03200_E_32 Bit-Integer or pointer variable expect','ed'#000+ + '03200_E','_32 Bit-Integer or pointer variable expected'#000+ '03201_E_Goto statements aren'#039't allowed between different procedure'+ 's'#000+ '03202_F_Procedure too complex, it requires too much registers'#000+ '03203_E_Illegal expression'#000+ '03204_E_Invalid integer expression'#000+ - '03205_E_Illegal qualifier'#000+ - '03206_E_High range ','limit < low range limit'#000+ + '032','05_E_Illegal qualifier'#000+ + '03206_E_High range limit < low range limit'#000+ '03207_E_Exit'#039's parameter must be the name of the procedure it is u'+ 'sed in'#000+ '03208_E_Illegal assignment to for-loop variable "$1"'#000+ - '03209_E_Can'#039't declare local variable as EXTERNAL'#000+ - '03210_E_Procedure is already declared EXT','ERNAL'#000+ + '03209_E_Can'#039't declare local variable as EXTERNAL',#000+ + '03210_E_Procedure is already declared EXTERNAL'#000+ '03211_W_Implicit uses of Variants unit'#000+ '03212_E_Class and static methods can'#039't be used in INTERFACES'#000+ '04000_E_Type mismatch'#000+ '04001_E_Incompatible types: got "$1" expected "$2"'#000+ - '04002_E_Type mismatch between "$1" and "$2"'#000+ - '04003_E_Type iden','tifier expected'#000+ + '04002_E_Type mismat','ch between "$1" and "$2"'#000+ + '04003_E_Type identifier expected'#000+ '04004_E_Variable identifier expected'#000+ '04005_E_Integer expression expected, but got "$1"'#000+ '04006_E_Boolean expression expected, but got "$1"'#000+ '04007_E_Ordinal expression expected'#000+ - '04008_E_pointer type expected, but got "$1"'#000+ - '04009_E','_class type expected, but got "$1"'#000+ + '04008_E_p','ointer type expected, but got "$1"'#000+ + '04009_E_class type expected, but got "$1"'#000+ '04011_E_Can'#039't evaluate constant expression'#000+ '04012_E_Set elements are not compatible'#000+ '04013_E_Operation not implemented for sets'#000+ - '04014_W_Automatic type conversion from floating type to COMP which is '+ - 'an intege','r type'#000+ + '04014_W_Automatic type conversion fro','m floating type to COMP which i'+ + 's an integer type'#000+ '04015_H_use DIV instead to get an integer result'#000+ '04016_E_string types doesn'#039't match, because of $V+ mode'#000+ '04017_E_succ or pred on enums with assignments not possible'#000+ - '04018_E_Can'#039't read or write variables of this type'#000+ - '04019_E_Can'#039't use',' readln or writeln on typed file'#000+ + '04018_E_Can'#039't read or writ','e variables of this type'#000+ + '04019_E_Can'#039't use readln or writeln on typed file'#000+ '04020_E_Can'#039't use read or write on untyped file.'#000+ '04021_E_Type conflict between set elements'#000+ '04022_W_lo/hi(dword/qword) returns the upper/lower word/dword'#000+ - '04023_E_Integer or real expression expected'#000+ - '04024_E_W','rong type "$1" in array constructor'#000+ + '04023_E_Int','eger or real expression expected'#000+ + '04024_E_Wrong type "$1" in array constructor'#000+ '04025_E_Incompatible type for arg no. $1: Got "$2", expected "$3"'#000+ '04026_E_Method (variable) and Procedure (variable) are not compatible'#000+ - '04027_E_Illegal constant passed to internal math function'#000+ - '04028_E_Ca','n'#039't get the address of constants'#000+ + '04027_E_Illegal constant p','assed to internal math function'#000+ + '04028_E_Can'#039't get the address of constants'#000+ '04029_E_Argument can'#039't be assigned to'#000+ '04030_E_Can'#039't assign local procedure/function to procedure variabl'+ 'e'#000+ '04031_E_Can'#039't assign values to an address'#000+ - '04032_E_Can'#039't assign values to const variable'#000+ - '04033_E_Array',' type required'#000+ + '04032_E_Can'#039't ass','ign values to const variable'#000+ + '04033_E_Array type required'#000+ '04034_E_interface type expected, but got "$1"'#000+ '04035_W_Mixing signed expressions and longwords gives a 64bit result'#000+ - '04036_W_Mixing signed expressions and cardinals here may cause a range'+ - ' check error'#000+ - '04037_E_Typecast has differ','ent size ($1 -> $2) in assignment'#000+ + '04036_W_Mixing signed expressions and cardinals here may cause a ran','g'+ + 'e check error'#000+ + '04037_E_Typecast has different size ($1 -> $2) in assignment'#000+ '04038_E_enums with assignments can'#039't be used as array index'#000+ '04039_E_Class or Object types "$1" and "$2" are not related'#000+ - '04040_W_Class types "$1" and "$2" are not related'#000+ - '04041_E_Class or interface type expe','cted, but got "$1"'#000+ + '04040_W_Class types "$1" and "$2" are not re','lated'#000+ + '04041_E_Class or interface type expected, but got "$1"'#000+ '04042_E_Type "$1" is not completely defined'#000+ '04043_W_String literal has more characters than short string length'#000+ '04044_W_Comparison is always false due to range of values'#000+ - '04045_W_Comparison is always true due to range of v','alues'#000+ + '04045_W_C','omparison is always true due to range of values'#000+ '04046_W_Constructing a class "$1" with abstract methods'#000+ '04047_H_The left operand of the IN operator should be byte sized'#000+ '04048_W_Type size mismatch, possible loss of data / range check error'#000+ - '04049_H_Type size mismatch, possible loss o','f data / range check erro'+ + '0','4049_H_Type size mismatch, possible loss of data / range check erro'+ 'r'#000+ '04050_E_The address of an abstract method can'#039't be taken'#000+ '04051_E_The operator is not applicable for the operand type'#000+ '04052_E_Constant Expression expected'#000+ - '04053_E_Operation "$1" not supported for types "$2" and "$3','"'#000+ + '04053_E_Operation',' "$1" not supported for types "$2" and "$3"'#000+ '04054_E_Illegal type conversion: "$1" to "$2"'#000+ '04055_H_Conversion between ordinals and pointers is not portable'#000+ '04056_W_Conversion between ordinals and pointers is not portable'#000+ - '04057_E_Can'#039't determine which overloaded function to call'#000+ - '0405','8_E_Illegal counter variable'#000+ + '04057_E_Can'#039't determ','ine which overloaded function to call'#000+ + '04058_E_Illegal counter variable'#000+ '05000_E_Identifier not found "$1"'#000+ '05001_F_Internal Error in SymTableStack()'#000+ '05002_E_Duplicate identifier "$1"'#000+ '05003_H_Identifier already defined in $1 at line $2'#000+ - '05004_E_Unknown identifier "$1"'#000+ - '05005_E_Forward d','eclaration not solved "$1"'#000+ + '05004_E','_Unknown identifier "$1"'#000+ + '05005_E_Forward declaration not solved "$1"'#000+ '05007_E_Error in type definition'#000+ '05009_E_Forward type not resolved "$1"'#000+ '05010_E_Only static variables can be used in static methods or outside'+ ' methods'#000+ - '05012_F_record or class type expected'#000+ - '05013_E_Instances of cla','sses or objects with an abstract method are '+ - 'not allowed'#000+ + '05012_F_record or cl','ass type expected'#000+ + '05013_E_Instances of classes or objects with an abstract method are no'+ + 't allowed'#000+ '05014_W_Label not defined "$1"'#000+ '05015_E_Label used but not defined "$1"'#000+ '05016_E_Illegal label declaration'#000+ - '05017_E_GOTO and LABEL are not supported (use switch -Sg)'#000+ - '05018_E_Label not fou','nd'#000+ + '05017_E_GOTO and LABEL are not suppor','ted (use switch -Sg)'#000+ + '05018_E_Label not found'#000+ '05019_E_identifier isn'#039't a label'#000+ '05020_E_label already defined'#000+ '05021_E_illegal type declaration of set elements'#000+ '05022_E_Forward class definition not resolved "$1"'#000+ - '05023_H_Unit "$1" not used in $2'#000+ + '05023_H_Unit "$1" not used in $2',#000+ '05024_H_Parameter "$1" not used'#000+ - '05025_N_L','ocal variable "$1" not used'#000+ + '05025_N_Local variable "$1" not used'#000+ '05026_H_Value parameter "$1" is assigned but never used'#000+ '05027_N_Local variable "$1" is assigned but never used'#000+ '05028_H_Local $1 "$2" is not used'#000+ - '05029_N_Private field "$1.$2" is never used'#000+ - '05030_N_Private field "','$1.$2" is assigned but never used'#000+ + '05029_N_Private field "$1','.$2" is never used'#000+ + '05030_N_Private field "$1.$2" is assigned but never used'#000+ '05031_N_Private method "$1.$2" never used'#000+ '05032_E_Set type expected'#000+ '05033_W_Function result does not seem to be set'#000+ - '05034_W_Type "$1" is not aligned correctly in current record for C'#000+ - '05035_E_Unknown record ','field identifier "$1"'#000+ + '05034_W_Type "$1" is not aligned correctly in cu','rrent record for C'#000+ + '05035_E_Unknown record field identifier "$1"'#000+ '05036_W_Local variable "$1" does not seem to be initialized'#000+ '05037_W_Variable "$1" does not seem to be initialized'#000+ '05038_E_identifier idents no member "$1"'#000+ - '05039_H_Found declaration: $1'#000+ + '05039_H_Found declara','tion: $1'#000+ '05040_E_Data element too large'#000+ - '05','042_E_No matching implementation for interface method "$1" found'#000+ + '05042_E_No matching implementation for interface method "$1" found'#000+ '05043_W_Symbol "$1" is deprecated'#000+ '05044_W_Symbol "$1" is not portable'#000+ '05055_W_Symbol "$1" is not implemented'#000+ - '05056_E_Can'#039't create unique type from this type'#000+ - '06009_E_Parameter ','list size exceeds 65535 bytes'#000+ + '05056_E_Can'#039't create uni','que type from this type'#000+ + '06009_E_Parameter list size exceeds 65535 bytes'#000+ '06012_E_File types must be var parameters'#000+ '06013_E_The use of a far pointer isn'#039't allowed there'#000+ '06015_E_EXPORT declared functions can'#039't be called'#000+ - '06016_W_Possible illegal call of constructor or destructor'#000+ - '06017_','N_Inefficient code'#000+ + '06016_W_Possible illega','l call of constructor or destructor'#000+ + '06017_N_Inefficient code'#000+ '06018_W_unreachable code'#000+ '06020_E_Abstract methods can'#039't be called directly'#000+ '06027_DL_Register $1 weight $2 $3'#000+ '06029_DL_Stack frame is omitted'#000+ - '06031_E_Object or class methods can'#039't be inline.'#000+ - '06032_E_Procvar calls cannot be',' inline.'#000+ + '06031_E_Object or class methods can'#039't ','be inline.'#000+ + '06032_E_Procvar calls cannot be inline.'#000+ '06033_E_No code for inline procedure stored'#000+ '06035_E_Element zero of an ansi/wide- or longstring can'#039't be acces'+ 'sed, use (set)length instead'#000+ - '06037_E_Constructors or destructors can not be called inside a '#039'wi'+ - 'th'#039' clause'#000+ - '06038_E_Cannot ','call message handler methods directly'#000+ + '06037_E_Constructors or destructors can not be cal','led inside a '#039'w'+ + 'ith'#039' clause'#000+ + '06038_E_Cannot call message handler methods directly'#000+ '06039_E_Jump in or outside of an exception block'#000+ '06040_E_Control flow statements aren'#039't allowed in a finally block'#000+ - '06041_W_Parameters size exceeds limit for certain cpu'#039's'#000+ - '06042_W_Local variable size exc','eed limit for certain cpu'#039's'#000+ + '06041_W_Parameters size exceeds limit for cer','tain cpu'#039's'#000+ + '06042_W_Local variable size exceed limit for certain cpu'#039's'#000+ '06043_E_Local variables size exceeds supported limit'#000+ '06044_E_BREAK not allowed'#000+ '06045_E_CONTINUE not allowed'#000+ '07000_DL_Starting $1 styled assembler parsing'#000+ - '07001_DL_Finished $1 styled assembler parsing'#000+ - '07002_E_Non-','label pattern contains @'#000+ + '07001_DL_Finishe','d $1 styled assembler parsing'#000+ + '07002_E_Non-label pattern contains @'#000+ '07004_E_Error building record offset'#000+ '07005_E_OFFSET used without identifier'#000+ '07006_E_TYPE used without identifier'#000+ '07007_E_Cannot use local variable or parameters here'#000+ - '07008_E_need to use OFFSET here'#000+ - '07009_E_need to u','se $ here'#000+ + '07008_E','_need to use OFFSET here'#000+ + '07009_E_need to use $ here'#000+ '07010_E_Cannot use multiple relocatable symbols'#000+ '07011_E_Relocatable symbol can only be added'#000+ '07012_E_Invalid constant expression'#000+ '07013_E_Relocatable symbol is not allowed'#000+ - '07014_E_Invalid reference syntax'#000+ - '07015_E_You can not reach ','$1 from that code'#000+ + '07014_E_Invalid r','eference syntax'#000+ + '07015_E_You can not reach $1 from that code'#000+ '07016_E_Local symbols/labels aren'#039't allowed as references'#000+ '07017_E_Invalid base and index register usage'#000+ '07018_W_Possible error in object field handling'#000+ - '07019_E_Wrong scale factor specified'#000+ - '07020_E_Multiple index register u','sage'#000+ + '07019_E_Wrong scale factor s','pecified'#000+ + '07020_E_Multiple index register usage'#000+ '07021_E_Invalid operand type'#000+ '07022_E_Invalid string as opcode operand: $1'#000+ '07023_W_@CODE and @DATA not supported'#000+ '07024_E_Null label references are not allowed'#000+ - '07025_E_Divide by zero in asm evaluator'#000+ + '07025_E_Divide by zero in asm evalu','ator'#000+ '07026_E_Illegal expression'#000+ - '07027_E_es','cape sequence ignored: $1'#000+ + '07027_E_escape sequence ignored: $1'#000+ '07028_E_Invalid symbol reference'#000+ '07029_W_Fwait can cause emulation problems with emu387'#000+ '07030_W_$1 without operand translated into $1P'#000+ - '07031_W_ENTER instruction is not supported by Linux kernel'#000+ - '07032_W_Calling an o','verload function in assembler'#000+ + '07031_W_ENTER instruction is not supp','orted by Linux kernel'#000+ + '07032_W_Calling an overload function in assembler'#000+ '07033_E_Unsupported symbol type for operand'#000+ '07034_E_Constant value out of bounds'#000+ '07035_E_Error converting decimal $1'#000+ '07036_E_Error converting octal $1'#000+ - '07037_E_Error converting binary $1'#000+ - '07038_E_Error converting',' hexadecimal $1'#000+ + '07037_E_Error con','verting binary $1'#000+ + '07038_E_Error converting hexadecimal $1'#000+ '07039_H_$1 translated to $2'#000+ '07040_W_$1 is associated to an overloaded function'#000+ '07041_E_Cannot use SELF outside a method'#000+ '07042_E_Cannot use OLDEBP outside a nested procedure'#000+ - '07043_W_Procedures can'#039't return any value in asm co','de'#000+ + '07043_W_P','rocedures can'#039't return any value in asm code'#000+ '07044_E_SEG not supported'#000+ '07045_E_Size suffix and destination or source size do not match'#000+ '07046_W_Size suffix and destination or source size do not match'#000+ '07047_E_Assembler syntax error'#000+ - '07048_E_Invalid combination of opcode and operands'#000+ - '0','7049_E_Assembler syntax error in operand'#000+ + '07048_E_In','valid combination of opcode and operands'#000+ + '07049_E_Assembler syntax error in operand'#000+ '07050_E_Assembler syntax error in constant'#000+ '07051_E_Invalid String expression'#000+ '07052_W_constant with symbol $1 for address which is not on a pointer'#000+ - '07053_E_Unrecognized opcode $1'#000+ - '07054_E_Invalid or mi','ssing opcode'#000+ + '07053_E_Un','recognized opcode $1'#000+ + '07054_E_Invalid or missing opcode'#000+ '07055_E_Invalid combination of prefix and opcode: $1'#000+ '07056_E_Invalid combination of override and opcode: $1'#000+ '07057_E_Too many operands on line'#000+ '07058_W_NEAR ignored'#000+ '07059_W_FAR ignored'#000+ - '07060_E_Duplicate local symbol $1'#000+ - '07061_E_Un','defined local symbol $1'#000+ + '07','060_E_Duplicate local symbol $1'#000+ + '07061_E_Undefined local symbol $1'#000+ '07062_E_Unknown label identifier $1'#000+ '07063_E_Invalid register name'#000+ '07064_E_Invalid floating point register name'#000+ '07066_W_Modulo not supported'#000+ - '07067_E_Invalid floating point constant $1'#000+ - '07068_E_Invalid floating point ex','pression'#000+ + '07067_E_Invalid floating point con','stant $1'#000+ + '07068_E_Invalid floating point expression'#000+ '07069_E_Wrong symbol type'#000+ '07070_E_Cannot index a local var or parameter with a register'#000+ '07071_E_Invalid segment override expression'#000+ '07072_W_Identifier $1 supposed external'#000+ - '07073_E_Strings not allowed as constants'#000+ - '07074_No type of v','ariable specified'#000+ + '07073_E_Strings n','ot allowed as constants'#000+ + '07074_No type of variable specified'#000+ '07075_E_assembler code not returned to text section'#000+ '07076_E_Not a directive or local symbol $1'#000+ '07077_E_Using a defined name as a local label'#000+ - '07078_E_Dollar token is used without an identifier'#000+ - '07079_W_32bit constant created',' for address'#000+ + '07078_E_Dollar token is used without an',' identifier'#000+ + '07079_W_32bit constant created for address'#000+ '07080_N_.align is target specific, use .balign or .p2align'#000+ '07081_E_Can'#039't access fields directly for parameters'#000+ '07082_E_Can'#039't access fields of objects/classes directly'#000+ - '07083_E_No size specified and unable to determine the size o','f the op'+ + '07083_E_No size sp','ecified and unable to determine the size of the op'+ 'erands'#000+ '07084_E_Cannot use RESULT in this function'#000+ '07086_W_"$1" without operand translated into "$1 %st,%st(1)"'#000+ '07087_W_"$1 %st(n)" translated into "$1 %st,%st(n)"'#000+ - '07088_W_"$1 %st(n)" translated into "$1 %st(n),%st"'#000+ - '07089_E_Char < no','t allowed here'#000+ + '07088_W_"$1 %st(n)" transla','ted into "$1 %st(n),%st"'#000+ + '07089_E_Char < not allowed here'#000+ '07090_E_Char > not allowed here'#000+ '07093_W_ALIGN not supported'#000+ '07094_E_Inc and Dec cannot be together'#000+ '07095_E_Invalid reglist for movem'#000+ '07096_E_Reglist invalid for opcode'#000+ - '07097_E_Higher cpu mode required ($1)'#000+ - '07098_W_No size spe','cified and unable to determine the size of the op'+ - 'erands, using DWORD as default'#000+ + '07097_E_Higher ','cpu mode required ($1)'#000+ + '07098_W_No size specified and unable to determine the size of the oper'+ + 'ands, using DWORD as default'#000+ '07099_E_Syntax error while trying to parse a shifter operand'#000+ '08000_F_Too many assembler files'#000+ - '08001_F_Selected assembler output not supported'#000+ - '08002_F_Comp not s','upported'#000+ + '08001_F_Selected assembl','er output not supported'#000+ + '08002_F_Comp not supported'#000+ '08003_F_Direct not support for binary writers'#000+ '08004_E_Allocating of data is only allowed in bss section'#000+ '08005_F_No binary writer selected'#000+ '08006_E_Asm: Opcode $1 not in table'#000+ - '08007_E_Asm: $1 invalid combination of opcode and operand','s'#000+ + '08007_E_Asm: $1',' invalid combination of opcode and operands'#000+ '08008_E_Asm: 16 Bit references not supported'#000+ '08009_E_Asm: Invalid effective address'#000+ '08010_E_Asm: Immediate or reference expected'#000+ '08011_E_Asm: $1 value exceeds bounds $2'#000+ - '08012_E_Asm: Short jump is out of range $1'#000+ - '08013_E_Asm: Undefined lab','el $1'#000+ + '08012_E_Asm: Short jump is ','out of range $1'#000+ + '08013_E_Asm: Undefined label $1'#000+ '08014_E_Asm: Comp type not supported for this target'#000+ '08015_E_Asm: Extended type not supported for this target'#000+ '08016_E_Asm: Duplicate label $1'#000+ '08017_E_Asm: Redefined label $1'#000+ - '08018_E_Asm: First defined here'#000+ - '08019_E_Asm: Invalid registe','r $1'#000+ + '08018_E_Asm: First',' defined here'#000+ + '08019_E_Asm: Invalid register $1'#000+ '09000_W_Source operating system redefined'#000+ '09001_I_Assembling (pipe) $1'#000+ '09002_E_Can'#039't create assember file: $1'#000+ '09003_E_Can'#039't create object file: $1'#000+ '09004_E_Can'#039't create archive file: $1'#000+ - '09005_E_Assembler $1 not found, switching to exter','nal assembling'#000+ + '09005_E_','Assembler $1 not found, switching to external assembling'#000+ '09006_T_Using assembler: $1'#000+ '09007_E_Error while assembling exitcode $1'#000+ '09008_E_Can'#039't call the assembler, error $1 switching to external a'+ 'ssembling'#000+ '09009_I_Assembling $1'#000+ - '09010_I_Assembling with smartlinking $1'#000+ - '09011_W_Object $','1 not found, Linking may fail !'#000+ + '09010_I_Assemb','ling with smartlinking $1'#000+ + '09011_W_Object $1 not found, Linking may fail !'#000+ '09012_W_Library $1 not found, Linking may fail !'#000+ '09013_E_Error while linking'#000+ '09014_E_Can'#039't call the linker, switching to external linking'#000+ '09015_I_Linking $1'#000+ - '09016_E_Util $1 not found, switching to external li','nking'#000+ + '09016_E_U','til $1 not found, switching to external linking'#000+ '09017_T_Using util $1'#000+ '09018_E_Creation of Executables not supported'#000+ '09019_E_Creation of Dynamic/Shared Libraries not supported'#000+ '09020_I_Closing script $1'#000+ - '09021_E_resource compiler not found, switching to external mode'#000+ - '09022_I_Compiling',' resource $1'#000+ + '09021_E_resource compiler not found, sw','itching to external mode'#000+ + '09022_I_Compiling resource $1'#000+ '09023_T_unit $1 can'#039't be statically linked, switching to smart lin'+ 'king'#000+ '09024_T_unit $1 can'#039't be smart linked, switching to static linking'+ #000+ - '09025_T_unit $1 can'#039't be shared linked, switching to static linkin'+ - 'g'#000+ - '09026_E_unit $1 can'#039't',' be smart or static linked'#000+ + '09025_T_unit $1 can'#039't be shared linked, switchi','ng to static link'+ + 'ing'#000+ + '09026_E_unit $1 can'#039't be smart or static linked'#000+ '09027_E_unit $1 can'#039't be shared or static linked'#000+ '09028_F_Can'#039't post process executable $1'#000+ '09029_F_Can'#039't open executable $1'#000+ '09030_X_Size of Code: $1 bytes'#000+ - '09031_X_Size of initialized data: $1 bytes'#000+ - '09032_X_Size of ','uninitialized data: $1 bytes'#000+ + '09031_X_Size of i','nitialized data: $1 bytes'#000+ + '09032_X_Size of uninitialized data: $1 bytes'#000+ '09033_X_Stack space reserved: $1 bytes'#000+ '09034_X_Stack space commited: $1 bytes'#000+ '10000_T_Unitsearch: $1'#000+ '10001_T_PPU Loading $1'#000+ '10002_U_PPU Name: $1'#000+ '10003_U_PPU Flags: $1'#000+ - '10004_U_PPU Crc: $1'#000+ + '10','004_U_PPU Crc: $1'#000+ '10005_U_PPU Time: $1'#000+ - '100','06_U_PPU File too short'#000+ + '10006_U_PPU File too short'#000+ '10007_U_PPU Invalid Header (no PPU at the begin)'#000+ '10008_U_PPU Invalid Version $1'#000+ '10009_U_PPU is compiled for another processor'#000+ '10010_U_PPU is compiled for an other target'#000+ - '10011_U_PPU Source: $1'#000+ + '1001','1_U_PPU Source: $1'#000+ '10012_U_Writing $1'#000+ - '1001','3_F_Can'#039't Write PPU-File'#000+ + '10013_F_Can'#039't Write PPU-File'#000+ '10014_F_Error reading PPU-File'#000+ '10015_F_unexpected end of PPU-File'#000+ '10016_F_Invalid PPU-File entry: $1'#000+ '10017_F_PPU Dbx count problem'#000+ '10018_E_Illegal unit name: $1'#000+ - '10019_F_Too much units'#000+ - '10020_F_Circular unit reference',' between $1 and $2'#000+ + '10019_F_Too ','much units'#000+ + '10020_F_Circular unit reference between $1 and $2'#000+ '10021_F_Can'#039't compile unit $1, no sources available'#000+ '10022_F_Can'#039't find unit $1'#000+ '10023_W_Unit $1 was not found but $2 exists'#000+ '10024_F_Unit $1 searched but $2 found'#000+ - '10025_W_Compiling the system unit requires the -Us switch'#000+ - '10','026_F_There were $1 errors compiling module, stopping'#000+ + '10025_W_Compiling ','the system unit requires the -Us switch'#000+ + '10026_F_There were $1 errors compiling module, stopping'#000+ '10027_U_Load from $1 ($2) unit $3'#000+ '10028_U_Recompiling $1, checksum changed for $2'#000+ '10029_U_Recompiling $1, source found only'#000+ - '10030_U_Recompiling unit, static lib is older than ppufile'#000+ - '100','31_U_Recompiling unit, shared lib is older than ppufile'#000+ + '10030_U_Recompiling ','unit, static lib is older than ppufile'#000+ + '10031_U_Recompiling unit, shared lib is older than ppufile'#000+ '10032_U_Recompiling unit, obj and asm are older than ppufile'#000+ '10033_U_Recompiling unit, obj is older than asm'#000+ '10034_U_Parsing interface of $1'#000+ - '10035_U_Parsing implementation of $1'#000+ - '10036_','U_Second load for unit $1'#000+ + '1','0035_U_Parsing implementation of $1'#000+ + '10036_U_Second load for unit $1'#000+ '10037_U_PPU Check file $1 time $2'#000+ '10038_H_Conditional $1 was not set at startup in last compilation of $'+ '2'#000+ - '10039_H_Conditional $1 was set at startup in last compilation of $2'#000+ - '10040_W_Can'#039't recompile unit $1, but fou','nd modifed include files'+ - #000+ + '10039_H_Conditional $1 was set at startup in last compilation of $','2'#000+ + '10040_W_Can'#039't recompile unit $1, but found modifed include files'#000+ '10041_H_File $1 is newer than Release PPU file $2'#000+ '10042_U_Using a unit which was not compiled with correct FPU mode'#000+ '10043_U_Loading interface units from $1'#000+ - '10044_U_Loading implementation units from $1'#000+ - '10045_U_Interf','ace CRC changed for unit $1'#000+ + '10044_U_Loading i','mplementation units from $1'#000+ + '10045_U_Interface CRC changed for unit $1'#000+ '10046_U_Implementation CRC changed for unit $1'#000+ '10047_U_Finished compiling unit $1'#000+ '10048_U_Add dependency of $1 to $2'#000+ '10049_U_No reload, is caller: $1'#000+ - '10050_U_No reload, already in second compile: $1'#000+ - '10051_U_Flag ','for reload: $1'#000+ + '10050_U_No reload, a','lready in second compile: $1'#000+ + '10051_U_Flag for reload: $1'#000+ '10052_U_Forced reloading'#000+ '10053_U_Previous state of $1: $2'#000+ '10054_U_Already compiling $1, setting second compile'#000+ '10055_U_Loading unit $1'#000+ '10056_U_Finished loading unit $1'#000+ - '10057_U_Registering new unit $1'#000+ - '10058_U_Re-resolving unit',' $1'#000+ + '10057_U_Registe','ring new unit $1'#000+ + '10058_U_Re-resolving unit $1'#000+ '10059_U_Skipping re-resolving unit $1, still loading used units'#000+ '11000_$1 [options] [options]'#000+ '11001_W_Only one source file supported'#000+ '11002_W_DEF file can be created only for OS/2'#000+ - '11003_E_nested response files are not supporte','d'#000+ + '1100','3_E_nested response files are not supported'#000+ '11004_F_No source file name in command line'#000+ '11005_N_No option inside $1 config file'#000+ '11006_E_Illegal parameter: $1'#000+ '11007_H_-? writes help pages'#000+ '11008_F_Too many config files nested'#000+ - '11009_F_Unable to open file $1'#000+ - '11010_D_Reading further opt','ions from $1'#000+ + '11009_F_Unable t','o open file $1'#000+ + '11010_D_Reading further options from $1'#000+ '11011_W_Target is already set to: $1'#000+ '11012_W_Shared libs not supported on DOS platform, reverting to static'+ #000+ '11013_F_too many IF(N)DEFs'#000+ '11014_F_too many ENDIFs'#000+ - '11015_F_open conditional at the end of the file'#000+ - '11016_W_Debug inform','ation generation is not supported by this execut'+ - 'able'#000+ + '11015_F_open conditional a','t the end of the file'#000+ + '11016_W_Debug information generation is not supported by this executab'+ + 'le'#000+ '11017_H_Try recompiling with -dGDB'#000+ '11018_E_You are using the obsolete switch $1'#000+ '11019_E_You are using the obsolete switch $1, please use $2'#000+ - '11020_N_Switching assembler to default source w','riting assembler'#000+ + '11020','_N_Switching assembler to default source writing assembler'#000+ '11021_W_Assembler output selected "$1" is not compatible with "$2"'#000+ '11022_W_"$1" assembler use forced'#000+ '11026_T_Reading options from file $1'#000+ - '11027_T_Reading options from environment $1'#000+ + '11027_T_Reading options from environment $1',#000+ '11028_D_Handling option "$1"'#000+ - '11029__*** p','ress enter ***'#000+ + '11029__*** press enter ***'#000+ '11030_H_Start of reading config file $1'#000+ '11031_H_End of reading config file $1'#000+ '11032_D_interpreting option "$1"'#000+ '11036_D_interpreting firstpass option "$1"'#000+ - '11033_D_interpreting file option "$1"'#000+ - '11034_D_Reading config file "$1"'#000, + '11033_D_interpreting file opt','ion "$1"'#000+ + '11034_D_Reading config file "$1"'#000+ '11035_D_found source file name "$1"'#000+ - '11037_D_Defining symbol $1'#000+ - '11038_D_Undefining symbol $1'#000+ '11039_E_Unknown code page'#000+ '11023_Free Pascal Compiler version $FPCVERSION [$FPCDATE] for $FPCCPU'#010+ 'Copyright (c) 1993-2005 by Florian Klaempfl'#000+ - '11024_Fr','ee Pascal Compiler version $FPCVERSION'#010+ + '11024_Free Pascal Comp','iler version $FPCVERSION'#010+ #010+ 'Compiler Date : $FPCDATE'#010+ 'Compiler CPU Target: $FPCCPU'#010+ @@ -712,58 +711,58 @@ const msgtxt : array[0..000158,1..240] of char=( 'This program comes under the GNU General Public Licence'#010+ 'For more information read COPYING.FPC'#010+ #010+ - 'Report bugs,','suggestions etc to:'#010+ + 'Report bugs,suggestions et','c to:'#010+ ' bugrep@freepascal.org'#000+ '11025_**0*_put + after a boolean switch option to enable it, - to disa'+ 'ble it'#010+ '**1a_the compiler doesn'#039't delete the generated assembler file'#010+ - '**2al_list sourcecode lines in assembler f','ile'#010+ - '**2an_list node info in assembler file'#010+ + '**2al_list sourcecode lines in assembler file'#010+ + '**2an_list',' node info in assembler file'#010+ '*L2ap_use pipes instead of creating temporary assembler files'#010+ '**2ar_list register allocation/release info in assembler file'#010+ '**2at_list temp allocation/release info in assembler file'#010+ - '**1A_output ','format:'#010+ - '**2Adefault_use default assembler'#010+ + '**1A_output format:'#010+ + '**2Ade','fault_use default assembler'#010+ '3*2Aas_assemble using GNU AS'#010+ '3*2Anasmcoff_coff (Go32v2) file using Nasm'#010+ '3*2Anasmelf_elf32 (Linux) file using Nasm'#010+ '3*2Anasmwin32_Win32 object file using Nasm'#010+ - '3*2Anasmwdosx_Win32/WDOSX object file usi','ng Nasm'#010+ - '3*2Awasm_obj file using Wasm (Watcom)'#010+ + '3*2Anasmwdosx_Win32/WDOSX object file using Nasm'#010+ + '3*2Awa','sm_obj file using Wasm (Watcom)'#010+ '3*2Anasmobj_obj file using Nasm'#010+ '3*2Amasm_obj file using Masm (Microsoft)'#010+ '3*2Atasm_obj file using Tasm (Borland)'#010+ '3*2Aelf_elf32 (Linux) using internal writer'#010+ - '3*2Acoff_coff (Go32v2) using internal ','writer'#010+ - '3*2Apecoff_pecoff (Win32) using internal writer'#010+ + '3*2Acoff_coff (Go32v2) using internal writer'#010+ + '3*2Apec','off_pecoff (Win32) using internal writer'#010+ '4*2Aas_assemble using GNU AS'#010+ '6*2Aas_Unix o-file using GNU AS'#010+ '6*2Agas_GNU Motorola assembler'#010+ '6*2Amit_MIT Syntax (old GAS)'#010+ '6*2Amot_Standard Motorola assembler'#010+ - 'A*2Aas_assemble using GNU AS',#010+ - 'P*2Aas_assemble using GNU AS'#010+ + 'A*2Aas_assemble using GNU AS'#010+ + 'P*2Aas_assemb','le using GNU AS'#010+ 'S*2Aas_assemble using GNU AS'#010+ '**1b_generate browser info'#010+ '**2bl_generate local symbol info'#010+ '**1B_build all modules'#010+ '**1C_code generation options:'#010+ '**2Cc_set default calling convention to '#010+ - '**2CD_create also ','dynamic library (not supported)'#010+ + '**2CD_create also dynamic librar','y (not supported)'#010+ '**2Ce_Compilation with emulated floating point opcodes'#010+ '**2Cf_Select fpu instruction set to use to '#010+ '**2Cg_Generate PIC code'#010+ '**2Ch_ bytes heap (between 1023 and 67107840)'#010+ '**2Ci_IO-checking'#010+ - '**2Cn_omi','t linking stage'#010+ + '**2Cn_omit linking stag','e'#010+ '**2Co_check overflow of integer operations'#010+ '**2Cr_range checking'#010+ '**2CR_verify object method call validity'#010+ '**2Cs_set stack size to '#010+ '**2Ct_stack checking'#010+ '**2CX_create also smartlinked library'#010+ - '**1d_defines the symbol '#010+ - '**1D_generate a DEF file'#010+ + '**1d_defines the symbol '#010+ + '**1D_generat','e a DEF file'#010+ '**2Dd_set description to '#010+ '**2Dv_set DLL version to '#010+ '*O2Dw_PM application'#010+ @@ -771,27 +770,27 @@ const msgtxt : array[0..000158,1..240] of char=( '**1E_same as -Cn'#010+ '**1F_set file names and paths:'#010+ '**2Fc_sets input codepage to '#010+ - '**2FD_s','ets the directory where to search for compiler utilities'#010+ + '**2FD_sets the direct','ory where to search for compiler utilities'#010+ '**2Fe_redirect error output to '#010+ '**2FE_set exe/unit output path to '#010+ '**2Fi_adds to include path'#010+ '**2Fl_adds to library path'#010+ - '**2FL_uses as dynamic linker'#010, - '**2Fo_adds to object path'#010+ + '**2FL_uses as dynamic linker'#010+ + '**2Fo_adds ',' to object path'#010+ '**2Fr_load error message file '#010+ '**2Fu_adds to unit path'#010+ '**2FU_set unit output path to , overrides -FE'#010+ '*g1g_generate debugger information:'#010+ '*g2gc_generate checks for pointers'#010+ '*g2gd_use dbx'#010+ - '*g','2gg_use gsym'#010+ - '*g2gh_use heap trace unit (for memory leak debugging)'#010+ + '*g2gg_use gsym'#010+ + '*','g2gh_use heap trace unit (for memory leak debugging)'#010+ '*g2gl_use line info unit to show more info for backtraces'#010+ '*g2gv_generates programs tracable with valgrind'#010+ '*g2gw_generate dwarf debugging info'#010+ '**1i_information'#010+ - '**2iD_return c','ompiler date'#010+ - '**2iV_return compiler version'#010+ + '**2iD_return compiler date'#010+ + '*','*2iV_return compiler version'#010+ '**2iSO_return compiler OS'#010+ '**2iSP_return compiler processor'#010+ '**2iTO_return target OS'#010+ @@ -799,61 +798,61 @@ const msgtxt : array[0..000158,1..240] of char=( '**1I_adds to include path'#010+ '**1k_Pass to the linker'#010+ '**1l_write logo'#010+ - '**1','M_set language mode to '#010+ + '**1M_set langu','age mode to '#010+ '**2Mfpc_free pascal dialect (default)'#010+ '**2Mobjfpc_switch some Delphi 2 extensions on'#010+ '**2Mdelphi_tries to be Delphi compatible'#010+ '**2Mtp_tries to be TP/BP 7.0 compatible'#010+ '**2Mgpc_tries to be gpc compatible'#010+ - '**2Mmacpas','_tries to be compatible to the macintosh pascal dialects'#010+ + '**2Mmacpas_tries to be c','ompatible to the macintosh pascal dialects'#010+ '**1n_don'#039't read the default config file'#010+ '**1o_change the name of the executable produced to '#010+ '**1O_optimizations:'#010+ '3*2Og_generate smaller code'#010+ - '3*2OG_generate faster code (defaul','t)'#010+ - '**2Or_keep certain variables in registers'#010+ + '3*2OG_generate faster code (default)'#010+ + '**2Or_keep ','certain variables in registers'#010+ '3*2Ou_enable uncertain optimizations (see docs)'#010+ '3*2O1_level 1 optimizations (quick optimizations)'#010+ '3*2O2_level 2 optimizations (-O1 + slower optimizations)'#010+ - '3*2O3_level 3 optimizations (-O2 repeate','dly, max 5 times)'#010+ + '3*2O3_level 3 optimizations (-O2 repeatedly, max 5 tim','es)'#010+ '3*2Op_target processor:'#010+ '3*3Op1_set target processor to 386/486'#010+ '3*3Op2_set target processor to Pentium/PentiumMMX (tm)'#010+ '3*3Op3_set target processor to PPro/PII/c6x86/K6 (tm)'#010+ '6*2Og_generate smaller code'#010+ - '6*2OG_generate fast','er code (default)'#010+ + '6*2OG_generate faster code (defau','lt)'#010+ '6*2Ox_optimize maximum (still BUGGY!!!)'#010+ '6*2O0_set target processor to a MC68000'#010+ '6*2O2_set target processor to a MC68020+ (default)'#010+ '**1pg_generate profile code for gprof (defines FPC_PROFILE)'#010+ - '**1R_assembler reading style',':'#010+ - '**2Rdefault_use default assembler'#010+ + '**1R_assembler reading style:'#010+ + '**2Rdefault_','use default assembler'#010+ '3*2Ratt_read AT&T style assembler'#010+ '3*2Rintel_read Intel style assembler'#010+ '6*2RMOT_read motorola style assembler'#010+ '**1S_syntax options:'#010+ '**2S2_same as -Mobjfpc'#010+ - '**2Sc_supports operators like C (*=,+=,/= and -=',')'#010+ - '**2Sa_include assertion code.'#010+ + '**2Sc_supports operators like C (*=,+=,/= and -=)'#010+ + '**2Sa_includ','e assertion code.'#010+ '**2Sd_same as -Mdelphi'#010+ '**2Se_compiler stops after the errors (default is 1)'#010+ '**2Sg_allow LABEL and GOTO'#010+ '**2Sh_Use ansistrings'#010+ '**2Si_support C++ styled INLINE'#010+ '**2SI_set interface style to '#010+ - '**3SIcom','_COM compatible interface (default)'#010+ + '**3SIcom_COM compatibl','e interface (default)'#010+ '**3SIcorba_CORBA compatible interface'#010+ '**2Sm_support macros like C (global)'#010+ '**2So_same as -Mtp'#010+ '**2Sp_same as -Mgpc'#010+ '**2Ss_constructor name must be init (destructor must be done)'#010+ - '**2St_allow static keyword i','n objects'#010+ - '**1s_don'#039't call assembler and linker'#010+ + '**2St_allow static keyword in objects'#010+ + '**1s','_don'#039't call assembler and linker'#010+ '**2sh_Generate script to link on host'#010+ '**2st_Generate script to link on target'#010+ '**2sr_Skip register allocation phase (use with -alr)'#010+ '**1T_Target operating system:'#010+ - '3*2Temx_OS/2 via EMX (includi','ng EMX/RSX extender)'#010+ + '3*2Temx_OS/2 via EMX (including EMX/RSX ext','ender)'#010+ '3*2Tfreebsd_FreeBSD'#010+ '3*2Tgo32v2_Version 2 of DJ Delorie DOS extender'#010+ '3*2Tlinux_Linux'#010+ @@ -861,8 +860,8 @@ const msgtxt : array[0..000158,1..240] of char=( '3*2Tnetware_Novell Netware Module (clib)'#010+ '3*2Tnetwlibc_Novell Netware Module (libc)'#010+ '3*2Topenbsd_OpenBSD'#010+ - '3*2Tos2_OS/2 /',' eComStation'#010+ - '3*2Tsunos_SunOS/Solaris'#010+ + '3*2Tos2_OS/2 / eComStation'#010+ + '3','*2Tsunos_SunOS/Solaris'#010+ '3*2Twatcom_Watcom compatible DOS extender'#010+ '3*2Twdosx_WDOSX DOS extender'#010+ '3*2Twin32_Windows 32 Bit'#010+ @@ -870,7 +869,7 @@ const msgtxt : array[0..000158,1..240] of char=( '6*2Tamiga_Commodore Amiga'#010+ '6*2Tatari_Atari ST/STe/TT'#010+ '6*2Tlinux_Linux-68k'#010+ - '6*2Tmacos_Macintosh',' m68k (not supported)'#010+ + '6*2Tmacos_Macintosh m68k (not sup','ported)'#010+ '6*2Tpalmos_PalmOS'#010+ 'A*2Tlinux_Linux'#010+ 'P*2Tdarwin_Darwin and MacOS X on PowerPC'#010+ @@ -879,46 +878,46 @@ const msgtxt : array[0..000158,1..240] of char=( 'P*2Tmorphos_MorphOS'#010+ 'S*2Tlinux_Linux'#010+ '**1u_undefines the symbol '#010+ - '**1U_unit ','options:'#010+ - '**2Un_don'#039't check the unit name'#010+ + '**1U_unit options:'#010+ + '**2Un','_don'#039't check the unit name'#010+ '**2Ur_generate release unit files'#010+ '**2Us_compile a system unit'#010+ '**1v_Be verbose. is a combination of the following letters:'#010+ '**2*_e : Show errors (default) d : Show debug info'#010+ - '**2*_w : Show',' warnings u : Show unit info'#010+ + '**2*_w : Show warnings ',' u : Show unit info'#010+ '**2*_n : Show notes t : Show tried/used files'#010+ '**2*_h : Show hints m : Show defined macros'#010+ '**2*_i : Show general info p : Show compiled procedures'#010+ - '**2*_l ',': Show linenumbers c : Show conditionals'#010+ + '**2*_l : Show linenum','bers c : Show conditionals'#010+ '**2*_a : Show everything 0 : Show nothing (except errors)'#010+ '**2*_b : Show all procedure r : Rhide/GCC compatibility mode'#010+ - '**2*_ declarations if an error x : Executa','ble info (Win32 only'+ + '**2*_ declarations if an error x : Executable info (Win3','2 only'+ ')'#010+ '**2*_ occurs'#010+ '**1V_write fpcdebug.txt file with lots of debugging info'#010+ '3*1W_Win32-like target options'#010+ '3*2WB_Set Image base to Hexadecimal value'#010+ '3*2WC_Specify console type application'#010+ - '3*2WD_Use DEFFILE to ex','port functions of DLL or EXE'#010+ + '3*2WD_Use DEFFILE to export functions',' of DLL or EXE'#010+ '3*2WF_Specify full-screen type application (OS/2 only)'#010+ '3*2WG_Specify graphic type application'#010+ '3*2WN_Do not generate relocation code (necessary for debugging)'#010+ '3*2WR_Generate relocation code'#010+ - 'P*2WC_Specify console ','type application (MacOS only)'#010+ + 'P*2WC_Specify console type applicati','on (MacOS only)'#010+ 'P*2WG_Specify graphic type application (MacOS only)'#010+ 'P*2WT_Specify tool type application (MPW tool, MacOS only)'#010+ '**1X_executable options:'#010+ '**2Xc_link with the c library'#010+ - '**2Xd_don'#039't use standard library search path',' (needed for cross c'+ + '**2Xd_don'#039't use standard library search path (needed for c','ross c'+ 'ompile)'#010+ '**2XD_try to link units dynamic (defines FPC_LINK_DYNAMIC)'#010+ '**2XP_prepend the binutils names with the prefix '#010+ '**2Xr_set library search path to (needed for cross compile)'#010+ - '**2Xs_strip all symbo','ls from executable'#010+ + '**2Xs_strip all symbols from execut','able'#010+ '**2XS_try to link units static (default) (defines FPC_LINK_STATIC)'#010+ '**2Xt_link with static libraries (-static is passed to linker)'#010+ '**2XX_try to link units smart (defines FPC_LINK_SMART)'#010+ '**1*_'#010+ - '**1?_shows this hel','p'#010+ - '**1h_shows this help without waiting'#000 + '**1?_shows this help'#010+ + '**1h_shows t','his help without waiting'#000 ); diff --git a/compiler/options.pas b/compiler/options.pas index c4305739c4..dbb8ef2732 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -33,7 +33,7 @@ type TOption=class FirstPass, NoPressEnter, - DoWriteLogo : boolean; + LogoWritten : boolean; FileLevel : longint; QuickInfo : string; ParaIncludePath, @@ -76,7 +76,8 @@ uses dos, {$ENDIF USE_SYSUTILS} version, - cutils,cmsgs + cutils,cmsgs, + symtable {$ifdef BrowserLog} ,browlog {$endif BrowserLog} @@ -100,47 +101,23 @@ var Defines ****************************************************************************} -procedure def_symbol(const s : string); -begin - if s='' then - exit; - initdefines.insert(upper(s)); - Message1(option_defining_symbol,s); -end; - - -procedure undef_symbol(const s : string); -begin - if s='' then - exit; - InitDefines.Remove(s); - Message1(option_undefining_symbol,s); -end; - - -function check_symbol(const s:string):boolean; -begin - check_symbol:=(initdefines.find(s)<>nil); -end; - - procedure set_default_link_type; begin { win32 and wdosx need smartlinking by default to prevent including too much dll dependencies } if (target_info.system in [system_i386_win32,system_i386_wdosx]) then begin - def_symbol('FPC_LINK_SMART'); - undef_symbol('FPC_LINK_STATIC'); - undef_symbol('FPC_LINK_DYNAMIC'); + def_system_macro('FPC_LINK_SMART'); + undef_system_macro('FPC_LINK_STATIC'); + undef_system_macro('FPC_LINK_DYNAMIC'); initglobalswitches:=initglobalswitches+[cs_link_smart]; initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_static]; end else begin - undef_symbol('FPC_LINK_SMART'); - def_symbol('FPC_LINK_STATIC'); - undef_symbol('FPC_LINK_DYNAMIC'); + undef_system_macro('FPC_LINK_SMART'); + def_system_macro('FPC_LINK_STATIC'); + undef_system_macro('FPC_LINK_DYNAMIC'); initglobalswitches:=initglobalswitches+[cs_link_static]; initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_smart]; end; @@ -168,9 +145,13 @@ procedure Toption.WriteLogo; var p : pchar; begin - p:=MessagePchar(option_logo); - while assigned(p) do - Comment(V_Normal,GetMsgLine(p)); + if not LogoWritten then + begin + p:=MessagePchar(option_logo); + while assigned(p) do + Comment(V_Normal,GetMsgLine(p)); + LogoWritten:= true; + end; end; @@ -384,9 +365,9 @@ begin if opt='' then exit; - { only parse define,undef,target,verbosity and link options the firsttime } + { only parse define,undef,target,verbosity,link etc options the firsttime } if firstpass and - not((opt[1]='-') and (opt[2] in ['i','d','v','T','u','n','X'])) then + not((opt[1]='-') and (opt[2] in ['i','d','v','T','u','n','X','l'])) then exit; Message1(option_handling_option,opt); @@ -587,7 +568,8 @@ begin end; 'd' : - def_symbol(more); + if more <> '' then + def_system_macro(more); 'D' : begin @@ -834,7 +816,8 @@ begin end; 'l' : - DoWriteLogo:=not UnSetBool(more,0); + if not UnSetBool(more,0) then + WriteLogo; 'm' : parapreprocess:=not UnSetBool(more,0); @@ -874,7 +857,7 @@ begin if UnsetBool(More, 0) then begin initmoduleswitches:=initmoduleswitches-[cs_profile]; - undef_symbol('FPC_PROFILE'); + undef_system_macro('FPC_PROFILE'); end else if Length(More)=0 then @@ -884,12 +867,12 @@ begin 'g' : if UnsetBool(more, 1) then begin exclude(initmoduleswitches,cs_profile); - undef_symbol('FPC_PROFILE'); + undef_system_macro('FPC_PROFILE'); end else begin include(initmoduleswitches,cs_profile); - def_symbol('FPC_PROFILE'); + def_system_macro('FPC_PROFILE'); end; else IllegalPara(opt); @@ -1008,8 +991,8 @@ begin end; 'u' : - undef_symbol(upper(More)); - + if more <> '' then + undef_system_macro(more); 'U' : begin j:=1; @@ -1148,9 +1131,9 @@ begin include(initglobalswitches,cs_link_staticflag); 'D' : begin - def_symbol('FPC_LINK_DYNAMIC'); - undef_symbol('FPC_LINK_SMART'); - undef_symbol('FPC_LINK_STATIC'); + def_system_macro('FPC_LINK_DYNAMIC'); + undef_system_macro('FPC_LINK_SMART'); + undef_system_macro('FPC_LINK_STATIC'); exclude(initglobalswitches,cs_link_static); exclude(initglobalswitches,cs_link_smart); include(initglobalswitches,cs_link_shared); @@ -1167,9 +1150,9 @@ begin end; 'S' : begin - def_symbol('FPC_LINK_STATIC'); - undef_symbol('FPC_LINK_SMART'); - undef_symbol('FPC_LINK_DYNAMIC'); + def_system_macro('FPC_LINK_STATIC'); + undef_system_macro('FPC_LINK_SMART'); + undef_system_macro('FPC_LINK_DYNAMIC'); include(initglobalswitches,cs_link_static); exclude(initglobalswitches,cs_link_smart); exclude(initglobalswitches,cs_link_shared); @@ -1177,9 +1160,9 @@ begin end; 'X' : begin - def_symbol('FPC_LINK_SMART'); - undef_symbol('FPC_LINK_STATIC'); - undef_symbol('FPC_LINK_DYNAMIC'); + def_system_macro('FPC_LINK_SMART'); + undef_system_macro('FPC_LINK_STATIC'); + undef_system_macro('FPC_LINK_DYNAMIC'); exclude(initglobalswitches,cs_link_static); include(initglobalswitches,cs_link_smart); exclude(initglobalswitches,cs_link_shared); @@ -1253,7 +1236,7 @@ const maxlevel=16; var f : text; - s, + s, tmp, opts : string; skip : array[0..maxlevel-1] of boolean; level : longint; @@ -1294,7 +1277,7 @@ begin RemoveSep(opts); s:=upper(GetName(opts)); if level=0 then - skip[level]:=not (check_symbol(s) or (s='COMMON')); + skip[level]:=not (assigned(search_macro(s)) or (s='COMMON')); end else if (s='IFDEF') then @@ -1306,7 +1289,7 @@ begin stopOptions(1); end; inc(Level); - skip[level]:=(skip[level-1] or (not check_symbol(upper(GetName(opts))))); + skip[level]:=(skip[level-1] or not assigned(search_macro(upper(GetName(opts))))); end else if (s='IFNDEF') then @@ -1318,7 +1301,7 @@ begin stopOptions(1); end; inc(Level); - skip[level]:=(skip[level-1] or (check_symbol(upper(GetName(opts))))); + skip[level]:=(skip[level-1] or assigned(search_macro(upper(GetName(opts))))); end else if (s='ELSE') then @@ -1340,13 +1323,17 @@ begin if (s='DEFINE') then begin RemoveSep(opts); - def_symbol(upper(GetName(opts))); + tmp:= GetName(opts); + if tmp <> '' then + def_system_macro(tmp); end else if (s='UNDEF') then begin RemoveSep(opts); - undef_symbol(upper(GetName(opts))); + tmp:= GetName(opts); + if tmp <> '' then + undef_system_macro(tmp); end else if (s='WRITE') then @@ -1587,9 +1574,9 @@ var i : integer; begin if def then - def_symbol(upper(target_info.shortname)) + def_system_macro(target_info.shortname) else - undef_symbol(upper(target_info.shortname)); + undef_system_macro(target_info.shortname); s:=target_info.extradefines; while (s<>'') do begin @@ -1597,9 +1584,9 @@ begin if i=0 then i:=length(s)+1; if def then - def_symbol(Copy(s,1,i-1)) + def_system_macro(Copy(s,1,i-1)) else - undef_symbol(Copy(s,1,i-1)); + undef_system_macro(Copy(s,1,i-1)); delete(s,1,i); end; end; @@ -1607,7 +1594,7 @@ end; constructor TOption.create; begin - DoWriteLogo:=false; + LogoWritten:=false; NoPressEnter:=false; FirstPass:=false; FileLevel:=0; @@ -1697,145 +1684,6 @@ begin option:=coption.create; disable_configfile:=false; -{ default defines } - def_symbol(upper(target_info.shortname)); - def_symbol('FPC'); - def_symbol('VER'+version_nr); - def_symbol('VER'+version_nr+'_'+release_nr); - def_symbol('VER'+version_nr+'_'+release_nr+'_'+patch_nr); - -{ Temporary defines, until things settle down } - def_symbol('HASWIDECHAR'); - def_symbol('HASWIDESTRING'); - def_symbol('HASOUT'); - def_symbol('HASGLOBALPROPERTY'); - def_symbol('FPC_HASPREFETCH'); - def_symbol('FPC_LINEEND_IN_TEXTREC'); - def_symbol('FPC_ALIGNSRTTI'); -{$ifdef i386} - def_symbol('HASINTF'); - def_symbol('HASVARIANT'); -{$endif i386} -{$ifdef x86_64} - def_symbol('HASINTF'); - def_symbol('HASVARIANT'); -{$endif x86_64} -{$ifdef powerpc} - def_symbol('HASINTF'); - def_symbol('HASVARIANT'); - def_symbol('FPC_MTFSB0_CORRECTED'); -{$endif powerpc} -{$ifdef arm} - def_symbol('HASINTF'); - def_symbol('HASVARIANT'); -{$endif arm} -{$ifdef sparc} - def_symbol('HASINTF'); - def_symbol('HASVARIANT'); -{$endif sparc} - def_symbol('INTERNSETLENGTH'); - def_symbol('INTERNLENGTH'); - def_symbol('INTERNCOPY'); - def_symbol('INT64FUNCRESOK'); - def_symbol('HAS_ADDR_STACK_ON_STACK'); - def_symbol('NOBOUNDCHECK'); - def_symbol('HASCOMPILERPROC'); - def_symbol('INTERNCONSTINTF'); - def_symbol('VALUEGETMEM'); - def_symbol('VALUEFREEMEM'); - def_symbol('HASCURRENCY'); - def_symbol('HASTHREADVAR'); - def_symbol('HAS_GENERICCONSTRUCTOR'); - def_symbol('NOCLASSHELPERS'); - if pocall_default = pocall_register then - def_symbol('REGCALL'); - def_symbol('DECRREFNOTNIL'); - def_symbol('HAS_INTERNAL_INTTYPES'); - def_symbol('STR_USES_VALINT'); - def_symbol('NOSAVEREGISTERS'); - def_symbol('SHORTSTRCOMPAREINREG'); - def_symbol('HASGETHEAPSTATUS'); - -{ using a case is pretty useless here (FK) } -{ some stuff for TP compatibility } -{$ifdef i386} - def_symbol('CPU86'); - def_symbol('CPU87'); -{$endif} -{$ifdef m68k} - def_symbol('CPU68'); -{$endif} - -{ new processor stuff } -{$ifdef i386} - def_symbol('CPUI386'); - def_symbol('CPU32'); - def_symbol('FPC_HAS_TYPE_EXTENDED'); - def_symbol('FPC_HAS_TYPE_DOUBLE'); - def_symbol('FPC_HAS_TYPE_SINGLE'); -{$endif} -{$ifdef m68k} - def_symbol('CPU68K'); - def_symbol('CPUM68K'); - def_symbol('CPU32'); - def_symbol('FPC_CURRENCY_IS_INT64'); - def_symbol('FPC_COMP_IS_INT64'); -{$endif} -{$ifdef ALPHA} - def_symbol('CPUALPHA'); - def_symbol('CPU64'); -{$endif} -{$ifdef powerpc} - def_symbol('CPUPOWERPC'); - def_symbol('CPUPOWERPC32'); - def_symbol('CPU32'); - def_symbol('FPC_HAS_TYPE_DOUBLE'); - def_symbol('FPC_HAS_TYPE_SINGLE'); - def_symbol('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE'); - def_symbol('FPC_CURRENCY_IS_INT64'); - def_symbol('FPC_COMP_IS_INT64'); -{$endif} -{$ifdef iA64} - def_symbol('CPUIA64'); - def_symbol('CPU64'); -{$endif} -{$ifdef x86_64} - def_symbol('CPUX86_64'); - def_symbol('CPUAMD64'); - def_symbol('CPU64'); - { not supported for now, afaik (FK) - def_symbol('FPC_HAS_TYPE_FLOAT128'); } - def_symbol('FPC_HAS_TYPE_EXTENDED'); - def_symbol('FPC_HAS_TYPE_DOUBLE'); - def_symbol('FPC_HAS_TYPE_SINGLE'); -{$endif} -{$ifdef sparc} - def_symbol('CPUSPARC'); - def_symbol('CPUSPARC32'); - def_symbol('CPU32'); - def_symbol('FPC_HAS_TYPE_DOUBLE'); - def_symbol('FPC_HAS_TYPE_SINGLE'); - def_symbol('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE'); - def_symbol('FPC_CURRENCY_IS_INT64'); - def_symbol('FPC_COMP_IS_INT64'); - def_symbol('FPC_REQUIRES_PROPER_ALIGNMENT'); -{$endif} -{$ifdef vis} - def_symbol('CPUVIS'); - def_symbol('CPU32'); -{$endif} -{$ifdef arm} - def_symbol('CPUARM'); - def_symbol('FPUFPA'); - def_symbol('CPU32'); - def_symbol('FPC_HAS_TYPE_DOUBLE'); - def_symbol('FPC_HAS_TYPE_SINGLE'); - def_symbol('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE'); - def_symbol('FPC_CURRENCY_IS_INT64'); - def_symbol('FPC_COMP_IS_INT64'); - def_symbol('FPC_REQUIRES_PROPER_ALIGNMENT'); -{$endif arm} - { get default messagefile } {$IFDEF USE_SYSUTILS} msgfilename:=GetEnvironmentVariable('PPC_ERROR_FILE'); @@ -1843,31 +1691,170 @@ begin msgfilename:=dos.getenv('PPC_ERROR_FILE'); {$ENDIF USE_SYSUTILS} - { default configfile can be specified on the commandline, - remove it first } - if (cmd<>'') and (cmd[1]='[') then +{ default configfile can be specified on the commandline, + remove it first } + if (cmd<>'') and (cmd[1]='[') then begin ppccfg:=Copy(cmd,2,pos(']',cmd)-2); Delete(cmd,1,pos(']',cmd)); end - else + else begin ppccfg:='fpc.cfg'; ppcaltcfg:='ppc386.cfg'; end; - { read the parameters quick, only -i -v -T } - option.firstpass:=true; - if cmd<>'' then - option.parsecmd(cmd) - else +{ first pass reading of parameters, only -i -v -T etc.} + option.firstpass:=true; + if cmd<>'' then + option.parsecmd(cmd) + else begin option.read_parameters; { Write only quickinfo } if option.quickinfo<>'' then - option.writequickinfo; + option.writequickinfo; end; - option.firstpass:=false; + option.firstpass:=false; + +{ default defines } + def_system_macro(target_info.shortname); + def_system_macro('FPC'); + def_system_macro('VER'+version_nr); + def_system_macro('VER'+version_nr+'_'+release_nr); + def_system_macro('VER'+version_nr+'_'+release_nr+'_'+patch_nr); + +{ Temporary defines, until things settle down } + def_system_macro('HASWIDECHAR'); + def_system_macro('HASWIDESTRING'); + def_system_macro('HASOUT'); + def_system_macro('HASGLOBALPROPERTY'); + def_system_macro('FPC_HASPREFETCH'); + def_system_macro('FPC_LINEEND_IN_TEXTREC'); + def_system_macro('FPC_ALIGNSRTTI'); +{$ifdef i386} + def_system_macro('HASINTF'); + def_system_macro('HASVARIANT'); +{$endif i386} +{$ifdef x86_64} + def_system_macro('HASINTF'); + def_system_macro('HASVARIANT'); +{$endif x86_64} +{$ifdef powerpc} + def_system_macro('HASINTF'); + def_system_macro('HASVARIANT'); + def_system_macro('FPC_MTFSB0_CORRECTED'); +{$endif powerpc} +{$ifdef arm} + def_system_macro('HASINTF'); + def_system_macro('HASVARIANT'); +{$endif arm} +{$ifdef sparc} + def_system_macro('HASINTF'); + def_system_macro('HASVARIANT'); +{$endif sparc} + def_system_macro('INTERNSETLENGTH'); + def_system_macro('INTERNLENGTH'); + def_system_macro('INTERNCOPY'); + def_system_macro('INT64FUNCRESOK'); + def_system_macro('HAS_ADDR_STACK_ON_STACK'); + def_system_macro('NOBOUNDCHECK'); + def_system_macro('HASCOMPILERPROC'); + def_system_macro('INTERNCONSTINTF'); + def_system_macro('VALUEGETMEM'); + def_system_macro('VALUEFREEMEM'); + def_system_macro('HASCURRENCY'); + def_system_macro('HASTHREADVAR'); + def_system_macro('HAS_GENERICCONSTRUCTOR'); + def_system_macro('NOCLASSHELPERS'); + if pocall_default = pocall_register then + def_system_macro('REGCALL'); + def_system_macro('DECRREFNOTNIL'); + def_system_macro('HAS_INTERNAL_INTTYPES'); + def_system_macro('STR_USES_VALINT'); + def_system_macro('NOSAVEREGISTERS'); + def_system_macro('SHORTSTRCOMPAREINREG'); + def_system_macro('HASGETHEAPSTATUS'); + +{ using a case is pretty useless here (FK) } +{ some stuff for TP compatibility } +{$ifdef i386} + def_system_macro('CPU86'); + def_system_macro('CPU87'); +{$endif} +{$ifdef m68k} + def_system_macro('CPU68'); +{$endif} + +{ new processor stuff } +{$ifdef i386} + def_system_macro('CPUI386'); + def_system_macro('CPU32'); + def_system_macro('FPC_HAS_TYPE_EXTENDED'); + def_system_macro('FPC_HAS_TYPE_DOUBLE'); + def_system_macro('FPC_HAS_TYPE_SINGLE'); +{$endif} +{$ifdef m68k} + def_system_macro('CPU68K'); + def_system_macro('CPUM68K'); + def_system_macro('CPU32'); + def_system_macro('FPC_CURRENCY_IS_INT64'); + def_system_macro('FPC_COMP_IS_INT64'); +{$endif} +{$ifdef ALPHA} + def_system_macro('CPUALPHA'); + def_system_macro('CPU64'); +{$endif} +{$ifdef powerpc} + def_system_macro('CPUPOWERPC'); + def_system_macro('CPUPOWERPC32'); + def_system_macro('CPU32'); + def_system_macro('FPC_HAS_TYPE_DOUBLE'); + def_system_macro('FPC_HAS_TYPE_SINGLE'); + def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE'); + def_system_macro('FPC_CURRENCY_IS_INT64'); + def_system_macro('FPC_COMP_IS_INT64'); +{$endif} +{$ifdef iA64} + def_system_macro('CPUIA64'); + def_system_macro('CPU64'); +{$endif} +{$ifdef x86_64} + def_system_macro('CPUX86_64'); + def_system_macro('CPUAMD64'); + def_system_macro('CPU64'); + { not supported for now, afaik (FK) + def_system_macro('FPC_HAS_TYPE_FLOAT128'); } + def_system_macro('FPC_HAS_TYPE_EXTENDED'); + def_system_macro('FPC_HAS_TYPE_DOUBLE'); + def_system_macro('FPC_HAS_TYPE_SINGLE'); +{$endif} +{$ifdef sparc} + def_system_macro('CPUSPARC'); + def_system_macro('CPUSPARC32'); + def_system_macro('CPU32'); + def_system_macro('FPC_HAS_TYPE_DOUBLE'); + def_system_macro('FPC_HAS_TYPE_SINGLE'); + def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE'); + def_system_macro('FPC_CURRENCY_IS_INT64'); + def_system_macro('FPC_COMP_IS_INT64'); + def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT'); +{$endif} +{$ifdef vis} + def_system_macro('CPUVIS'); + def_system_macro('CPU32'); +{$endif} +{$ifdef arm} + def_system_macro('CPUARM'); + def_system_macro('FPUFPA'); + def_system_macro('CPU32'); + def_system_macro('FPC_HAS_TYPE_DOUBLE'); + def_system_macro('FPC_HAS_TYPE_SINGLE'); + def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE'); + def_system_macro('FPC_CURRENCY_IS_INT64'); + def_system_macro('FPC_COMP_IS_INT64'); + def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT'); +{$endif arm} { read configuration file } if (not disable_configfile) and @@ -1917,33 +1904,29 @@ begin case target_info.endian of endian_little : begin - def_symbol('ENDIAN_LITTLE'); - def_symbol('FPC_LITTLE_ENDIAN'); + def_system_macro('ENDIAN_LITTLE'); + def_system_macro('FPC_LITTLE_ENDIAN'); end; endian_big : begin - def_symbol('ENDIAN_BIG'); - def_symbol('FPC_BIG_ENDIAN'); + def_system_macro('ENDIAN_BIG'); + def_system_macro('FPC_BIG_ENDIAN'); end; end; { abi define } case target_info.abi of abi_powerpc_sysv : - def_symbol('FPC_ABI_SYSV'); + def_system_macro('FPC_ABI_SYSV'); abi_powerpc_aix : - def_symbol('FPC_ABI_AIX'); + def_system_macro('FPC_ABI_AIX'); end; {$ifdef m68k} if initoptprocessor=MC68020 then - def_symbol('CPUM68020'); + def_system_macro('CPUM68020'); {$endif m68k} -{ write logo if set } - if option.DoWriteLogo then - option.WriteLogo; - { Check file to compile } if param_file='' then begin @@ -2089,6 +2072,10 @@ begin end; UpdateAlignment(initalignment,option.paraalignment); + set_system_macro('FPC_VERSION',version_nr); + set_system_macro('FPC_RELEASE',release_nr); + set_system_macro('FPC_PATCH',patch_nr); + option.free; Option:=nil; end; @@ -2102,7 +2089,11 @@ finalization end. { $Log$ - Revision 1.160 2005-01-08 23:14:50 peter + Revision 1.161 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.160 2005/01/08 23:14:50 peter * Allow #include ~/.fpc.cfg Revision 1.159 2005/01/04 16:19:52 florian diff --git a/compiler/parser.pas b/compiler/parser.pas index 74e9a45125..5e8a2d642a 100644 --- a/compiler/parser.pas +++ b/compiler/parser.pas @@ -160,22 +160,6 @@ implementation end; - procedure default_macros; - var - hp : tstringlistitem; - begin - { commandline } - hp:=tstringlistitem(initdefines.first); - while assigned(hp) do - begin - current_scanner.def_macro(hp.str); - hp:=tstringlistitem(hp.next); - end; - { set macros for version checking } - current_scanner.set_macro('FPC_VERSION',version_nr); - current_scanner.set_macro('FPC_RELEASE',release_nr); - current_scanner.set_macro('FPC_PATCH',patch_nr); - end; {$ifdef PREPROCWRITE} @@ -184,11 +168,15 @@ implementation i : longint; begin new(preprocfile,init('pre')); - { default macros } - current_scanner^.macros:=new(pdictionary,init); - default_macros; { initialize a module } current_module:=new(pmodule,init(filename,false)); + + macrosymtablestack:= initialmacrosymtable; + current_module.localmacrosymtable:= tmacrosymtable.create(false); + current_module.localmacrosymtable.next:= initialmacrosymtable; + macrosymtablestack:= current_module.localmacrosymtable; + ConsolidateMode; + main_module:=current_module; { startup scanner, and save in current_module } current_scanner:=new(pscannerfile,Init(filename)); @@ -334,6 +322,8 @@ implementation oldrefsymtable, olddefaultsymtablestack, oldsymtablestack : tsymtable; + olddefaultmacrosymtablestack, + oldmacrosymtablestack : tsymtable; oldaktprocsym : tprocsym; { cg } oldparse_only : boolean; @@ -395,7 +385,9 @@ implementation old_compiled_module:=compiled_module; { save symtable state } oldsymtablestack:=symtablestack; + oldmacrosymtablestack:=macrosymtablestack; olddefaultsymtablestack:=defaultsymtablestack; + olddefaultmacrosymtablestack:=defaultmacrosymtablestack; oldrefsymtable:=refsymtable; oldcurrent_procinfo:=current_procinfo; oldaktdefproccall:=aktdefproccall; @@ -457,7 +449,9 @@ implementation { reset symtable } symtablestack:=nil; + macrosymtablestack:=nil; defaultsymtablestack:=nil; + defaultmacrosymtablestack:=nil; systemunit:=nil; refsymtable:=nil; aktdefproccall:=initdefproccall; @@ -506,8 +500,13 @@ implementation current_scanner:=tscannerfile.Create(filename); current_scanner.firstfile; current_module.scanner:=current_scanner; - { macros } - default_macros; + + { init macros before anything in the file is parsed.} + macrosymtablestack:= initialmacrosymtable; + current_module.localmacrosymtable:= tmacrosymtable.create(false); + current_module.localmacrosymtable.next:= initialmacrosymtable; + macrosymtablestack:= current_module.localmacrosymtable; + { read the first token } current_scanner.readtoken; @@ -606,7 +605,9 @@ implementation { restore symtable state } refsymtable:=oldrefsymtable; symtablestack:=oldsymtablestack; + macrosymtablestack:=oldmacrosymtablestack; defaultsymtablestack:=olddefaultsymtablestack; + defaultmacrosymtablestack:=olddefaultmacrosymtablestack; aktdefproccall:=oldaktdefproccall; current_procinfo:=oldcurrent_procinfo; aktsourcecodepage:=oldsourcecodepage; @@ -698,7 +699,11 @@ implementation end. { $Log$ - Revision 1.68 2004-10-25 15:38:41 peter + Revision 1.69 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.68 2004/10/25 15:38:41 peter * heap and heapsize removed * checkpointer fixes diff --git a/compiler/pmodules.pas b/compiler/pmodules.pas index 154fb439b6..4d94ab27ea 100644 --- a/compiler/pmodules.pas +++ b/compiler/pmodules.pas @@ -381,6 +381,11 @@ implementation { add to symtable stack } tsymtable(hp.globalsymtable).next:=symtablestack; symtablestack:=hp.globalsymtable; + if (m_mac in aktmodeswitches) and assigned(hp.globalmacrosymtable) then + begin + tsymtable(hp.globalmacrosymtable).next:=macrosymtablestack; + macrosymtablestack:=hp.globalmacrosymtable; + end; { insert unitsym } unitsym:=tunitsym.create(s,hp.globalsymtable); inc(unitsym.refs); @@ -424,7 +429,8 @@ implementation exit; end; { insert the system unit, it is allways the first } - Symtablestack:=nil; + symtablestack:=nil; + macrosymtablestack:=initialmacrosymtable; AddUnit('System'); SystemUnit:=TGlobalSymtable(Symtablestack); { read default constant definitions } @@ -468,6 +474,7 @@ implementation end; { save default symtablestack } defaultsymtablestack:=symtablestack; + defaultmacrosymtablestack:=macrosymtablestack; end; @@ -479,6 +486,8 @@ implementation hp2 : tmodule; hp3 : tsymtable; unitsym : tunitsym; + top_of_macrosymtable : tsymtable; + begin consume(_USES); {$ifdef DEBUG} @@ -536,9 +545,9 @@ implementation else break; until false; - consume(_SEMICOLON); { Load the units } + top_of_macrosymtable:= macrosymtablestack; pu:=tused_unit(current_module.used_units.first); while assigned(pu) do begin @@ -571,6 +580,7 @@ implementation then insert the units in the symtablestack } pu:=tused_unit(current_module.used_units.first); symtablestack:=defaultsymtablestack; + macrosymtablestack:=defaultmacrosymtablestack; while assigned(pu) do begin if pu.in_uses then @@ -588,6 +598,11 @@ implementation begin tsymtable(pu.u.globalsymtable).next:=symtablestack; symtablestack:=tsymtable(pu.u.globalsymtable); + if (m_mac in aktmodeswitches) and assigned(pu.u.globalmacrosymtable) then + begin + tsymtable(pu.u.globalmacrosymtable).next:=macrosymtablestack; + macrosymtablestack:=tsymtable(pu.u.globalmacrosymtable); + end; {$ifdef DEBUG} test_symtablestack; {$endif DEBUG} @@ -596,6 +611,13 @@ implementation end; pu:=tused_unit(pu.next); end; + + if assigned (current_module.globalmacrosymtable) then + top_of_macrosymtable.next.next:= macrosymtablestack + else + top_of_macrosymtable.next:= macrosymtablestack; + macrosymtablestack:= top_of_macrosymtable; + consume(_SEMICOLON); end; @@ -771,22 +793,6 @@ implementation if (cs_local_browser in aktmoduleswitches) and not(cs_browser in aktmoduleswitches) then exclude(aktmoduleswitches,cs_local_browser); - - { define a symbol in delphi,objfpc,tp,gpc mode } - if (m_delphi in aktmodeswitches) then - current_scanner.def_macro('FPC_DELPHI') - else - if (m_tp7 in aktmodeswitches) then - current_scanner.def_macro('FPC_TP') - else - if (m_objfpc in aktmodeswitches) then - current_scanner.def_macro('FPC_OBJFPC') - else - if (m_gpc in aktmodeswitches) then - current_scanner.def_macro('FPC_GPC') - else - if (m_mac in aktmodeswitches) then - current_scanner.def_macro('FPC_MACPAS'); end; @@ -880,7 +886,15 @@ implementation release_main_proc(pd); end; - + procedure delete_duplicate_macros(p:TNamedIndexItem; arg:pointer); + var + hp: tsymentry; + begin + hp:= current_module.localmacrosymtable.search(p.name); + if assigned(hp) then + current_module.localmacrosymtable.delete(hp); + end; + procedure proc_unit; function is_assembler_generated:boolean; @@ -907,6 +921,12 @@ implementation unitname8 : string[8]; has_impl: boolean; begin + if m_mac in aktmodeswitches then + begin + ConsolidateMode; + current_module.mode_switch_allowed:= false; + end; + consume(_UNIT); if compile_level=1 then Status.IsExe:=false; @@ -956,6 +976,7 @@ implementation current_module.in_global:=false; { handle the global switches } + ConsolidateMode; setupglobalswitches; message1(unit_u_loading_interface_units,current_module.modulename^); @@ -986,9 +1007,20 @@ implementation { with the same name as the unit } refsymtable.insert(tunitsym.create(current_module.realmodulename^,unitst)); + macrosymtablestack:= initialmacrosymtable; + { load default units, like the system unit } loaddefaultunits; + current_module.localmacrosymtable.next:=macrosymtablestack; + if assigned(current_module.globalmacrosymtable) then + begin + current_module.globalmacrosymtable.next:= current_module.localmacrosymtable; + macrosymtablestack:=current_module.globalmacrosymtable; + end + else + macrosymtablestack:=current_module.localmacrosymtable; + { reset } make_ref:=true; @@ -1054,13 +1086,7 @@ implementation if (m_mac in aktmodeswitches) and try_to_consume(_END) then has_impl:= false else - begin - consume(_IMPLEMENTATION); - has_impl:= true; - end; - - if has_impl then - Message1(unit_u_loading_implementation_units,current_module.modulename^); + has_impl:= true; parse_only:=false; @@ -1068,16 +1094,30 @@ implementation st:=tstaticsymtable.create(current_module.modulename^); current_module.localsymtable:=st; + { Swap the positions of the local and global macro sym table} + if assigned(current_module.globalmacrosymtable) then + begin + macrosymtablestack:=current_module.localmacrosymtable; + current_module.globalmacrosymtable.next:= current_module.localmacrosymtable.next; + current_module.localmacrosymtable.next:=current_module.globalmacrosymtable; + + current_module.globalmacrosymtable.foreach_static(@delete_duplicate_macros, nil); + end; + { remove the globalsymtable from the symtable stack } { to reinsert it after loading the implementation units } symtablestack:=unitst.next; { we don't want implementation units symbols in unitsymtable !! PM } refsymtable:=st; - - { Read the implementation units } + if has_impl then - parse_implementation_uses; + begin + consume(_IMPLEMENTATION); + Message1(unit_u_loading_implementation_units,current_module.modulename^); + { Read the implementation units } + parse_implementation_uses; + end; if current_module.state=ms_compiled then exit; @@ -1340,7 +1380,8 @@ implementation { global switches are read, so further changes aren't allowed } current_module.in_global:=false; - { setup things using the global switches } + { setup things using the switches } + ConsolidateMode; setupglobalswitches; { set implementation flag } @@ -1353,9 +1394,14 @@ implementation current_module.localsymtable:=st; refsymtable:=st; + macrosymtablestack:= nil; + { load standard units (system,objpas,profile unit) } loaddefaultunits; + current_module.localmacrosymtable.next:=macrosymtablestack; + macrosymtablestack:=current_module.localmacrosymtable; + {Load the units used by the program we compile.} if token=_USES then loadunits; @@ -1554,7 +1600,11 @@ implementation end. { $Log$ - Revision 1.178 2004-12-06 19:23:05 peter + Revision 1.179 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.178 2004/12/06 19:23:05 peter implicit load of variants unit Revision 1.177 2004/11/29 18:50:15 peter diff --git a/compiler/ppu.pas b/compiler/ppu.pas index cf092d2488..430a8b6350 100644 --- a/compiler/ppu.pas +++ b/compiler/ppu.pas @@ -44,7 +44,7 @@ type {$endif Test_Double_checksum} const - CurrentPPUVersion=46; + CurrentPPUVersion=47; { buffer sizes } maxentrysize = 1024; @@ -79,8 +79,11 @@ const ibdefref = 13; ibendsymtablebrowser = 14; ibbeginsymtablebrowser = 15; +{$IFDEF MACRO_DIFF_HINT} ibusedmacros = 16; +{$ENDIF} ibderefdata = 17; + ibexportedmacros = 18; {syms} ibtypesym = 20; ibprocsym = 21; @@ -97,6 +100,7 @@ const ibrttisym = 32; iblocalvarsym = 33; ibparavarsym = 34; + ibmacrosym = 35; {definitions} iborddef = 40; ibpointerdef = 41; @@ -1055,7 +1059,11 @@ end; end. { $Log$ - Revision 1.60 2004-12-06 19:23:05 peter + Revision 1.61 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.60 2004/12/06 19:23:05 peter implicit load of variants unit Revision 1.59 2004/11/15 23:35:31 peter diff --git a/compiler/scandir.pas b/compiler/scandir.pas index cdaf76c0af..14f47d11bb 100644 --- a/compiler/scandir.pas +++ b/compiler/scandir.pas @@ -37,6 +37,7 @@ implementation verbose,comphook, scanner,switches, fmodule, + symtable, rabase; const @@ -617,17 +618,24 @@ implementation procedure dir_mode; - begin - if not current_module.in_global then - Message(scan_w_switch_is_global) - else - begin - current_scanner.skipspace; - current_scanner.readstring; - if not SetCompileMode(pattern,false) then - Message1(scan_w_illegal_switch,pattern); - end; - end; + + begin + if not current_module.in_global then + Message(scan_w_switch_is_global) + else + begin + current_scanner.skipspace; + current_scanner.readstring; + if not current_module.mode_switch_allowed and + not ((m_mac in aktmodeswitches) and (pattern='MACPAS')) then + Message1(scan_e_mode_switch_not_allowed,pattern) + else if SetCompileMode(pattern,false) then + ConsolidateMode + else + Message1(scan_w_illegal_switch,pattern) + end; + current_module.mode_switch_allowed:= false; + end; procedure dir_mmx; begin @@ -779,18 +787,13 @@ implementation end; procedure dir_profile; - var - mac : tmacro; begin do_moduleswitch(cs_profile); { defined/undefine FPC_PROFILE } - mac:=tmacro(current_scanner.macros.search('FPC_PROFILE')); - if not assigned(mac) then - begin - mac:=tmacro.create('FPC_PROFILE'); - current_scanner.macros.insert(mac); - end; - mac.defined:=(cs_profile in aktmoduleswitches); + if cs_profile in aktmoduleswitches then + def_system_macro('FPC_PROFILE') + else + undef_system_macro('FPC_PROFILE'); end; procedure dir_push; @@ -895,18 +898,13 @@ implementation {$endif} procedure dir_threading; - var - mac : tmacro; begin do_moduleswitch(cs_threading); { defined/undefine FPC_THREADING } - mac:=tmacro(current_scanner.macros.search('FPC_THREADING')); - if not assigned(mac) then - begin - mac:=tmacro.create('FPC_THREADING'); - current_scanner.macros.insert(mac); - end; - mac.defined:=(cs_threading in aktmoduleswitches); + if cs_threading in aktmoduleswitches then + def_system_macro('FPC_THREADING') + else + undef_system_macro('FPC_THREADING'); end; procedure dir_typedaddress; @@ -1170,7 +1168,11 @@ begin end. { $Log$ - Revision 1.50 2005-01-06 02:13:03 karoly + Revision 1.51 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.50 2005/01/06 02:13:03 karoly * more SysV call support stuff for MorphOS Revision 1.49 2005/01/04 17:40:33 karoly diff --git a/compiler/scanner.pas b/compiler/scanner.pas index ea60afd9cb..aaf9bf6af9 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -36,30 +36,14 @@ interface const max_include_nesting=32; max_macro_nesting=16; - maxmacrolen=16*1024; preprocbufsize=32*1024; type tcommentstyle = (comment_none,comment_tp,comment_oldtp,comment_delphi,comment_c); - pmacrobuffer = ^tmacrobuffer; - tmacrobuffer = array[0..maxmacrolen-1] of char; tscannerfile = class; - tmacro = class(TNamedIndexItem) - defined : boolean; { normally true, but false when the macro is undef-ed} - defined_at_startup : boolean; - is_used : boolean; - is_compiler_var : boolean; { if this is a mac style compiler variable, in - which case no macro substitutions shall be done.} - buftext : pchar; - buflen : longint; - fileinfo : tfileposinfo; - constructor Create(const n : string); - destructor destroy;override; - end; - preproctyp = (pp_ifdef,pp_ifndef,pp_if,pp_ifopt,pp_else,pp_elseif); tpreprocstack = class @@ -103,7 +87,6 @@ interface lastasmgetchar : char; ignoredirectives : tstringlist; { ignore directives, used to give warnings only once } preprocstack : tpreprocstack; - macros : Tdictionary; in_asm_string : boolean; preproc_pattern : string; @@ -124,8 +107,6 @@ interface procedure reload; procedure insertmacro(const macname:string;p:pchar;len,line,fileindex:longint); { Scanner things } - procedure def_macro(const s : string); - procedure set_macro(const s : string;value : string); procedure gettokenpos; procedure inc_comment_level; procedure dec_comment_level; @@ -200,6 +181,8 @@ interface procedure InitScanner; procedure DoneScanner; + {To be called when the language mode is finally determined} + procedure ConsolidateMode; implementation @@ -251,6 +234,33 @@ implementation end; + {To be called when the language mode is finally determined} + procedure ConsolidateMode; + + begin + if m_mac in aktmodeswitches then + if current_module.is_unit and not assigned(current_module.globalmacrosymtable) then + begin + current_module.globalmacrosymtable:= tmacrosymtable.create(true); + current_module.globalmacrosymtable.next:= current_module.localmacrosymtable; + macrosymtablestack:=current_module.globalmacrosymtable; + end; + + { define a symbol in delphi,objfpc,tp,gpc,macpas mode } + if (m_delphi in aktmodeswitches) then + def_system_macro('FPC_DELPHI') + else if (m_tp7 in aktmodeswitches) then + def_system_macro('FPC_TP') + else if (m_objfpc in aktmodeswitches) then + def_system_macro('FPC_OBJFPC') + else if (m_gpc in aktmodeswitches) then + def_system_macro('FPC_GPC') + else if (m_mac in aktmodeswitches) then + def_system_macro('FPC_MACPAS'); + end; + + + {***************************************************************************** Conditional Directives *****************************************************************************} @@ -276,7 +286,7 @@ implementation hs:=current_scanner.readid; if hs='' then Message(scan_e_error_in_preproc_expr); - mac:=tmacro(current_scanner.macros.search(hs)); + mac:=tmacro(search_macro(hs)); if assigned(mac) then mac.is_used:=true; current_scanner.addpreprocstack(pp_ifdef,assigned(mac) and mac.defined,hs,scan_c_ifdef_found); @@ -292,7 +302,7 @@ implementation hs:=current_scanner.readid; if hs='' then Message(scan_e_error_in_preproc_expr); - mac:=tmacro(current_scanner.macros.search(hs)); + mac:=tmacro(search_macro(hs)); if assigned(mac) then mac.is_used:=true; current_scanner.addpreprocstack(pp_ifndef,not(assigned(mac) and mac.defined),hs,scan_c_ifndef_found); @@ -383,7 +393,7 @@ implementation For real macros also do recursive substitution. } macrocount:=0; repeat - mac:=tmacro(current_scanner.macros.search(result)); + mac:=tmacro(search_macro(result)); inc(macrocount); if macrocount>max_macro_nesting then @@ -405,6 +415,7 @@ implementation hs[0]:=char(len); move(mac.buftext^,hs[1],len); result:=upcase(hs); + mac.is_used:=true; end else begin @@ -445,9 +456,12 @@ implementation if current_scanner.preproc_token =_ID then begin hs := current_scanner.preproc_pattern; - mac := tmacro(current_scanner.macros.search(hs)); + mac := tmacro(search_macro(hs)); if assigned(mac) then - hs := '1' + begin + hs := '1'; + mac.is_used:=true; + end else hs := '0'; read_factor := hs; @@ -469,9 +483,12 @@ implementation if current_scanner.preproc_token =_ID then begin hs := current_scanner.preproc_pattern; - mac := tmacro(current_scanner.macros.search(hs)); + mac := tmacro(search_macro(hs)); if assigned(mac) then - hs := '0' + begin + hs := '0'; + mac.is_used:=true; + end else hs := '1'; read_factor := hs; @@ -757,13 +774,13 @@ implementation begin current_scanner.skipspace; hs:=current_scanner.readid; - mac:=tmacro(current_scanner.macros.search(hs)); - if not assigned(mac) then + mac:=tmacro(search_macro(hs)); + if not assigned(mac) or (mac.owner <> macrosymtablestack) then begin mac:=tmacro.create(hs); mac.defined:=true; Message1(parser_c_macro_defined,mac.name); - current_scanner.macros.insert(mac); + macrosymtablestack.insert(mac); end else begin @@ -855,14 +872,14 @@ implementation begin current_scanner.skipspace; hs:=current_scanner.readid; - mac:=tmacro(current_scanner.macros.search(hs)); - if not assigned(mac) then + mac:=tmacro(search_macro(hs)); + if not assigned(mac) or (mac.owner <> macrosymtablestack) then begin mac:=tmacro.create(hs); mac.defined:=true; mac.is_compiler_var:=true; Message1(parser_c_macro_defined,mac.name); - current_scanner.macros.insert(mac); + macrosymtablestack.insert(mac); end else begin @@ -920,13 +937,13 @@ implementation begin current_scanner.skipspace; hs:=current_scanner.readid; - mac:=tmacro(current_scanner.macros.search(hs)); - if not assigned(mac) then + mac:=tmacro(search_macro(hs)); + if not assigned(mac) or (mac.owner <> macrosymtablestack) then begin mac:=tmacro.create(hs); Message1(parser_c_macro_undefined,mac.name); mac.defined:=false; - current_scanner.macros.insert(mac); + macrosymtablestack.insert(mac); end else begin @@ -1071,32 +1088,6 @@ implementation end; - -{***************************************************************************** - TMacro -*****************************************************************************} - - constructor tmacro.create(const n : string); - begin - inherited createname(n); - defined:=true; - defined_at_startup:=false; - fileinfo:=akttokenpos; - is_used:=false; - is_compiler_var:= false; - buftext:=nil; - buflen:=0; - end; - - - destructor tmacro.destroy; - begin - if assigned(buftext) then - freemem(buftext,buflen); - inherited destroy; - end; - - {***************************************************************************** Preprocessor writting *****************************************************************************} @@ -1206,7 +1197,6 @@ implementation lastasmgetchar:=#0; ignoredirectives:=TStringList.Create; in_asm_string:=false; - macros:=tdictionary.create; end; @@ -1233,48 +1223,6 @@ implementation if not inputfile.closed then closeinputfile; ignoredirectives.free; - macros.free; - end; - - - procedure tscannerfile.def_macro(const s : string); - var - mac : tmacro; - begin - mac:=tmacro(macros.search(s)); - if mac=nil then - begin - mac:=tmacro.create(s); - Message1(parser_c_macro_defined,mac.name); - macros.insert(mac); - end; - mac.defined:=true; - mac.defined_at_startup:=true; - end; - - - procedure tscannerfile.set_macro(const s : string;value : string); - var - mac : tmacro; - begin - mac:=tmacro(macros.search(s)); - if mac=nil then - begin - mac:=tmacro.create(s); - macros.insert(mac); - end - else - begin - mac.is_compiler_var:=false; - if assigned(mac.buftext) then - freemem(mac.buftext,mac.buflen); - end; - Message2(parser_c_macro_set_to,mac.name,value); - mac.buflen:=length(value); - getmem(mac.buftext,mac.buflen); - move(value[1],mac.buftext^,mac.buflen); - mac.defined:=true; - mac.defined_at_startup:=true; end; @@ -2483,11 +2431,12 @@ implementation { this takes some time ... } if (cs_support_macro in aktmoduleswitches) then begin - mac:=tmacro(macros.search(pattern)); + mac:=tmacro(search_macro(pattern)); if assigned(mac) and (not mac.is_compiler_var) and (assigned(mac.buftext)) then begin if yylexcount 255 chars Revision 1.96 2004/11/08 22:09:59 peter diff --git a/compiler/symbase.pas b/compiler/symbase.pas index 2ba926a201..033a0e0e47 100644 --- a/compiler/symbase.pas +++ b/compiler/symbase.pas @@ -117,6 +117,8 @@ interface procedure foreach(proc2call : tnamedindexcallback;arg:pointer); procedure foreach_static(proc2call : tnamedindexstaticcallback;arg:pointer); procedure insert(sym : tsymentry);virtual; + { deletes a tsymentry and removes it from the tsymtable} + procedure delete(sym:tsymentry); procedure replace(oldsym,newsym:tsymentry); function search(const s : stringid) : tsymentry; function speedsearch(const s : stringid;speedvalue : cardinal) : tsymentry;virtual; @@ -136,11 +138,16 @@ interface defaultsymtablestack : tsymtable; { symtablestack after default units have been loaded } symtablestack : tsymtable; { linked list of symtables } + defaultmacrosymtablestack : tsymtable;{ macrosymtablestack after default units have been loaded } + macrosymtablestack: tsymtable; { linked list of macro symtables } aktrecordsymtable : tsymtable; { current record symtable } aktparasymtable : tsymtable; { current proc para symtable } aktlocalsymtable : tsymtable; { current proc local symtable } + initialmacrosymtable: tsymtable; { macros initially defined by the compiler or + given on the command line. Is common + for all files compiled and do not change. } implementation @@ -266,6 +273,13 @@ implementation symsearch.insert(sym); end; + procedure tsymtable.delete(sym:tsymentry); + begin + sym.owner:=nil; + { remove from index and search hash } + symsearch.delete(sym.name); + symindex.delete(sym); + end; procedure tsymtable.replace(oldsym,newsym:tsymentry); begin @@ -331,7 +345,11 @@ implementation end. { $Log$ - Revision 1.23 2004-10-15 09:14:17 mazen + Revision 1.24 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.23 2004/10/15 09:14:17 mazen - remove $IFDEF DELPHI and related code - remove $IFDEF FPCPROCVAR and related code diff --git a/compiler/symconst.pas b/compiler/symconst.pas index 2c6cb380e6..015e4b29e8 100644 --- a/compiler/symconst.pas +++ b/compiler/symconst.pas @@ -334,7 +334,8 @@ type globalsymtable,staticsymtable, objectsymtable,recordsymtable, localsymtable,parasymtable, - withsymtable,stt_exceptsymtable + withsymtable,stt_exceptsymtable, + exportedmacrosymtable, localmacrosymtable ); @@ -439,7 +440,11 @@ initialization end. { $Log$ - Revision 1.99 2005-01-06 02:13:03 karoly + Revision 1.100 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.99 2005/01/06 02:13:03 karoly * more SysV call support stuff for MorphOS Revision 1.98 2005/01/05 02:31:06 karoly diff --git a/compiler/symsym.pas b/compiler/symsym.pas index faa0ffcfb8..637ba9aebe 100644 --- a/compiler/symsym.pas +++ b/compiler/symsym.pas @@ -340,6 +340,31 @@ interface procedure ppuwrite(ppufile:tcompilerppufile);override; end; + const + maxmacrolen=16*1024; + + type + pmacrobuffer = ^tmacrobuffer; + tmacrobuffer = array[0..maxmacrolen-1] of char; + + tmacro = class(tstoredsym) + {Normally true, but false when a previously defined macro is undef-ed} + defined : boolean; + {True if this is a mac style compiler variable, in which case no macro + substitutions shall be done.} + is_compiler_var : boolean; + {Whether the macro was used. NOTE: A use of a macro which was never defined} + {e. g. an IFDEF which returns false, will not be registered as used,} + {since there is no place to register its use. } + is_used : boolean; + buftext : pchar; + buflen : longint; + constructor create(const n : string); + constructor ppuload(ppufile:tcompilerppufile); + procedure ppuwrite(ppufile:tcompilerppufile);override; + destructor destroy;override; + end; + { compiler generated symbol to point to rtti and init/finalize tables } trttisym = class(tstoredsym) private @@ -2498,6 +2523,61 @@ implementation end; +{***************************************************************************** + TMacro +*****************************************************************************} + + constructor tmacro.create(const n : string); + begin + inherited create(n); + typ:= macrosym; + owner:= nil; + + defined:=false; + is_used:=false; + is_compiler_var:= false; + buftext:=nil; + buflen:=0; + end; + + constructor tmacro.ppuload(ppufile:tcompilerppufile); + begin + inherited ppuload(ppufile); + typ:=macrosym; + name:=ppufile.getstring; + defined:=boolean(ppufile.getbyte); + is_compiler_var:=boolean(ppufile.getbyte); + is_used:=false; + buflen:= ppufile.getlongint; + if buflen > 0 then + begin + getmem(buftext, buflen); + ppufile.getdata(buftext^, buflen) + end + else + buftext:=nil; + end; + + destructor tmacro.destroy; + begin + if assigned(buftext) then + freemem(buftext,buflen); + inherited destroy; + end; + + procedure tmacro.ppuwrite(ppufile:tcompilerppufile); + begin + inherited ppuwrite(ppufile); + ppufile.putstring(name); + ppufile.putbyte(byte(defined)); + ppufile.putbyte(byte(is_compiler_var)); + ppufile.putlongint(buflen); + if buflen > 0 then + ppufile.putdata(buftext^,buflen); + ppufile.writeentry(ibmacrosym); + end; + + {**************************************************************************** TRTTISYM ****************************************************************************} @@ -2569,7 +2649,11 @@ implementation end. { $Log$ - Revision 1.198 2005-01-04 16:38:54 peter + Revision 1.199 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.198 2005/01/04 16:38:54 peter * fix setting minval for enum with specified values Revision 1.197 2005/01/03 22:27:56 peter diff --git a/compiler/symtable.pas b/compiler/symtable.pas index d7fcd3b777..5d47825262 100644 --- a/compiler/symtable.pas +++ b/compiler/symtable.pas @@ -180,6 +180,11 @@ interface constructor create; end; + tmacrosymtable = class(tstoredsymtable) + public + constructor create(exported: boolean); + procedure ppuload(ppufile:tcompilerppufile);override; + end; var constsymtable : tsymtable; { symtable were the constants can be inserted } @@ -208,11 +213,22 @@ interface {$endif notused} function search_class_member(pd : tobjectdef;const s : string):tsym; function search_assignment_operator(from_def,to_def:Tdef):Tprocdef; + {Looks for macro s (must be given in upper case) in the macrosymbolstack, } + {and returns it if found. Returns nil otherwise.} + function search_macro(const s : string):tsym; {*** Object Helpers ***} procedure search_class_overloads(aprocsym : tprocsym); function search_default_property(pd : tobjectdef) : tpropertysym; +{*** Macro Helpers ***} + {If called initially, the following procedures manipulate macros in } + {initialmacrotable, otherwise they manipulate system macros local to a module.} + {Name can be given in any case (it will be converted to upper case).} + procedure def_system_macro(const name : string); + procedure set_system_macro(const name, value : string); + procedure undef_system_macro(const name : string); + {*** symtable stack ***} {$ifdef DEBUG} procedure test_symtablestack; @@ -374,6 +390,7 @@ implementation iblabelsym : sym:=tlabelsym.ppuload(ppufile); ibsyssym : sym:=tsyssym.ppuload(ppufile); ibrttisym : sym:=trttisym.ppuload(ppufile); + ibmacrosym : sym:=tmacro.ppuload(ppufile); ibendsyms : break; ibend : Message(unit_f_ppu_read_error); else @@ -1699,6 +1716,33 @@ implementation end; +{**************************************************************************** + TMacroSymtable +****************************************************************************} + + constructor tmacrosymtable.create(exported: boolean); + begin + inherited create(''); + if exported then + symtabletype:=exportedmacrosymtable + else + symtabletype:=localmacrosymtable; + symtablelevel:=main_program_level; + end; + + + procedure tmacrosymtable.ppuload(ppufile:tcompilerppufile); + begin + next:=macrosymtablestack; + macrosymtablestack:=self; + + inherited ppuload(ppufile); + + { restore symtablestack } + macrosymtablestack:=next; + end; + + {***************************************************************************** Helper Routines *****************************************************************************} @@ -2086,6 +2130,28 @@ implementation search_class_member:=nil; end; + function search_macro(const s : string):tsym; + var + p : tsymtable; + speedvalue : cardinal; + srsym : tsym; + + begin + speedvalue:= getspeedvalue(s); + p:=macrosymtablestack; + while assigned(p) do + begin + srsym:=tsym(p.speedsearch(s,speedvalue)); + if assigned(srsym) then + begin + search_macro:= srsym; + exit; + end; + p:=p.next; + end; + search_macro:= nil; + end; + {***************************************************************************** Definition Helpers @@ -2197,6 +2263,88 @@ implementation search_default_property:=_defaultprop; end; +{**************************************************************************** + Macro Helpers +****************************************************************************} +{NOTE: Initially, macrosymtablestack contains initialmacrosymtable.} + + procedure def_system_macro(const name : string); + var + mac : tmacro; + s: string; + begin + if name = '' then + internalerror(2004121201); + s:= upper(name); + mac:=tmacro(search_macro(s)); + if not assigned(mac) then + begin + mac:=tmacro.create(s); + if macrosymtablestack.symtabletype=localmacrosymtable then + macrosymtablestack.insert(mac) + else + macrosymtablestack.next.insert(mac) + end; + if not mac.defined then + Message1(parser_c_macro_defined,mac.name); + mac.defined:=true; + end; + + procedure set_system_macro(const name, value : string); + var + mac : tmacro; + s: string; + begin + if name = '' then + internalerror(2004121201); + s:= upper(name); + mac:=tmacro(search_macro(s)); + if not assigned(mac) then + begin + mac:=tmacro.create(s); + if macrosymtablestack.symtabletype=localmacrosymtable then + macrosymtablestack.insert(mac) + else + macrosymtablestack.next.insert(mac) + end + else + begin + mac.is_compiler_var:=false; + if assigned(mac.buftext) then + freemem(mac.buftext,mac.buflen); + end; + Message2(parser_c_macro_set_to,mac.name,value); + mac.buflen:=length(value); + getmem(mac.buftext,mac.buflen); + move(value[1],mac.buftext^,mac.buflen); + mac.defined:=true; + end; + + procedure undef_system_macro(const name : string); + var + mac : tmacro; + s: string; + begin + if name = '' then + internalerror(2004121201); + s:= upper(name); + mac:=tmacro(search_macro(s)); + if not assigned(mac) then + {If not found, then it's already undefined.} + else + begin + if mac.defined then + Message1(parser_c_macro_undefined,mac.name); + mac.defined:=false; + mac.is_compiler_var:=false; + { delete old definition } + if assigned(mac.buftext) then + begin + freemem(mac.buftext,mac.buflen); + mac.buftext:=nil; + end; + end; + end; {$ifdef UNITALIASES} {**************************************************************************** @@ -2290,6 +2438,7 @@ implementation { Reset symbolstack } registerdef:=false; symtablestack:=nil; + macrosymtablestack:=nil; systemunit:=nil; {$ifdef GDB} globaltypecount:=1; @@ -2302,6 +2451,9 @@ implementation { unit aliases } unitaliases:=tdictionary.create; {$endif} + initialmacrosymtable:= tmacrosymtable.create(false); + macrosymtablestack:= initialmacrosymtable; + dupnr:=0; end; @@ -2313,12 +2465,17 @@ implementation {$ifdef UNITALIASES} unitaliases.free; {$endif} + initialmacrosymtable.Free; end; end. { $Log$ - Revision 1.167 2004-12-27 16:35:48 peter + Revision 1.168 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.167 2004/12/27 16:35:48 peter * set flag if a procedure references a symbol in staticsymtable Revision 1.166 2004/12/21 08:38:16 michael diff --git a/compiler/utils/ppudump.pp b/compiler/utils/ppudump.pp index 40b5eb0184..88ba93d5d0 100644 --- a/compiler/utils/ppudump.pp +++ b/compiler/utils/ppudump.pp @@ -1250,10 +1250,10 @@ begin readderef; writeln(space,' ParaNr : ',getword); if (vo_has_explicit_paraloc in varoptions) then - begin - i:=getbyte; - getdata(tempbuf,i); - end; + begin + i:=getbyte; + getdata(tempbuf,i); + end; end; ibenumsym : @@ -1276,6 +1276,24 @@ begin writeln(space,' RTTI Type : ',getbyte); end; + ibmacrosym : + begin + readcommonsym('Macro symbol '); + writeln(space,' Name: ',getstring); + writeln(space,' Defined: ',getbyte); + writeln(space,' Compiler var: ',getbyte); + len:=getlongint; + writeln(space,' Value length: ',len); + if len > 0 then + begin + getmem(pc,len+1); + getdata(pc^,len); + (pc+len)^:= #0; + writeln(space,' Value: "',pc,'"'); + freemem(pc,len+1); + end; + end; + ibtypedconstsym : begin readcommonsym('Typed constant '); @@ -1703,7 +1721,7 @@ begin inc(sourcenumber); end; end; - +{$IFDEF MACRO_DIFF_HINT} ibusedmacros : begin while not EndOfEntry do @@ -1721,7 +1739,7 @@ begin writeln; end; end; - +{$ENDIF} ibloadunit : ReadLoadUnit; @@ -1944,6 +1962,32 @@ begin end else ppufile.skipuntilentry(ibendsyms); + +{read the macro symbols} + if (verbose and v_syms)<>0 then + begin + Writeln; + Writeln('Interface Macro Symbols'); + Writeln('-----------------------'); + end; + if ppufile.readentry<>ibexportedmacros then + begin + Writeln('!! Error in PPU'); + exit; + end; + if boolean(ppufile.getbyte) then + begin + {skip the definition section for macros (since they are never used) } + ppufile.skipuntilentry(ibenddefs); + {read the macro symbols} + if (verbose and v_syms)<>0 then + readsymbols('interface macro') + else + ppufile.skipuntilentry(ibendsyms); + end + else + Writeln('(no exported macros)'); + {read the implementation stuff} if (verbose and v_implementation)<>0 then begin @@ -2064,7 +2108,7 @@ begin case upcase(para[2]) of 'V' : begin verbose:=0; - for i:=3to length(para) do + for i:=3 to length(para) do case upcase(para[i]) of 'H' : verbose:=verbose or v_header; 'I' : verbose:=verbose or v_interface; @@ -2088,7 +2132,11 @@ begin end. { $Log$ - Revision 1.63 2004-11-19 08:33:02 marco + Revision 1.64 2005-01-09 20:24:43 olle + * rework of macro subsystem + + exportable macros for mode macpas + + Revision 1.63 2004/11/19 08:33:02 marco * fix for " Split po_public into po_public and po_global" Revision 1.62 2004/11/19 08:17:02 michael