|
@@ -209,7 +209,8 @@ type
|
|
ST_LINE,
|
|
ST_LINE,
|
|
ST_COLUMN,
|
|
ST_COLUMN,
|
|
ST_FILEINDEX,
|
|
ST_FILEINDEX,
|
|
- ST_LOADMESSAGES);
|
|
|
|
|
|
+ ST_LOADMESSAGES,
|
|
|
|
+ ST_INVALID);
|
|
|
|
|
|
TPpuModuleDef = class(TPpuUnitDef)
|
|
TPpuModuleDef = class(TPpuUnitDef)
|
|
ModuleFlags: tmoduleflags;
|
|
ModuleFlags: tmoduleflags;
|
|
@@ -340,6 +341,11 @@ Begin
|
|
SetHasErrors;
|
|
SetHasErrors;
|
|
End;
|
|
End;
|
|
|
|
|
|
|
|
+procedure StrAppend(var st : string; const st2 : string);
|
|
|
|
+begin
|
|
|
|
+ st:=st+st2;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure tppudumpfile.RaiseAssertion(Code: Longint);
|
|
procedure tppudumpfile.RaiseAssertion(Code: Longint);
|
|
begin
|
|
begin
|
|
WriteError('Internal Error ' + ToStr(Code));
|
|
WriteError('Internal Error ' + ToStr(Code));
|
|
@@ -1580,13 +1586,15 @@ const
|
|
(mask:gcf_class; str:'Class'),
|
|
(mask:gcf_class; str:'Class'),
|
|
(mask:gcf_record; str:'Record')
|
|
(mask:gcf_record; str:'Record')
|
|
);
|
|
);
|
|
|
|
+
|
|
var
|
|
var
|
|
defstates : tdefstates;
|
|
defstates : tdefstates;
|
|
i, nb{, msgvalue}, mesgnb : longint;
|
|
i, nb{, msgvalue}, mesgnb : longint;
|
|
first : boolean;
|
|
first : boolean;
|
|
copy_size, min_size, tokenbufsize : longint;
|
|
copy_size, min_size, tokenbufsize : longint;
|
|
tokenbuf : pbyte;
|
|
tokenbuf : pbyte;
|
|
- tbi : longint;
|
|
|
|
|
|
+ tbi, last_col, new_col : longint;
|
|
|
|
+ last_line,new_line : dword;
|
|
// idtoken,
|
|
// idtoken,
|
|
token : ttoken;
|
|
token : ttoken;
|
|
// state : tmsgstate;
|
|
// state : tmsgstate;
|
|
@@ -1594,8 +1602,290 @@ var
|
|
len : sizeint;
|
|
len : sizeint;
|
|
wstring : widestring;
|
|
wstring : widestring;
|
|
astring : ansistring;
|
|
astring : ansistring;
|
|
|
|
+ linestr,genstr : string;
|
|
genconstr : tgenericconstraintflags;
|
|
genconstr : tgenericconstraintflags;
|
|
|
|
|
|
|
|
+ procedure dump_new_settings;
|
|
|
|
+(* tsettings = record
|
|
|
|
+ alignment : talignmentinfo;
|
|
|
|
+ globalswitches : tglobalswitches;
|
|
|
|
+ targetswitches : ttargetswitches;
|
|
|
|
+ moduleswitches : tmoduleswitches;
|
|
|
|
+ localswitches : tlocalswitches;
|
|
|
|
+ modeswitches : tmodeswitches;
|
|
|
|
+ optimizerswitches : toptimizerswitches;
|
|
|
|
+ { generate information necessary to perform these wpo's during a subsequent compilation }
|
|
|
|
+ genwpoptimizerswitches: twpoptimizerswitches;
|
|
|
|
+ { perform these wpo's using information generated during a previous compilation }
|
|
|
|
+ dowpoptimizerswitches: twpoptimizerswitches;
|
|
|
|
+ debugswitches : tdebugswitches;
|
|
|
|
+ { 0: old behaviour for sets <=256 elements
|
|
|
|
+ >0: round to this size }
|
|
|
|
+ setalloc,
|
|
|
|
+ packenum : shortint;
|
|
|
|
+
|
|
|
|
+ packrecords : shortint;
|
|
|
|
+ maxfpuregisters : shortint;
|
|
|
|
+
|
|
|
|
+ cputype,
|
|
|
|
+ optimizecputype,
|
|
|
|
+ asmcputype : tcputype;
|
|
|
|
+ fputype : tfputype;
|
|
|
|
+ asmmode : tasmmode;
|
|
|
|
+ interfacetype : tinterfacetypes;
|
|
|
|
+ defproccall : tproccalloption;
|
|
|
|
+ sourcecodepage : tstringencoding;
|
|
|
|
+
|
|
|
|
+ minfpconstprec : tfloattype;
|
|
|
|
+
|
|
|
|
+ disabledircache : boolean;
|
|
|
|
+
|
|
|
|
+ tlsmodel : ttlsmodel;
|
|
|
|
+
|
|
|
|
+{$if defined(i8086)}
|
|
|
|
+ x86memorymodel : tx86memorymodel;
|
|
|
|
+{$endif defined(i8086)}
|
|
|
|
+
|
|
|
|
+{$if defined(ARM)}
|
|
|
|
+ instructionset : tinstructionset;
|
|
|
|
+{$endif defined(ARM)}
|
|
|
|
+
|
|
|
|
+{$if defined(LLVM) and not defined(GENERIC_CPU)}
|
|
|
|
+ llvmversion: tllvmversion;
|
|
|
|
+{$endif defined(LLVM) and not defined(GENERIC_CPU)}
|
|
|
|
+
|
|
|
|
+ { CPU targets with microcontroller support can add a controller specific unit }
|
|
|
|
+ controllertype : tcontrollertype;
|
|
|
|
+
|
|
|
|
+ { WARNING: this pointer cannot be written as such in record token }
|
|
|
|
+ pmessage : pmessagestaterecord;
|
|
|
|
+ end; *)
|
|
|
|
+
|
|
|
|
+const
|
|
|
|
+ targetswitchname : array[ttargetswitch] of string[30] =
|
|
|
|
+ { global target-specific switches }
|
|
|
|
+ ('Target None', {ts_none}
|
|
|
|
+ { generate code that results in smaller TOCs than normal (AIX) }
|
|
|
|
+ 'Small TOC', {ts_small_toc}
|
|
|
|
+ { for the JVM target: generate integer array initializations via string
|
|
|
|
+ constants in order to reduce the generated code size (Java routines
|
|
|
|
+ are limited to 64kb of bytecode) }
|
|
|
|
+ 'JVM compact int array init', {ts_compact_int_array_init}
|
|
|
|
+ { for the JVM target: intialize enum fields in constructors with the
|
|
|
|
+ enum class instance corresponding to ordinal value 0 (not done by
|
|
|
|
+ default because this initialization can only be performed after the
|
|
|
|
+ inherited constructors have run, and if they call a virtual method
|
|
|
|
+ of the current class, then this virtual method may already have
|
|
|
|
+ initialized that field with another value and the constructor
|
|
|
|
+ initialization will result in data loss }
|
|
|
|
+ 'JVM enum field init', {ts_jvm_enum_field_init}
|
|
|
|
+ { when automatically generating getters/setters for properties, use
|
|
|
|
+ these strings as prefixes for the generated getters/setter names }
|
|
|
|
+ 'Auto getter prefix', {ts_auto_getter_prefix}
|
|
|
|
+ 'Auto setter prefix', {ts_auto_setter_predix}
|
|
|
|
+ 'Thumb interworking', {ts_thumb_interworking,}
|
|
|
|
+ { lowercase the first character of routine names, used to generate
|
|
|
|
+ names that are compliant with Java coding standards from code
|
|
|
|
+ written according to Delphi coding standards }
|
|
|
|
+ 'LowerCase proc start', {ts_lowercase_proc_start,}
|
|
|
|
+ { initialise local variables on the JVM target so you won't get
|
|
|
|
+ accidental uses of uninitialised values }
|
|
|
|
+ 'Init locals', {ts_init_locals}
|
|
|
|
+ { emit a CLD instruction before using the x86 string instructions }
|
|
|
|
+ 'Emit CLD instruction', {ts_cld}
|
|
|
|
+ { increment BP before pushing it in the function prologue and decrement
|
|
|
|
+ it after popping it in the function epilogue, iff the function is
|
|
|
|
+ going to terminate with a far ret. Thus, the BP value pushed on the
|
|
|
|
+ stack becomes odd if the function is far and even if the function is
|
|
|
|
+ near. This allows walking the BP chain on the stack and e.g.
|
|
|
|
+ obtaining a stack trace even if the program uses a mixture of near
|
|
|
|
+ and far calls. This is also required for Win16 real mode, because it
|
|
|
|
+ allows Windows to move code segments around (in order to defragment
|
|
|
|
+ memory) and then walk through the stacks of all running programs and
|
|
|
|
+ update the segment values of the segment that has moved. }
|
|
|
|
+ 'Use odd BP for far procs' {ts_x86_far_procs_push_odd_bp}
|
|
|
|
+ );
|
|
|
|
+ moduleswitchname : array[tmoduleswitch] of string[30] =
|
|
|
|
+ ('Module None', {cs_modulenone,}
|
|
|
|
+ { parser }
|
|
|
|
+ 'Floating Point Emulation',{ cs_fp_emulation}
|
|
|
|
+ 'Extended syntax', {cs_extsyntax}
|
|
|
|
+ 'Open string', {cs_openstring}
|
|
|
|
+ { support }
|
|
|
|
+ 'Goto allowed', {cs_support_goto}
|
|
|
|
+ 'Macro support', {cs_support_macro}
|
|
|
|
+ 'C operator support', {cs_support_c_operators}
|
|
|
|
+ { generation }
|
|
|
|
+ 'Profile', {cs_profile}
|
|
|
|
+ 'Debug information', {cs_debuginfo}
|
|
|
|
+ 'Compilation of System unit', {cs_compilesystem}
|
|
|
|
+ 'Line information', {cs_lineinfo}
|
|
|
|
+ 'Implicit exceptions', {cs_implicit_exceptions}
|
|
|
|
+ 'Explicit CodePage', {cs_explicit_codepage}
|
|
|
|
+ 'System CodePage', {cs_system_codepage}
|
|
|
|
+ { linking }
|
|
|
|
+ 'Create smart units', {cs_create_smart}
|
|
|
|
+ 'Create dynamic', {cs_create_dynamic}
|
|
|
|
+ 'Create PIC code', {cs_create_pic}
|
|
|
|
+ { browser switches are back }
|
|
|
|
+ 'Browser', {cs_browser}
|
|
|
|
+ 'Local Browser', {cs_local_browser}
|
|
|
|
+ { target specific }
|
|
|
|
+ 'Executable Stack', {cs_executable_stack}
|
|
|
|
+ { i8086 specific }
|
|
|
|
+ 'Hude code', {cs_huge_code}
|
|
|
|
+ 'Win16 smart callbacks', {cs_win16_smartcallbacks}
|
|
|
|
+ { Record usage of checkpointer experimental feature }
|
|
|
|
+ 'CheckPointer used' {cs_checkpointer_called}
|
|
|
|
+ );
|
|
|
|
+ globalswitchname : array[tglobalswitch] of string[50] =
|
|
|
|
+ ('Global None',{cs_globalnone}
|
|
|
|
+ { parameter switches }
|
|
|
|
+ 'Check unit name', {cs_check_unit_name}
|
|
|
|
+ 'Constructor name', {cs_constructor_name}
|
|
|
|
+ 'Support exceptions',{cs_support_exceptions}
|
|
|
|
+ 'Support Objective-C pas',{ cs_support_c_objectivepas}
|
|
|
|
+ 'Transparent file names', {cs_transparent_file_names}
|
|
|
|
+ { units }
|
|
|
|
+ 'Load Objpas Unit', {cs_load_objpas_unit}
|
|
|
|
+ 'Load GPC unit', {cs_load_gpc_unit}
|
|
|
|
+ 'Load FPCKylix unit', {cs_load_fpcylix_unit}
|
|
|
|
+ 'Support Vectors', {cs_support_vectors}
|
|
|
|
+ { debuginfo }
|
|
|
|
+ 'Use HeapTRc unit', {cs_use_heaptrc}
|
|
|
|
+ 'Use line information', {cs_use_lineinfo}
|
|
|
|
+ 'Use GDB Valgrind', {cs_gdb_valgrind}
|
|
|
|
+ 'No regalloc', {cs_no_regalloc}
|
|
|
|
+ 'Stabs preserve cases', {cs_stabs_preservecase}
|
|
|
|
+ { assembling }
|
|
|
|
+ 'Leave assembler file', {cs_asm_leave}
|
|
|
|
+ 'Use external assembler', {cs_asm_extern}
|
|
|
|
+ 'Use pipes to call assembler', {cs_asm_pipe}
|
|
|
|
+ 'Add source infos into assembler files', {cs_asm_source}
|
|
|
|
+ 'Add register allocation into assembler files', {cs_asm_regalloc}
|
|
|
|
+ 'Add temporary allocation into assmebler files', {cs_asm_tempalloc}
|
|
|
|
+ 'Add node information into assembler files', {cs_asm_nodes}
|
|
|
|
+ 'Adapt assembler call to GNU version <= 2.25', {cs_asm_pre_binutils_2_25}
|
|
|
|
+ { linking }
|
|
|
|
+ 'Skip linking stage', {cs_link_nolink}
|
|
|
|
+ 'Link static', {cs_link_static}
|
|
|
|
+ 'Link smart', {cs_link_smart}
|
|
|
|
+ 'Link shared', {cs_link_shared}
|
|
|
|
+ 'Link deffile', {cs_link_deffile}
|
|
|
|
+ 'Strip after linking', {cs_link_strip}
|
|
|
|
+ 'Use linker static flag',{cs_link_staticflag}
|
|
|
|
+ 'Link on target OS',{cs_link_on_target}
|
|
|
|
+ 'Use external linker', {cs_link_extern}
|
|
|
|
+ 'Link opt vtable', {cs_link_opt_vtable}
|
|
|
|
+ 'Link opt used sections', {cs_link_opt_used_sections}
|
|
|
|
+ 'Link debug to separate file',{cs_link_separate_dbg_file}
|
|
|
|
+ 'Create linker map', {cs_link_map}
|
|
|
|
+ 'Link to pthread', {cs_link_pthread}
|
|
|
|
+ 'Link no default lib order', {cs_link_no_default_lib_order}
|
|
|
|
+ 'Link using native linker', {cs_link_native}
|
|
|
|
+ 'Link for GNU linker version <=2.19', {cs_link_pre_binutils_2_19}
|
|
|
|
+ 'Link using vlink' {cs_link_vlink}
|
|
|
|
+ );
|
|
|
|
+ localswitchname : array[tlocalswitch] of string[50] =
|
|
|
|
+ { Switches which can be changed locally }
|
|
|
|
+ ('Local None', {cs_localnone}
|
|
|
|
+ { codegen }
|
|
|
|
+ 'Check overflow', {cs_check_overflow}
|
|
|
|
+ 'Check range', {cs_check_range}
|
|
|
|
+ 'Check object error', {cs_check_object}
|
|
|
|
+ 'Check I/O error', {cs_check_io}
|
|
|
|
+ 'Check stack', {cs_check_stack}
|
|
|
|
+ 'Check pointer', {cs_checkpointer}
|
|
|
|
+ 'Check ordinal size', {cs_check_ordinal_size}
|
|
|
|
+ 'Generate stackframes', {cs_generate_stackframes}
|
|
|
|
+ 'Do assertions', {cs_do_assertion}
|
|
|
|
+ 'Generate RTTI', {cs_generate_rtti}
|
|
|
|
+ 'Full boolean evaluaion', {cs_full_boolean_eval}
|
|
|
|
+ 'Typed constant are writable', {cs_typed_const_writable}
|
|
|
|
+ 'Allow calcuation on enum types', {cs_allow_enum_calc}
|
|
|
|
+ 'Do inline', {cs_do_inline}
|
|
|
|
+ 'Add FWAIT instruction for FPU 8087', {cs_fpu_fwait}
|
|
|
|
+ 'IEEE errors', {cs_ieee_errors}
|
|
|
|
+ 'Check low address loading', {cs_check_low_addr_load}
|
|
|
|
+ 'Imported data', {cs_imported_data}
|
|
|
|
+ 'Excess precision', {cs_excessprecision}
|
|
|
|
+ 'Check fpu exceptions', {cs_check_fpu_exceptions}
|
|
|
|
+ 'Check all case coverage', {cs_check_all_case_coverage}
|
|
|
|
+ { mmx }
|
|
|
|
+ 'Allow MMX instructions', {cs_mmx}
|
|
|
|
+ 'Use MMX saturation', {cs_mmx_saturation}
|
|
|
|
+ { parser }
|
|
|
|
+ 'Use typed addresses', {cs_typed_addresses}
|
|
|
|
+ 'Use strict var strings', {cs_strict_var_strings}
|
|
|
|
+ 'Use reference counted strings', {cs_refcountedstrings}
|
|
|
|
+ 'Use bit-packing', {cs_bitpacking}
|
|
|
|
+ 'Use var property setter', {cs_varpropsetter}
|
|
|
|
+ 'Use scoped enums',{cs_scopedenums}
|
|
|
|
+ 'Use pointer math', {cs_pointermath}
|
|
|
|
+ { macpas specific}
|
|
|
|
+ 'MACPAS exteranl variable', {cs_external_var}
|
|
|
|
+ 'MACPAS externally visible', {cs_externally_visible}
|
|
|
|
+ { jvm specific }
|
|
|
|
+ 'JVM check var copyout', {cs_check_var_copyout}
|
|
|
|
+ 'Zero based strings', {cs_zerobasedstrings}
|
|
|
|
+ { i8086 specific }
|
|
|
|
+ 'i8086 force FAR calls', {cs_force_far_calls}
|
|
|
|
+ 'i8086 huge pointer arithmetic', {cs_hugeptr_arithmetic_normalization}
|
|
|
|
+ 'i8086 huge pointer comparison' {cs_hugeptr_comparison_normalization}
|
|
|
|
+ );
|
|
|
|
+ var
|
|
|
|
+ globalswitch : tglobalswitch;
|
|
|
|
+ targetswitch : ttargetswitch;
|
|
|
|
+ moduleswitch : tmoduleswitch;
|
|
|
|
+ localswitch : tlocalswitch;
|
|
|
|
+ modeswitch : tmodeswitch;
|
|
|
|
+ optimizerswitch : toptimizerswitch;
|
|
|
|
+ begin
|
|
|
|
+ {alignment : talignmentinfo;}
|
|
|
|
+ {talignmentinfo = packed record}
|
|
|
|
+ writeln('Procedure alignment: '+tostr(new_settings.alignment.procalign));
|
|
|
|
+ writeln('Loop alignment: '+tostr(new_settings.alignment.loopalign));
|
|
|
|
+ { alignment for labels after unconditional jumps, this must be a power of two }
|
|
|
|
+ writeln('Jump alignment: '+tostr(new_settings.alignment.jumpalign));
|
|
|
|
+ { max. alignment for labels after unconditional jumps:
|
|
|
|
+ the compiler tries to align jumpalign, however, to do so it inserts at maximum jumpalignskipmax bytes or uses
|
|
|
|
+ the next smaller power of two of jumpalign }
|
|
|
|
+ writeln('Jump skip max alignment: '+tostr(new_settings.alignment.jumpalignskipmax));
|
|
|
|
+ { alignment for labels where two flows of the program flow coalesce, this must be a power of two }
|
|
|
|
+ writeln('Coalescence alignment: '+tostr(new_settings.alignment.coalescealign));
|
|
|
|
+ { max. alignment for labels where two flows of the program flow coalesce
|
|
|
|
+ the compiler tries to align to coalescealign, however, to do so it inserts at maximum coalescealignskipmax bytes or uses
|
|
|
|
+ the next smaller power of two of coalescealign }
|
|
|
|
+ writeln('Coalescence skip max alignment: '+tostr(new_settings.alignment.coalescealignskipmax));
|
|
|
|
+ writeln('Const min alignment: '+tostr(new_settings.alignment.constalignmin));
|
|
|
|
+ writeln('Const max alignment: '+tostr(new_settings.alignment.constalignmax));
|
|
|
|
+ writeln('Var min alignment: '+tostr(new_settings.alignment.varalignmin));
|
|
|
|
+ writeln('Var max alignment: '+tostr(new_settings.alignment.varalignmax));
|
|
|
|
+ writeln('Local min alignment: '+tostr(new_settings.alignment.localalignmin));
|
|
|
|
+ writeln('Local max alignment: '+tostr(new_settings.alignment.localalignmax));
|
|
|
|
+ writeln('Min record alignment: '+tostr(new_settings.alignment.recordalignmin));
|
|
|
|
+ writeln('Max record alignment: '+tostr(new_settings.alignment.recordalignmax));
|
|
|
|
+ writeln('Max C record alignment: '+tostr(new_settings.alignment.maxCrecordalign));
|
|
|
|
+ for globalswitch:=low(tglobalswitch) to high(tglobalswitch) do
|
|
|
|
+ if globalswitch in new_settings.globalswitches then
|
|
|
|
+ writeln('global switch: '+globalswitchname[globalswitch]);
|
|
|
|
+ for targetswitch:=low(ttargetswitch) to high(ttargetswitch) do
|
|
|
|
+ if targetswitch in new_settings.targetswitches then
|
|
|
|
+ writeln('target switch: '+targetswitchname[targetswitch]);
|
|
|
|
+ for moduleswitch:=low(tmoduleswitch) to high(tmoduleswitch) do
|
|
|
|
+ if moduleswitch in new_settings.moduleswitches then
|
|
|
|
+ writeln('module switch: '+moduleswitchname[moduleswitch]);
|
|
|
|
+ for localswitch:=low(tlocalswitch) to high(tlocalswitch) do
|
|
|
|
+ if localswitch in new_settings.localswitches then
|
|
|
|
+ writeln('local switch: '+localswitchname[localswitch]);
|
|
|
|
+ (* for modeswitch:=low(tmodeswitch) to high(tmodeswitch) do
|
|
|
|
+ if modeswitch in new_settings.modeswitches then
|
|
|
|
+ writeln('mode switch: '+modeswitchname[modeswitch]);
|
|
|
|
+ for optimizerswitch:=low(toptimizerswitch) to high(toptimizerswitch) do
|
|
|
|
+ if optimizerswitch in new_settings.optimizerswitches then
|
|
|
|
+ writeln('optimizer switch: '+optimizerswitchname[optimizerswitch]);*)
|
|
|
|
+ end;
|
|
|
|
+
|
|
function readtoken: ttoken;
|
|
function readtoken: ttoken;
|
|
var
|
|
var
|
|
b,b2 : byte;
|
|
b,b2 : byte;
|
|
@@ -1786,6 +2076,10 @@ begin
|
|
end;
|
|
end;
|
|
if df_generic in defoptions then
|
|
if df_generic in defoptions then
|
|
begin
|
|
begin
|
|
|
|
+ last_line:=0;
|
|
|
|
+ last_col:=0;
|
|
|
|
+ linestr:='';
|
|
|
|
+ genstr:='';
|
|
tokenbufsize:=ppufile.getlongint;
|
|
tokenbufsize:=ppufile.getlongint;
|
|
writeln([space,' Tokenbuffer size : ',tokenbufsize]);
|
|
writeln([space,' Tokenbuffer size : ',tokenbufsize]);
|
|
tokenbuf:=allocmem(tokenbufsize);
|
|
tokenbuf:=allocmem(tokenbufsize);
|
|
@@ -1798,7 +2092,12 @@ begin
|
|
if token<>_GENERICSPECIALTOKEN then
|
|
if token<>_GENERICSPECIALTOKEN then
|
|
begin
|
|
begin
|
|
if token <= high(ttoken) then
|
|
if token <= high(ttoken) then
|
|
- write(arraytokeninfo[token].str)
|
|
|
|
|
|
+ begin
|
|
|
|
+ write(arraytokeninfo[token].str);
|
|
|
|
+ if not (token in [_CWCHAR, _CWSTRING, _CSTRING, _CCHAR,
|
|
|
|
+ _INTCONST,_REALNUMBER, _ID]) then
|
|
|
|
+ StrAppend(linestr,lowercase(arraytokeninfo[token].str));
|
|
|
|
+ end
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
HasMoreInfos;
|
|
HasMoreInfos;
|
|
@@ -1814,7 +2113,10 @@ begin
|
|
len:=gettokenbufsizeint;
|
|
len:=gettokenbufsizeint;
|
|
setlength(wstring,len);
|
|
setlength(wstring,len);
|
|
move(tokenbuf[tbi],wstring[1],len*2);
|
|
move(tokenbuf[tbi],wstring[1],len*2);
|
|
- write([' ',wstring]);
|
|
|
|
|
|
+ write([' ''',wstring,'''']);
|
|
|
|
+ StrAppend(linestr,' ''');
|
|
|
|
+ StrAppend(linestr,wstring);
|
|
|
|
+ StrAppend(linestr,'''');
|
|
inc(tbi,len*2);
|
|
inc(tbi,len*2);
|
|
end;
|
|
end;
|
|
_CSTRING:
|
|
_CSTRING:
|
|
@@ -1823,19 +2125,31 @@ begin
|
|
setlength(astring,len);
|
|
setlength(astring,len);
|
|
if len>0 then
|
|
if len>0 then
|
|
move(tokenbuf[tbi],astring[1],len);
|
|
move(tokenbuf[tbi],astring[1],len);
|
|
- write([' ',astring]);
|
|
|
|
|
|
+ write([' ''',astring,'''']);
|
|
|
|
+ StrAppend(linestr,' ''');
|
|
|
|
+ StrAppend(linestr,astring);
|
|
|
|
+ StrAppend(linestr,'''');
|
|
inc(tbi,len);
|
|
inc(tbi,len);
|
|
end;
|
|
end;
|
|
- _CCHAR,
|
|
|
|
|
|
+ _CCHAR:
|
|
|
|
+ begin
|
|
|
|
+ write([' ''',unaligned(pshortstring(@tokenbuf[tbi])^),'''']);
|
|
|
|
+ StrAppend(linestr,' ''');
|
|
|
|
+ StrAppend(linestr,unaligned(pshortstring(@tokenbuf[tbi])^));
|
|
|
|
+ StrAppend(linestr,'''');
|
|
|
|
+ inc(tbi,tokenbuf[tbi]+1);
|
|
|
|
+ end;
|
|
_INTCONST,
|
|
_INTCONST,
|
|
_REALNUMBER :
|
|
_REALNUMBER :
|
|
begin
|
|
begin
|
|
write([' ',unaligned(pshortstring(@tokenbuf[tbi])^)]);
|
|
write([' ',unaligned(pshortstring(@tokenbuf[tbi])^)]);
|
|
|
|
+ StrAppend(linestr,unaligned(pshortstring(@tokenbuf[tbi])^));
|
|
inc(tbi,tokenbuf[tbi]+1);
|
|
inc(tbi,tokenbuf[tbi]+1);
|
|
end;
|
|
end;
|
|
_ID :
|
|
_ID :
|
|
begin
|
|
begin
|
|
write([' ',unaligned(pshortstring(@tokenbuf[tbi])^)]);
|
|
write([' ',unaligned(pshortstring(@tokenbuf[tbi])^)]);
|
|
|
|
+ StrAppend(linestr,unaligned(pshortstring(@tokenbuf[tbi])^));
|
|
inc(tbi,tokenbuf[tbi]+1);
|
|
inc(tbi,tokenbuf[tbi]+1);
|
|
end;
|
|
end;
|
|
_GENERICSPECIALTOKEN:
|
|
_GENERICSPECIALTOKEN:
|
|
@@ -1844,15 +2158,20 @@ begin
|
|
byte or $80 used }
|
|
byte or $80 used }
|
|
if (tokenbuf[tbi] and $80)<>0 then
|
|
if (tokenbuf[tbi] and $80)<>0 then
|
|
begin
|
|
begin
|
|
- write(['Col: ',tokenbuf[tbi] and $7f]);
|
|
|
|
|
|
+ new_col:=tokenbuf[tbi] and $7f;
|
|
|
|
+ write(['Col: ',new_col]);
|
|
|
|
+ if length(linestr)<new_col-1 then
|
|
|
|
+ StrAppend(linestr,StringOfChar(' ',new_col - 1 - length(linestr)));
|
|
inc(tbi);
|
|
inc(tbi);
|
|
|
|
+ last_col:=new_col;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
case tspecialgenerictoken(tokenbuf[tbi]) of
|
|
case tspecialgenerictoken(tokenbuf[tbi]) of
|
|
ST_LOADSETTINGS:
|
|
ST_LOADSETTINGS:
|
|
begin
|
|
begin
|
|
inc(tbi);
|
|
inc(tbi);
|
|
- write('Settings');
|
|
|
|
|
|
+ write('Settings: ');
|
|
|
|
+ fillchar(new_settings,sizeof(new_settings),#0);
|
|
{ This does not load pmessage pointer }
|
|
{ This does not load pmessage pointer }
|
|
new_settings.pmessage:=nil;
|
|
new_settings.pmessage:=nil;
|
|
{ TSettings size depends in target...
|
|
{ TSettings size depends in target...
|
|
@@ -1865,6 +2184,8 @@ begin
|
|
min_size:= sizeof(tsettings)-sizeof(pointer);
|
|
min_size:= sizeof(tsettings)-sizeof(pointer);
|
|
move(tokenbuf[tbi],new_settings, min_size);
|
|
move(tokenbuf[tbi],new_settings, min_size);
|
|
inc(tbi,copy_size);
|
|
inc(tbi,copy_size);
|
|
|
|
+ dump_new_settings;
|
|
|
|
+ writeln;
|
|
end;
|
|
end;
|
|
ST_LOADMESSAGES:
|
|
ST_LOADMESSAGES:
|
|
begin
|
|
begin
|
|
@@ -1882,26 +2203,48 @@ begin
|
|
ST_LINE:
|
|
ST_LINE:
|
|
begin
|
|
begin
|
|
inc(tbi);
|
|
inc(tbi);
|
|
- write(['Line: ',gettokenbufdword]);
|
|
|
|
|
|
+ new_line:=gettokenbufdword;
|
|
|
|
+ if (new_line<>last_line) then
|
|
|
|
+ begin
|
|
|
|
+ StrAppend(genstr,linestr+LineEnding);
|
|
|
|
+ linestr:='';
|
|
|
|
+ end;
|
|
|
|
+ write(['Line: ',new_line]);
|
|
|
|
+ last_line:=new_line;
|
|
end;
|
|
end;
|
|
ST_COLUMN:
|
|
ST_COLUMN:
|
|
begin
|
|
begin
|
|
inc(tbi);
|
|
inc(tbi);
|
|
- write(['Col: ',gettokenbufword]);
|
|
|
|
|
|
+ new_col:=gettokenbufword;
|
|
|
|
+ write(['Col: ',new_col]);
|
|
|
|
+ if length(linestr)<new_col - 1 then
|
|
|
|
+ StrAppend(linestr,StringOfChar(' ',new_col - 1 - length(linestr)));
|
|
|
|
+ last_col:=new_col;
|
|
end;
|
|
end;
|
|
ST_FILEINDEX:
|
|
ST_FILEINDEX:
|
|
begin
|
|
begin
|
|
inc(tbi);
|
|
inc(tbi);
|
|
|
|
+ StrAppend(genstr,linestr+LineEnding);
|
|
|
|
+ linestr:='';
|
|
write(['File: ',gettokenbufword]);
|
|
write(['File: ',gettokenbufword]);
|
|
end;
|
|
end;
|
|
|
|
+ else
|
|
|
|
+ begin
|
|
|
|
+ HasMoreInfos;
|
|
|
|
+ write('Error in Token List');
|
|
|
|
+ break;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
+ else ; { empty else to avoid warning }
|
|
end;
|
|
end;
|
|
|
|
|
|
if tbi<tokenbufsize then
|
|
if tbi<tokenbufsize then
|
|
write(',');
|
|
write(',');
|
|
end;
|
|
end;
|
|
writeln;
|
|
writeln;
|
|
|
|
+ StrAppend(genstr,linestr);
|
|
|
|
+ writeln(genstr);
|
|
freemem(tokenbuf);
|
|
freemem(tokenbuf);
|
|
end;
|
|
end;
|
|
if df_specialization in defoptions then
|
|
if df_specialization in defoptions then
|