Просмотр исходного кода

+ resourcestring implemented
+ start of longstring support

florian 26 лет назад
Родитель
Сommit
35f636dea1

+ 7 - 2
compiler/aasm.pas

@@ -282,7 +282,8 @@ type
       datasegment,codesegment,bsssegment,
       debuglist,consts,
       importssection,exportssection,
-      resourcesection,rttilist         : paasmoutput;
+      resourcesection,rttilist,
+      resourcestringlist         : paasmoutput;
     { asm symbol list }
       asmsymbollist : pasmsymbollist;
 
@@ -900,7 +901,11 @@ uses
 end.
 {
   $Log$
-  Revision 1.52  1999-07-03 00:26:01  peter
+  Revision 1.53  1999-07-22 09:37:28  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.52  1999/07/03 00:26:01  peter
     * ag386bin doesn't destroy the aasmoutput lists anymore
 
   Revision 1.51  1999/06/02 22:43:57  pierre

+ 6 - 1
compiler/ag386att.pas

@@ -799,6 +799,7 @@ unit ag386att;
       WriteTree(datasegment);
       WriteTree(consts);
       WriteTree(rttilist);
+      Writetree(resourcestringlist);
       WriteTree(bsssegment);
       Writetree(importssection);
       Writetree(exportssection);
@@ -816,7 +817,11 @@ unit ag386att;
 end.
 {
   $Log$
-  Revision 1.4  1999-07-18 10:19:38  florian
+  Revision 1.5  1999-07-22 09:37:29  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.4  1999/07/18 10:19:38  florian
     * made it compilable with Dlephi 4 again
     + fixed problem with large stack allocations on win32
 

+ 7 - 1
compiler/ag386bin.pas

@@ -862,6 +862,8 @@ unit ag386bin;
         addlist(datasegment);
         addlist(consts);
         addlist(rttilist);
+        if assigned(resourcestringlist) then
+          addlist(resourcestringlist);
         addlist(bsssegment);
         if assigned(importssection) then
           addlist(importssection);
@@ -906,7 +908,11 @@ unit ag386bin;
 end.
 {
   $Log$
-  Revision 1.18  1999-07-03 00:26:02  peter
+  Revision 1.19  1999-07-22 09:37:30  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.18  1999/07/03 00:26:02  peter
     * ag386bin doesn't destroy the aasmoutput lists anymore
 
   Revision 1.17  1999/06/10 23:52:34  pierre

+ 6 - 1
compiler/ag386int.pas

@@ -612,6 +612,7 @@ ait_stab_function_name : ;
       WriteTree(datasegment);
       WriteTree(consts);
       WriteTree(rttilist);
+      WriteTree(resourcestringlist);
       WriteTree(bsssegment);
       countlabelref:=true;
 
@@ -627,7 +628,11 @@ ait_stab_function_name : ;
 end.
 {
   $Log$
-  Revision 1.49  1999-07-18 14:47:19  florian
+  Revision 1.50  1999-07-22 09:37:31  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.49  1999/07/18 14:47:19  florian
     * bug 487 fixed, (inc(<property>) isn't allowed)
     * more fixes to compile with Delphi
 

+ 6 - 1
compiler/ag386nsm.pas

@@ -588,6 +588,7 @@ ait_stab_function_name : ;
       WriteTree(datasegment);
       WriteTree(consts);
       WriteTree(rttilist);
+      WriteTree(resourcestringlist);
       WriteTree(bsssegment);
       countlabelref:=true;
 
@@ -601,7 +602,11 @@ ait_stab_function_name : ;
 end.
 {
   $Log$
-  Revision 1.45  1999-07-18 14:47:20  florian
+  Revision 1.46  1999-07-22 09:37:33  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.45  1999/07/18 14:47:20  florian
     * bug 487 fixed, (inc(<property>) isn't allowed)
     * more fixes to compile with Delphi
 

+ 75 - 1
compiler/cg386cnv.pas

@@ -30,6 +30,7 @@ interface
       tree;
 
     procedure loadshortstring(p:ptree);
+    procedure loadlongstring(p:ptree);
     procedure loadansi2short(source,dest : ptree);
 
     procedure secondtypeconv(var p : ptree);
@@ -120,6 +121,75 @@ implementation
          end;
       end;
 
+    procedure loadlongstring(p:ptree);
+    {
+      Load a string, handles stringdef and orddef (char) types
+    }
+      var
+         r : preference;
+
+      begin
+         case p^.right^.resulttype^.deftype of
+            stringdef:
+              begin
+                 if (p^.right^.treetype=stringconstn) and
+                   (str_length(p^.right)=0) then
+                   exprasmlist^.concat(new(pai386,op_const_ref(
+                      A_MOV,S_L,0,newreference(p^.left^.location.reference))))
+                 else
+                   begin
+                     emitpushreferenceaddr(p^.left^.location.reference);
+                     emitpushreferenceaddr(p^.right^.location.reference);
+                     push_shortstring_length(p^.left);
+                     emitcall('FPC_LONGSTR_COPY');
+                     maybe_loadesi;
+                   end;
+              end;
+            orddef:
+              begin
+                 exprasmlist^.concat(new(pai386,op_const_ref(
+                    A_MOV,S_L,1,newreference(p^.left^.location.reference))));
+
+                 r:=newreference(p^.left^.location.reference);
+                 inc(r^.offset,4);
+
+                 if p^.right^.treetype=ordconstn then
+                   exprasmlist^.concat(new(pai386,op_const_ref(
+                      A_MOV,S_B,p^.right^.value,r)))
+                 else
+                   begin
+                      case p^.right^.location.loc of
+                         LOC_REGISTER,LOC_CREGISTER:
+                           begin
+                              exprasmlist^.concat(new(pai386,op_reg_ref(
+                                 A_MOV,S_B,p^.right^.location.register,r)));
+                              ungetregister(p^.right^.location.register);
+                           end;
+                         LOC_MEM,LOC_REFERENCE:
+                           begin
+                              if not(R_EAX in unused) then
+                                exprasmlist^.concat(new(pai386,op_reg(
+                                  A_PUSH,S_L,R_EAX)));
+                              exprasmlist^.concat(new(pai386,op_ref_reg(
+                                A_MOV,S_B,newreference(p^.right^.location.reference),R_AL)));
+                              exprasmlist^.concat(new(pai386,op_reg_ref(
+                                A_MOV,S_B,R_AL,r)));
+
+                              if not(R_EAX in unused) then
+                                exprasmlist^.concat(new(pai386,op_reg(
+                                   A_POP,S_L,R_EAX)));
+                              del_reference(p^.right^.location.reference);
+                           end
+                         else
+                           internalerror(20799);
+                        end;
+                   end;
+              end;
+         else
+           CGMessage(type_e_mismatch);
+         end;
+      end;
+
 
     procedure loadansi2short(source,dest : ptree);
       var
@@ -1392,7 +1462,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.78  1999-07-05 20:13:07  peter
+  Revision 1.79  1999-07-22 09:37:34  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.78  1999/07/05 20:13:07  peter
     * removed temp defines
 
   Revision 1.77  1999/07/04 16:37:08  florian

+ 36 - 2
compiler/cg386ld.pas

@@ -40,7 +40,7 @@ implementation
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       i386base,i386asm,
-      cgai386,tgeni386,cg386cnv;
+      cgai386,tgeni386,cg386cnv,cresstr;
 
 {*****************************************************************************
                              SecondLoad
@@ -54,6 +54,8 @@ implementation
          hp : preference;
          s : pasmsymbol;
          popeax : boolean;
+         pushed : tpushed;
+         hr : treference;
 
       begin
          simple_loadn:=true;
@@ -72,6 +74,31 @@ implementation
                     else
                      p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
                  end;
+              constsym:
+                begin
+                   if pconstsym(p^.symtableentry)^.consttype=constresourcestring then
+                     begin
+                         pushusedregisters(pushed,$ff);
+                         exprasmlist^.concat(new(pai386,op_const(A_PUSH,S_L,
+                         calc_resstring_hashvalue(pchar(pconstsym(p)^.value),
+                           pconstsym(p)^.len))));
+                         emitcall('FPC_GETRESOURCESTRING');
+
+                         hregister:=getexplicitregister32(R_EAX);
+                         emit_reg_reg(A_MOV,S_L,R_EAX,hregister);
+                         if gettempansistringreference(hr) then
+                           decrstringref(p^.resulttype,hr);
+                         exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV,S_L,hregister,
+                           newreference(hr))));
+                        ungetregister32(hregister);
+                        popusedregisters(pushed);
+
+                        p^.location.loc:=LOC_MEM;
+                        p^.location.reference:=hr;
+                     end
+                   else
+                     internalerror(22798);
+                end;
               varsym :
                  begin
                     hregister:=R_NO;
@@ -438,6 +465,9 @@ implementation
                        ungetiftemp(p^.right^.location.reference);
                     end;
                 end
+              else if is_longstring(p^.left^.resulttype) then
+                begin
+                end
               else
                 begin
                   { its the only thing we have to do }
@@ -834,7 +864,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.63  1999-07-05 20:13:12  peter
+  Revision 1.64  1999-07-22 09:37:37  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.63  1999/07/05 20:13:12  peter
     * removed temp defines
 
   Revision 1.62  1999/06/30 15:43:18  florian

+ 15 - 5
compiler/cgai386.pas

@@ -69,7 +69,6 @@ unit cgai386;
 
     procedure copyshortstring(const dref,sref : treference;len : byte;loadref:boolean);
     procedure loadansistring(p : ptree);
-    procedure loadshort2ansi(source,dest : ptree);
 
     procedure finalize(t : pdef;const ref : treference;is_already_ref : boolean);
     procedure decrstringref(t : pdef;const ref : treference);
@@ -665,12 +664,19 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
          maybe_loadesi;
       end;
 
-
-    procedure loadshort2ansi(source,dest : ptree);
-
+    procedure copylongstring(const dref,sref : treference;len : longint;loadref:boolean);
       begin
+         emitpushreferenceaddr(dref);
+         if loadref then
+          emit_push_mem(sref)
+         else
+          emitpushreferenceaddr(sref);
+         push_int(len);
+         emitcall('FPC_LONGSTR_COPY');
+         maybe_loadesi;
       end;
 
+
     procedure decrstringref(t : pdef;const ref : treference);
 
       var
@@ -3110,7 +3116,11 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
 end.
 {
   $Log$
-  Revision 1.16  1999-07-18 10:41:59  florian
+  Revision 1.17  1999-07-22 09:37:38  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.16  1999/07/18 10:41:59  florian
     * fix of my previous commit nevertheless it doesn't work completly
 
   Revision 1.15  1999/07/18 10:19:44  florian

+ 1 - 0
compiler/errore.msg

@@ -757,6 +757,7 @@ parser_e_cant_use_inittable_here=E_Data types which requires initialization/fina
 % Some data type (e.g. \var{ansistring}) needs initialization/finalization
 % code which is implicitly generated by the compiler. Such data types
 % can't be used in the variant part of a record.
+parser_e_resourcestring_only_sg=E_Resourcestrings can be only static or global
 % \end{description}
 #
 # Type Checking

+ 7 - 1
compiler/hcodegen.pas

@@ -277,6 +277,8 @@ implementation
           dispose(exportssection,done);
          if assigned(resourcesection) then
           dispose(resourcesection,done);
+         if assigned(resourcestringlist) then
+          dispose(resourcestringlist,done);
          dispose(asmsymbollist,done);
       end;
 
@@ -296,7 +298,11 @@ end.
 
 {
   $Log$
-  Revision 1.33  1999-05-27 19:44:31  peter
+  Revision 1.34  1999-07-22 09:37:42  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.33  1999/05/27 19:44:31  peter
     * removed oldasm
     * plabel -> pasmlabel
     * -a switches to source writing automaticly

+ 1 - 0
compiler/msgidx.inc

@@ -201,6 +201,7 @@ type tmsgconst=(
   parser_w_no_objpas_use_mode,
   parser_e_no_object_override,
   parser_e_cant_use_inittable_here,
+  parser_e_resourcestring_only_sg,
   type_e_mismatch,
   type_e_incompatible_types,
   type_e_not_equal_types,

+ 130 - 129
compiler/msgtxt.inc

@@ -1,7 +1,7 @@
 {$ifdef Delphi}
-const msgtxt : array[0..000097] of string[240]=(
+const msgtxt : array[0..000098] of string[240]=(
 {$else Delphi}
-const msgtxt : array[0..000097,1..240] of char=(
+const msgtxt : array[0..000098,1..240] of char=(
 {$endif Delphi}
   'T_Compiler: $1'#000+
   'D_Compiler OS: $1'#000+
@@ -215,49 +215,50 @@ const msgtxt : array[0..000097,1..240] of char=(
   'E_OVERRIDE can'#039't be used in objects'#000+
   'E_Data types which requ','ires initialization/finalization can'#039't be'+
   ' used in variant records'#000+
+  'E_Resourcestrings can be only static or global'#000+
   'E_Type mismatch'#000+
   'E_Incompatible types: got "$1" expected "$2"'#000+
   'E_Type mismatch between $1 and $2'#000+
   'E_Integer expression expected'#000+
-  'E_Ordinal expression expected'#000+
-  'E_Type identifier e','xpected'#000+
+  'E_','Ordinal expression expected'#000+
+  'E_Type identifier expected'#000+
   'E_Variable identifier expected'#000+
   'E_pointer type expected'#000+
   'E_class type expected'#000+
   'E_Variable or type indentifier expected'#000+
   'E_Can'#039't evaluate constant expression'#000+
-  'E_Set elements are not compatible'#000+
+  'E_Set elements are not compatib','le'#000+
   'E_Operation not implemented for sets'#000+
-  'W_Autom','atic type conversion from floating type to COMP which is an i'+
-  'nteger type'#000+
+  'W_Automatic type conversion from floating type to COMP which is an int'+
+  'eger type'#000+
   'H_use DIV instead to get an integer result'#000+
   'E_string types doesn'#039't match, because of $V+ mode'#000+
-  'E_succ or pred on enums with assignments not possible'#000+
-  'E_Can'#039't read or writ','e variables of this type'#000+
+  'E_succ or pred on enums wit','h assignments not possible'#000+
+  'E_Can'#039't read or write variables of this type'#000+
   'E_Type conflict between set elements'#000+
   'W_lo/hi(dword/qword) returns the upper/lower word/dword'#000+
   'E_Integer or real expression expected'#000+
   'E_Wrong type in array constructor'#000+
-  'E_Incompatible type for arg no. $1: Got $2, expect','ed $3'#000+
+  'E_I','ncompatible type for arg no. $1: Got $2, expected $3'#000+
   'E_Method (variable) and Procedure (variable) are not compatible'#000+
   'E_Illegal constant passed to internal math function'#000+
   'E_Can'#039't get the address of constants'#000+
   'E_Argument must be l-value'#000+
-  'E_Identifier not found $1'#000+
-  'F_Internal Error in SymTable','Stack()'#000+
+  'E_Ident','ifier not found $1'#000+
+  'F_Internal Error in SymTableStack()'#000+
   'E_Duplicate identifier $1'#000+
   'H_Identifier already defined in $1 at line $2'#000+
   'E_Unknown identifier $1'#000+
   'E_Forward declaration not solved $1'#000+
   'F_Identifier type already defined as type'#000+
-  'E_Error in type definition'#000+
+  'E_Error in ','type definition'#000+
   'E_Type identifier not defined'#000+
-  'E','_Forward type not resolved $1'#000+
+  'E_Forward type not resolved $1'#000+
   'E_Only static variables can be used in static methods or outside metho'+
   'ds'#000+
   'E_Invalid call to tvarsym.mangledname()'#000+
   'F_record or class type expected'#000+
-  'E_Instances of classes or objects with an abstract method are not',' al'+
+  'E_Instances of cla','sses or objects with an abstract method are not al'+
   'lowed'#000+
   'W_Label not defined $1'#000+
   'E_Illegal label declaration'#000+
@@ -265,172 +266,172 @@ const msgtxt : array[0..000097,1..240] of char=(
   'E_Label not found'#000+
   'E_identifier isn'#039't a label'#000+
   'E_label already defined'#000+
-  'E_illegal type declaration of set elements'#000+
-  'E_Forward class ','definition not resolved $1'#000+
+  'E_illegal ty','pe declaration of set elements'#000+
+  'E_Forward class definition not resolved $1'#000+
   'H_Parameter not used $1'#000+
   'N_Local variable not used $1'#000+
   'E_Set type expected'#000+
   'W_Function result does not seem to be set'#000+
   'E_Unknown record field identifier $1'#000+
-  'W_Local variable $1 does not seem to be initialized'#000+
-  'W_Variabl','e $1 does not seem to be initialized'#000+
+  'W_Local variab','le $1 does not seem to be initialized'#000+
+  'W_Variable $1 does not seem to be initialized'#000+
   'E_identifier idents no member $1'#000+
   'B_Found declaration: $1'#000+
   'E_BREAK not allowed'#000+
   'E_CONTINUE not allowed'#000+
   'E_Expression too complicated - FPU stack overflow'#000+
-  'E_Illegal expression'#000+
+  'E_Ille','gal expression'#000+
   'E_Invalid integer expression'#000+
-  'E_I','llegal qualifier'#000+
+  'E_Illegal qualifier'#000+
   'E_High range limit < low range limit'#000+
   'E_Illegal counter variable'#000+
   'E_Can'#039't determine which overloaded function to call'#000+
   'E_Parameter list size exceeds 65535 bytes'#000+
-  'E_Illegal type conversion'#000+
-  'D_Conversion between ordinals and point','ers is not portable across pl'+
-  'atforms'#000+
+  'E_Illegal type con','version'#000+
+  'D_Conversion between ordinals and pointers is not portable across plat'+
+  'forms'#000+
   'E_File types must be var parameters'#000+
   'E_The use of a far pointer isn'#039't allowed there'#000+
   'E_illegal call by reference parameters'#000+
-  'E_EXPORT declared functions can'#039't be called'#000+
-  'W_Possible illegal call of constructo','r or destructor (doesn'#039't ma'+
-  'tch to this context)'#000+
+  'E_EXPORT declared functions can'#039't ','be called'#000+
+  'W_Possible illegal call of constructor or destructor (doesn'#039't matc'+
+  'h to this context)'#000+
   'N_Inefficient code'#000+
   'W_unreachable code'#000+
   'E_procedure call with stackframe ESP/SP'#000+
   'E_Abstract methods can'#039't be called directly'#000+
-  'F_Internal Error in getfloatreg(), allocation failure'#000+
-  'F_Unknown float ','type'#000+
+  'F_Internal Error in get','floatreg(), allocation failure'#000+
+  'F_Unknown float type'#000+
   'F_SecondVecn() base defined twice'#000+
   'F_Extended cg68k not supported'#000+
   'F_32-bit unsigned not supported in MC68000 mode'#000+
   'F_Internal Error in secondinline()'#000+
   'D_Register $1 weight $2 $3'#000+
-  'E_Stack limit excedeed in local routine'#000+
-  'D_Stack frame is omi','tted'#000+
+  'E_Stack limit',' excedeed in local routine'#000+
+  'D_Stack frame is omitted'#000+
   'E_Object or class methods can'#039't be inline.'#000+
   'E_Procvar calls can'#039't be inline.'#000+
   'E_No code for inline procedure stored'#000+
   'E_Element zero of an ansi/wide- or longstring can'#039't be accessed, u'+
-  'se (set)length instead'#000+
-  'E_Include and exclude not implem','ented in this case'#000+
+  'se (set)','length instead'#000+
+  'E_Include and exclude not implemented in this case'#000+
   'E_Constructors or destructors can not be called inside a '#039'with'#039+
   ' clause'#000+
   'E_Cannot call message handler method directly'#000+
   'D_Starting $1 styled assembler parsing'#000+
-  'D_Finished $1 styled assembler parsing'#000+
-  'E_Non-label pattern contai','ns @'#000+
+  'D_Finished $1 styl','ed assembler parsing'#000+
+  'E_Non-label pattern contains @'#000+
   'W_Override operator not supported'#000+
   'E_Error building record offset'#000+
   'E_OFFSET used without identifier'#000+
   'E_Cannot use local variable or parameters here'#000+
   'E_need to use OFFSET here'#000+
-  'E_Cannot use multiple relocatable symbols'#000+
-  'E_Relocatable symbol c','an only be added'#000+
+  'E_Cannot use mult','iple relocatable symbols'#000+
+  'E_Relocatable symbol can only be added'#000+
   'E_Invalid constant expression'#000+
   'E_Relocatable symbol is not allowed'#000+
   'E_Invalid reference syntax'#000+
   'E_Local symbols not allowed as references'#000+
   'E_Invalid base and index register usage'#000+
-  'E_Wrong scale factor specified'#000+
-  'E_Multiple index ','register usage'#000+
+  'E','_Wrong scale factor specified'#000+
+  'E_Multiple index register usage'#000+
   'E_Invalid operand type'#000+
   'E_Invalid string as opcode operand: $1'#000+
   'W_@CODE and @DATA not supported'#000+
   'E_Null label references are not allowed'#000+
   'F_Divide by zero in asm evaluator'#000+
-  'F_Evaluator stack overflow'#000+
+  'F_Evaluato','r stack overflow'#000+
   'F_Evaluator stack underflow'#000+
-  'F_','Invalid numeric format in asm evaluator'#000+
+  'F_Invalid numeric format in asm evaluator'#000+
   'F_Invalid Operator in asm evaluator'#000+
   'E_escape sequence ignored: $1'#000+
   'E_Invalid symbol reference'#000+
   'W_Fwait can cause emulation problems with emu387'#000+
-  'W_Calling an overload function in assembler'#000+
-  'E_Unsupported ','symbol type for operand'#000+
+  'W_Calling a','n overload function in assembler'#000+
+  'E_Unsupported symbol type for operand'#000+
   'E_Constant value out of bounds'#000+
   'E_Error converting decimal $1'#000+
   'E_Error converting octal $1'#000+
   'E_Error converting binary $1'#000+
   'E_Error converting hexadecimal $1'#000+
-  'H_$1 translated to $2'#000+
-  'W_$1 is associated to an overloaded functi','on'#000+
+  'H_$1 translated t','o $2'#000+
+  'W_$1 is associated to an overloaded function'#000+
   'E_Cannot use SELF outside a method'#000+
   'E_Cannot use OLDEBP outside a nested procedure'#000+
   'W_Functions with void return value can'#039't return any value in asm c'+
   'ode'#000+
   'E_SEG not supported'#000+
-  'E_Size suffix and destination or source size do not match'#000+
-  'W_Size ','suffix and destination or source size do not match'#000+
+  'E_Size suffix and ','destination or source size do not match'#000+
+  'W_Size suffix and destination or source size do not match'#000+
   'E_Assembler syntax error'#000+
   'E_Invalid combination of opcode and operands'#000+
   'E_Assemler syntax error in operand'#000+
   'E_Assemler syntax error in constant'#000+
-  'E_Invalid String expression'#000+
-  '32bit constant creat','ed for address'#000+
+  'E','_Invalid String expression'#000+
+  '32bit constant created for address'#000+
   'E_Invalid or missing opcode'#000+
   'E_Invalid combination of prefix and opcode: $1'#000+
   'E_Invalid combination of override and opcode: $1'#000+
   'E_Too many operands on line'#000+
   'W_NEAR ignored'#000+
-  'W_FAR ignored'#000+
+  'W_FAR ignor','ed'#000+
   'E_Duplicate local symbol $1'#000+
-  'E_Undefined loca','l symbol $1'#000+
+  'E_Undefined local symbol $1'#000+
   'E_Unknown label identifier $1'#000+
   'E_Invalid floating point register name'#000+
   'E_NOR not supported'#000+
   'W_Modulo not supported'#000+
   'E_Invalid floating point constant $1'#000+
-  'E_Invalid floating point expression'#000+
+  'E_Invalid floating point express','ion'#000+
   'E_Wrong symbol type'#000+
-  'E_Cannot index a local ','var or parameter with a register'#000+
+  'E_Cannot index a local var or parameter with a register'#000+
   'E_Invalid segment override expression'#000+
   'W_Identifier $1 supposed external'#000+
   'E_Strings not allowed as constants'#000+
   'No type of variable specified'#000+
-  'E_assembler code not returned to text section'#000+
-  'E_Not a directive or loc','al symbol $1'#000+
+  'E_assembler code not re','turned to text section'#000+
+  'E_Not a directive or local symbol $1'#000+
   'E_Using a defined name as a local label'#000+
   'F_Too many assembler files'#000+
   'F_Selected assembler output not supported'#000+
   'F_Comp not supported'#000+
   'F_Direct not support for binary writers'#000+
-  'E_Allocating of data is only allowed in bss section'#000+
-  'F_No ','binary writer selected'#000+
+  'E_Allocati','ng of data is only allowed in bss section'#000+
+  'F_No binary writer selected'#000+
   'E_Asm: Opcode $1 not in table'#000+
   'E_Asm: $1 invalid combination of opcode and operands'#000+
   'E_Asm: 16 Bit references not supported'#000+
   'E_Asm: Invalid effective address'#000+
-  'E_Asm: Immediate or reference expected'#000+
-  'E_Asm: $1 value exceeds',' bounds $2'#000+
+  'E_Asm: Immediat','e or reference expected'#000+
+  'E_Asm: $1 value exceeds bounds $2'#000+
   'E_Asm: Short jump is out of range $1'#000+
   'W_Source operating system redefined'#000+
   'I_Assembling (pipe) $1'#000+
   'E_Can'#039't create assember file $1'#000+
-  'W_Assembler $1 not found, switching to external assembling'#000+
+  'W_Assembler $1 not found, switching to external assemb','ling'#000+
   'T_Using assembler: $1'#000+
-  'W_Error while assemb','ling exitcode $1'#000+
+  'W_Error while assembling exitcode $1'#000+
   'W_Can'#039't call the assembler, error $1 switching to external assembl'+
   'ing'#000+
   'I_Assembling $1'#000+
   'I_Assembling smartlink $1'#000+
   'W_Linker $1 not found, switching to external linking'#000+
-  'T_Using linker: $1'#000+
-  'W_Object $1 not found, Linking may fail',' !'#000+
+  'T_Using lin','ker: $1'#000+
+  'W_Object $1 not found, Linking may fail !'#000+
   'W_Library $1 not found, Linking may fail !'#000+
   'W_Error while linking'#000+
   'W_Can'#039't call the linker, switching to external linking'#000+
   'I_Linking $1'#000+
   'W_binder not found, switching to external binding'#000+
-  'W_ar not found, switching to external ar'#000+
-  'E_Dynamic Lib','raries not supported'#000+
+  'W_ar no','t found, switching to external ar'#000+
+  'E_Dynamic Libraries not supported'#000+
   'I_Closing script $1'#000+
   'W_resource compiler not found, switching to external mode'#000+
   'I_Compiling resource $1'#000+
   'F_Can'#039't post process executable $1'#000+
   'F_Can'#039't open executable $1'#000+
-  'X_Size of Code: $1 bytes'#000+
-  'X_Size of initialized data: $1',' bytes'#000+
+  'X_Size o','f Code: $1 bytes'#000+
+  'X_Size of initialized data: $1 bytes'#000+
   'X_Size of uninitialized data: $1 bytes'#000+
   'X_Stack space reserved: $1 bytes'#000+
   'X_Stack space commited: $1 bytes'#000+
@@ -439,206 +440,206 @@ const msgtxt : array[0..000097,1..240] of char=(
   'U_PPU Name: $1'#000+
   'U_PPU Flags: $1'#000+
   'U_PPU Crc: $1'#000+
-  'U_PPU Time: $1'#000+
+  'U_','PPU Time: $1'#000+
   'U_PPU File too short'#000+
-  'U_PPU Invalid',' Header (no PPU at the begin)'#000+
+  'U_PPU Invalid Header (no PPU at the begin)'#000+
   'U_PPU Invalid Version $1'#000+
   'U_PPU is compiled for an other processor'#000+
   'U_PPU is compiled for an other target'#000+
   'U_PPU Source: $1'#000+
   'U_Writing $1'#000+
   'F_Can'#039't Write PPU-File'#000+
-  'F_reading PPU-File'#000+
+  'F_read','ing PPU-File'#000+
   'F_unexpected end of PPU-File'#000+
-  'F_Inv','alid PPU-File entry: $1'#000+
+  'F_Invalid PPU-File entry: $1'#000+
   'F_PPU Dbx count problem'#000+
   'E_Illegal unit name: $1'#000+
   'F_Too much units'#000+
   'F_Circular unit reference between $1 and $2'#000+
   'F_Can'#039't compile unit $1, no sources available'#000+
-  'F_Can'#039't find unit $1'#000+
-  'W_Compiling the system unit requires the',' -Us switch'#000+
+  'F_Can'#039't find u','nit $1'#000+
+  'W_Compiling the system unit requires the -Us switch'#000+
   'F_There were $1 errors compiling module, stopping'#000+
   'U_Load from $1 ($2) unit $3'#000+
   'U_Recompiling $1, checksum changed for $2'#000+
   'U_Recompiling $1, source found only'#000+
-  'U_Recompiling unit, static lib is older than ppufile'#000+
-  'U_Recompiling unit,',' shared lib is older than ppufile'#000+
+  'U_Recompiling unit, stati','c lib is older than ppufile'#000+
+  'U_Recompiling unit, shared lib is older than ppufile'#000+
   'U_Recompiling unit, obj and asm are older than ppufile'#000+
   'U_Recompiling unit, obj is older than asm'#000+
   'U_Parsing interface of $1'#000+
   'U_Parsing implementation of $1'#000+
-  'U_Second load for unit $1'#000+
-  'U_PPU Check file $1 time $','2'#000+
+  'U_Sec','ond load for unit $1'#000+
+  'U_PPU Check file $1 time $2'#000+
   '$1 [options] <inputfile> [options]'#000+
   'W_Only one source file supported'#000+
   'W_DEF file can be created only for OS/2'#000+
   'E_nested response files are not supported'#000+
   'F_No source file name in command line'#000+
-  'E_Illegal parameter: $1'#000+
+  'E_I','llegal parameter: $1'#000+
   'H_-? writes help pages'#000+
-  'F_T','oo many config files nested'#000+
+  'F_Too many config files nested'#000+
   'F_Unable to open file $1'#000+
   'N_Reading further options from $1'#000+
   'W_Target is already set to: $1'#000+
   'W_Shared libs not supported on DOS platform, reverting to static'#000+
-  'F_too many IF(N)DEFs'#000+
+  'F_too many',' IF(N)DEFs'#000+
   'F_too many ENDIFs'#000+
-  'F_open conditional',' at the end of the file'#000+
+  'F_open conditional at the end of the file'#000+
   'W_Debug information generation is not supported by this executable'#000+
   'H_Try recompiling with -dGDB'#000+
   'E_You are using the obsolete switch $1'#000+
-  'E_You are using the obsolete switch $1, please use $2'#000+
-  'N_Switching assembler to de','fault source writing assembler'#000+
+  'E_You are using the obsolete switc','h $1, please use $2'#000+
+  'N_Switching assembler to default source writing assembler'#000+
   'Free Pascal Compiler version $FPCVER [$FPCDATE] for $FPCTARGET'#000+
   'Copyright (c) 1993-98 by Florian Klaempfl'#000+
   'Free Pascal Compiler version $FPCVER'#000+
   #000+
-  'Compiler Date  : $FPCDATE'#000+
+  'Compiler Date  : $F','PCDATE'#000+
   'Compiler Target: $FPCTARGET'#000+
   #000+
-  'This progra','m comes under the GNU General Public Licence'#000+
+  'This program comes under the GNU General Public Licence'#000+
   'For more information read COPYING.FPC'#000+
   #000+
   'Report bugs,suggestions etc to:'#000+
   '                 [email protected]'#000+
-  '**0*_put + after a boolean switch option to enable it, - to disable it'+
-  #000+
-  '**','1a_the compiler doesn'#039't delete the generated assembler file'#000+
+  '**0*_put + after a boolean',' switch option to enable it, - to disable '+
+  'it'#000+
+  '**1a_the compiler doesn'#039't delete the generated assembler file'#000+
   '**2al_list sourcecode lines in assembler file'#000+
   '**2ar_list register allocation/release info in assembler file'#000+
-  '**2at_list temp allocation/release info in assembler file'#000+
-  '**1b_generate ','browser info'#000+
+  '**2at_list temp allocatio','n/release info in assembler file'#000+
+  '**1b_generate browser info'#000+
   '**2bl_generate local symbol info'#000+
   '**1B_build all modules'#000+
   '**1C<x>_code generation options:'#000+
   '3*2CD_create dynamic library'#000+
   '**2Ch<n>_<n> bytes heap (between 1023 and 67107840)'#000+
-  '**2Ci_IO-checking'#000+
+  '**2Ci_IO-c','hecking'#000+
   '**2Cn_omit linking stage'#000+
-  '**2Co_check ov','erflow of integer operations'#000+
+  '**2Co_check overflow of integer operations'#000+
   '**2Cr_range checking'#000+
   '**2Cs<n>_set stack size to <n>'#000+
   '**2Ct_stack checking'#000+
   '3*2CS_create static library'#000+
   '3*2Cx_use smartlinking'#000+
   '**1d<x>_defines the symbol <x>'#000+
-  '*O1D_generate a DEF file'#000+
-  '*O2Dd<x>_set description to <x>',#000+
+  '*O1D_gene','rate a DEF file'#000+
+  '*O2Dd<x>_set description to <x>'#000+
   '*O2Dw_PM application'#000+
   '**1e<x>_set path to executable'#000+
   '**1E_same as -Cn'#000+
   '**1F<x>_set file names and paths:'#000+
   '**2FD<x>_sets the directory where to search for compiler utilities'#000+
-  '**2Fe<x>_redirect error output to <x>'#000+
-  '**2FE<x>_set exe/unit output pa','th to <x>'#000+
+  '**2Fe<x>_redirect erro','r output to <x>'#000+
+  '**2FE<x>_set exe/unit output path to <x>'#000+
   '**2Fi<x>_adds <x> to include path'#000+
   '**2Fl<x>_adds <x> to library path'#000+
   '*L2FL<x>_uses <x> as dynamic linker'#000+
   '**2Fo<x>_adds <x> to object path'#000+
   '**2Fr<x>_load error message file <x>'#000+
-  '**2Fu<x>_adds <x> to unit path'#000+
-  '**2FU<x>_set unit output ','path to <x>, overrides -FE'#000+
+  '**2Fu<x>_','adds <x> to unit path'#000+
+  '**2FU<x>_set unit output path to <x>, overrides -FE'#000+
   '*g1g<x>_generate debugger information:'#000+
   '*g2gg_use gsym'#000+
   '*g2gd_use dbx'#000+
   '*g2gh_use heap trace unit'#000+
   '*g2gc_generate checks for pointers'#000+
   '**1i_information'#000+
-  '**2iD_return compiler date'#000+
+  '**2iD_return compile','r date'#000+
   '**2iV_return compiler version'#000+
-  '**2iSO_ret','urn compiler OS'#000+
+  '**2iSO_return compiler OS'#000+
   '**2iSP_return compiler processor'#000+
   '**2iTO_return target OS'#000+
   '**2iTP_return target processor'#000+
   '**1I<x>_adds <x> to include path'#000+
   '**1k<x>_Pass <x> to the linker'#000+
   '**1l_write logo'#000+
-  '**1n_don'#039't read the default config file'#000+
-  '**1o<x>_change t','he name of the executable produced to <x>'#000+
+  '**1n_don'#039,'t read the default config file'#000+
+  '**1o<x>_change the name of the executable produced to <x>'#000+
   '**1pg_generate profile code for gprof'#000+
   '*L1P_use pipes instead of creating temporary assembler files'#000+
   '**1S<x>_syntax options:'#000+
-  '**2S2_switch some Delphi 2 extensions on'#000+
-  '**2Sc_supports operators like C (*','=,+=,/= and -=)'#000+
+  '**2S2_switch some Delphi 2 e','xtensions on'#000+
+  '**2Sc_supports operators like C (*=,+=,/= and -=)'#000+
   '**2Sd_tries to be Delphi compatible'#000+
   '**2Se<x>_compiler stops after the <x> errors (default is 1)'#000+
   '**2Sg_allow LABEL and GOTO'#000+
   '**2Sh_Use ansistrings'#000+
-  '**2Si_support C++ styled INLINE'#000+
+  '**2Si_support C++ styled INLINE'#000,
   '**2Sm_support macros like C (global)'#000+
-  '**2So_trie','s to be TP/BP 7.0 compatible'#000+
+  '**2So_tries to be TP/BP 7.0 compatible'#000+
   '**2Sp_tries to be gpc compatible'#000+
   '**2Ss_constructor name must be init (destructor must be done)'#000+
   '**2St_allow static keyword in objects'#000+
-  '**1s_don'#039't call assembler and linker (only with -a)'#000+
-  '**1u<x>_undefines the symb','ol <x>'#000+
+  '**1s_don'#039't call assembler and l','inker (only with -a)'#000+
+  '**1u<x>_undefines the symbol <x>'#000+
   '**1U_unit options:'#000+
   '**2Un_don'#039't check the unit name'#000+
   '**2Us_compile a system unit'#000+
   '**1v<x>_Be verbose. <x> is a combination of the following letters:'#000+
-  '**2*_e : Show errors (default)       d : Show debug info'#000+
-  '**2*_w : Show warnings        ','       u : Show unit info'#000+
+  '**2*_e : Show errors (default)       d :',' Show debug info'#000+
+  '**2*_w : Show warnings               u : Show unit info'#000+
   '**2*_n : Show notes                  t : Show tried/used files'#000+
   '**2*_h : Show hints                  m : Show defined macros'#000+
-  '**2*_i : Show general info           p : Show compiled procedures'#000+
-  '**2*_l : Show linenumber','s            c : Show conditionals'#000+
+  '**2*_i : Show general info           p : Sh','ow compiled procedures'#000+
+  '**2*_l : Show linenumbers            c : Show conditionals'#000+
   '**2*_a : Show everything             0 : Show nothing (except errors)'#000+
   '**2*_b : Show all procedure          r : Rhide/GCC compatibility mode'#000+
-  '**2*_    declarations if an error    x : Executable info (Win32 o','nly'+
+  '**2*_    declarati','ons if an error    x : Executable info (Win32 only'+
   ')'#000+
   '**2*_    occurs'#000+
   '**1X_executable options:'#000+
   '*L2Xc_link with the c library'#000+
   '**2XD_link with dynamic libraries (defines FPC_LINK_DYNAMIC)'#000+
   '**2Xs_strip all symbols from executable'#000+
-  '**2XS_link with static libraries (defines FPC_LINK_STATIC)'#000+
-  '**0*','_Processor specific options:'#000+
+  '**2XS_link with ','static libraries (defines FPC_LINK_STATIC)'#000+
+  '**0*_Processor specific options:'#000+
   '3*1A<x>_output format:'#000+
   '3*2Aas_assemble using GNU AS'#000+
   '3*2Aasaout_assemble using GNU AS for aout (Go32v1)'#000+
   '3*2Anasmcoff_coff (Go32v2) file using Nasm'#000+
-  '3*2Anasmelf_elf32 (Linux) file using Nasm'#000+
-  '3*2Anasmobj_obj file us','ing Nasm'#000+
+  '3*2Anasmelf_elf32 ','(Linux) file using Nasm'#000+
+  '3*2Anasmobj_obj file using Nasm'#000+
   '3*2Amasm_obj file using Masm (Microsoft)'#000+
   '3*2Atasm_obj file using Tasm (Borland)'#000+
   '3*2Acoff_coff (Go32v2) using internal writer'#000+
   '3*2Apecoff_pecoff (Win32) using internal writer'#000+
-  '3*1R<x>_assembler reading style:'#000+
-  '3*2Ratt_read AT&T style a','ssembler'#000+
+  '3*1R<x>_ass','embler reading style:'#000+
+  '3*2Ratt_read AT&T style assembler'#000+
   '3*2Rintel_read Intel style assembler'#000+
   '3*2Rdirect_copy assembler text directly to assembler file'#000+
   '3*1O<x>_optimizations:'#000+
   '3*2Og_generate smaller code'#000+
   '3*2OG_generate faster code (default)'#000+
-  '3*2Or_keep certain variables in registers (still',' BUGGY!!!)'#000+
+  '3','*2Or_keep certain variables in registers (still BUGGY!!!)'#000+
   '3*2Ou_enable uncertain optimizations (see docs)'#000+
   '3*2O1_level 1 optimizations (quick optimizations)'#000+
   '3*2O2_level 2 optimizations (-O1 + slower optimizations)'#000+
-  '3*2O3_level 3 optimizations (same as -O2u)'#000+
+  '3*2O3_level 3 optimizations',' (same as -O2u)'#000+
   '3*2Op<x>_target processor:'#000+
-  '3*3O','p1_set target processor to 386/486'#000+
+  '3*3Op1_set target processor to 386/486'#000+
   '3*3Op2_set target processor to Pentium/PentiumMMX (tm)'#000+
   '3*3Op3_set target processor to PPro/PII/c6x86/K6 (tm)'#000+
   '3*1T<x>_Target operating system:'#000+
-  '3*2TGO32V1_version 1 of DJ Delorie DOS extender'#000+
-  '3*2TGO32V2_vers','ion 2 of DJ Delorie DOS extender'#000+
+  '3*2TGO32V1_versi','on 1 of DJ Delorie DOS extender'#000+
+  '3*2TGO32V2_version 2 of DJ Delorie DOS extender'#000+
   '3*2TLINUX_Linux'#000+
   '3*2TOS2_OS/2 2.x'#000+
   '3*2TWin32_Windows 32 Bit'#000+
   '6*1A<x>_output format'#000+
   '6*2Aas_Unix o-file using GNU AS'#000+
   '6*2Agas_GNU Motorola assembler'#000+
-  '6*2Amit_MIT Syntax (old GAS)'#000+
-  '6*2Amot_Standard Motorola assembler',#000+
+  '6*2Amit_MIT Synta','x (old GAS)'#000+
+  '6*2Amot_Standard Motorola assembler'#000+
   '6*1O_optimizations:'#000+
   '6*2Oa_turn on the optimizer'#000+
   '6*2Og_generate smaller code'#000+
   '6*2OG_generate faster code (default)'#000+
   '6*2Ox_optimize maximum (still BUGGY!!!)'#000+
-  '6*2O2_set target processor to a MC68020+'#000+
+  '6*2O2_set target processor to a MC68020','+'#000+
   '6*1R<x>_assembler reading style:'#000+
-  '6*2RMOT_read',' motorola style assembler'#000+
+  '6*2RMOT_read motorola style assembler'#000+
   '6*1T<x>_Target operating system:'#000+
   '6*2TAMIGA_Commodore Amiga'#000+
   '6*2TATARI_Atari ST/STe/TT'#000+
@@ -646,5 +647,5 @@ const msgtxt : array[0..000097,1..240] of char=(
   '6*2TLINUX_Linux-68k'#000+
   '**1*_'#000+
   '**1?_shows this help'#000+
-  '**1h_shows this help without waiting'#000
+  '**1h_shows',' this help without waiting'#000
 );

+ 9 - 1
compiler/parser.pas

@@ -169,6 +169,7 @@ unit parser;
          oldexports,
          oldresource,
          oldrttilist,
+         oldresourcestringlist,
          oldbsssegment,
          olddatasegment,
          oldcodesegment,
@@ -227,6 +228,7 @@ unit parser;
          oldimports:=importssection;
          oldexports:=exportssection;
          oldresource:=resourcesection;
+         oldresourcestringlist:=resourcestringlist;
          oldasmsymbollist:=asmsymbollist;
        { save akt... state }
          oldaktlocalswitches:=aktlocalswitches;
@@ -386,6 +388,8 @@ unit parser;
               exportssection:=oldexports;
               resourcesection:=oldresource;
               rttilist:=oldrttilist;
+              resourcestringlist:=oldresourcestringlist;
+
               asmsymbollist:=oldasmsymbollist;
               { restore symtable state }
               refsymtable:=oldrefsymtable;
@@ -462,7 +466,11 @@ unit parser;
 end.
 {
   $Log$
-  Revision 1.75  1999-06-15 13:23:48  pierre
+  Revision 1.76  1999-07-22 09:37:49  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.75  1999/06/15 13:23:48  pierre
    * don't generate browser if errors during compilation
 
   Revision 1.74  1999/05/27 19:44:41  peter

+ 68 - 1
compiler/pdecl.pas

@@ -2037,6 +2037,65 @@ unit pdecl;
         read_var_decs(false,false,true);
       end;
 
+    procedure resourcestring_dec;
+
+      var
+         name : stringid;
+         p : ptree;
+         storetokenpos,filepos : tfileposinfo;
+         old_block_type : tblock_type;
+         sp : pchar;
+
+      begin
+         consume(_RESOURCESTRING);
+         if not(symtablestack^.symtabletype in [staticsymtable,globalsymtable]) then
+           message(parser_e_resourcestring_only_sg);
+         old_block_type:=block_type;
+         block_type:=bt_const;
+         repeat
+           name:=pattern;
+           filepos:=tokenpos;
+           consume(ID);
+           case token of
+              EQUAL:
+                begin
+                   consume(EQUAL);
+                   p:=comp_expr(true);
+                   do_firstpass(p);
+                   storetokenpos:=tokenpos;
+                   tokenpos:=filepos;
+                   case p^.treetype of
+                      ordconstn:
+                        begin
+                           if is_constcharnode(p) then
+                             begin
+                                getmem(sp,2);
+                                sp[0]:=chr(p^.value);
+                                sp[1]:=#0;
+                                symtablestack^.insert(new(pconstsym,init_string(name,constresourcestring,sp,1)));
+                             end
+                           else
+                             Message(cg_e_illegal_expression);
+                        end;
+                      stringconstn:
+                        begin
+                           getmem(sp,p^.length+1);
+                           move(p^.value_str^,sp^,p^.length+1);
+                           symtablestack^.insert(new(pconstsym,init_string(name,constresourcestring,sp,p^.length)));
+                        end;
+                      else
+                        Message(cg_e_illegal_expression);
+                   end;
+                   tokenpos:=storetokenpos;
+                   consume(SEMICOLON);
+                   disposetree(p);
+                end;
+              else consume(EQUAL);
+           end;
+         until token<>ID;
+         block_type:=old_block_type;
+
+      end;
 
     procedure Not_supported_for_inline(t : ttoken);
 
@@ -2081,6 +2140,8 @@ unit pdecl;
                    Not_supported_for_inline(token);
                    read_proc;
                 end;
+              _RESOURCESTRING:
+                resourcestring_dec;
               _EXPORTS:
                 begin
                    Not_supported_for_inline(token);
@@ -2111,6 +2172,8 @@ unit pdecl;
              _TYPE : type_dec;
               _VAR : var_dec;
               _THREADVAR : threadvar_dec;
+              _RESOURCESTRING:
+                resourcestring_dec;
          _FUNCTION,
         _PROCEDURE,
          _OPERATOR : read_proc;
@@ -2124,7 +2187,11 @@ unit pdecl;
 end.
 {
   $Log$
-  Revision 1.133  1999-07-16 10:04:34  peter
+  Revision 1.134  1999-07-22 09:37:50  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.133  1999/07/16 10:04:34  peter
     * merged
 
   Revision 1.132  1999/07/11 21:24:31  michael

+ 10 - 1
compiler/pexpr.pas

@@ -1112,6 +1112,11 @@ unit pexpr;
                                         pconstsym(srsym)^.definition);
                                 constnil :
                                   p1:=genzeronode(niln);
+                                constresourcestring:
+                                  begin
+                                     p1:=genloadnode(pvarsym(srsym),srsymtable);
+                                     pd:=cansistringdef;
+                                  end;
                               end;
                               pd:=p1^.resulttype;
                             end;
@@ -2046,7 +2051,11 @@ unit pexpr;
 end.
 {
   $Log$
-  Revision 1.121  1999-07-16 10:04:35  peter
+  Revision 1.122  1999-07-22 09:37:52  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.121  1999/07/16 10:04:35  peter
     * merged
 
   Revision 1.120  1999/07/06 22:38:11  florian

+ 12 - 3
compiler/pmodules.pas

@@ -36,7 +36,8 @@ unit pmodules;
        globtype,version,systems,tokens,
        cobjects,comphook,globals,verbose,files,
        symtable,aasm,hcodegen,
-       link,assemble,import,export,gendef,ppu,comprsrc
+       link,assemble,import,export,gendef,ppu,comprsrc,
+       cresstr
 {$ifdef i386}
        ,i386base,i386asm
 {$endif}
@@ -108,6 +109,8 @@ unit pmodules;
       { .rdata is a read only data section (PM) }
         fixseg(rttilist,sec_data);
         fixseg(consts,sec_data);
+        if assigned(resourcestringlist) then
+          fixseg(resourcestringlist,sec_data);
 {$ifdef GDB}
         if assigned(debuglist) then
           fixseg(debuglist,sec_code);
@@ -797,7 +800,8 @@ unit pmodules;
           datasegment^.empty and
           bsssegment^.empty and
           ((importssection=nil) or importssection^.empty) and
-          ((resourcesection=nil) or resourcesection^.empty)
+          ((resourcesection=nil) or resourcesection^.empty) and
+          ((resourcestringlist=nil) or resourcestringlist^.empty)
         );
       end;
 
@@ -1294,6 +1298,7 @@ unit pmodules;
            exportlib^.generatelib;
 
          { insert heap }
+         insertresourcestrings;
          insertinitfinaltable;
          insertheap;
          inserttargetspecific;
@@ -1339,7 +1344,11 @@ unit pmodules;
 end.
 {
   $Log$
-  Revision 1.130  1999-07-14 21:19:11  florian
+  Revision 1.131  1999-07-22 09:37:54  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.130  1999/07/14 21:19:11  florian
     + implemented a better error message if a PPU file isn't found as suggested
       by Lee John
 

+ 8 - 2
compiler/symsym.inc

@@ -1550,9 +1550,10 @@
          value:=longint(str);
          definition:=nil;
          len:=l;
+         if t=constresourcestring then
+           registerresourcestring(pchar(value),len);
       end;
 
-
     constructor tconstsym.load;
       var
          pd : pbestreal;
@@ -1575,6 +1576,7 @@
                len:=readlong;
                getmem(pchar(value),len+1);
                current_ppu^.getdata(pchar(value)^,len);
+               registerresourcestring(pchar(value),len);
              end;
            constreal :
              begin
@@ -2038,7 +2040,11 @@
 
 {
   $Log$
-  Revision 1.97  1999-07-05 12:13:25  florian
+  Revision 1.98  1999-07-22 09:37:55  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.97  1999/07/05 12:13:25  florian
     * property reading from PPU fixed (new PPU format), it uses now writesym...
 
   Revision 1.96  1999/06/28 10:49:48  pierre

+ 7 - 2
compiler/symsymh.inc

@@ -276,7 +276,8 @@
        end;
 
        tconsttype = (constord,conststring,constreal,constbool,
-                     constint,constchar,constset,constnil);
+                     constint,constchar,constset,constnil,
+                     constresourcestring);
 
        pconstsym = ^tconstsym;
        tconstsym = object(tsym)
@@ -331,7 +332,11 @@
 
 {
   $Log$
-  Revision 1.26  1999-05-27 19:45:07  peter
+  Revision 1.27  1999-07-22 09:37:57  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.26  1999/05/27 19:45:07  peter
     * removed oldasm
     * plabel -> pasmlabel
     * -a switches to source writing automaticly

+ 6 - 1
compiler/symtable.pas

@@ -434,6 +434,7 @@ implementation
      types,ppu,
      gendef,files
      ,tree
+     ,cresstr
 {$ifdef newcg}
      ,cgbase
 {$else}
@@ -2323,7 +2324,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.25  1999-07-18 14:47:34  florian
+  Revision 1.26  1999-07-22 09:37:58  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.25  1999/07/18 14:47:34  florian
     * bug 487 fixed, (inc(<property>) isn't allowed)
     * more fixes to compile with Delphi
 

+ 15 - 1
compiler/tcld.pas

@@ -97,6 +97,16 @@ implementation
            end;
          case p^.symtableentry^.typ of
             absolutesym :;
+            constsym:
+              begin
+                 if pconstsym(p^.symtableentry)^.consttype=constresourcestring then
+                   begin
+                      p^.resulttype:=cansistringdef;
+                      p^.location.loc:=LOC_MEM;
+                   end
+                 else
+                   internalerror(22799);
+              end;
             varsym :
                 begin
                    if not(p^.is_absolute) and (p^.resulttype=nil) then
@@ -460,7 +470,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.35  1999-06-17 13:19:59  pierre
+  Revision 1.36  1999-07-22 09:38:00  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.35  1999/06/17 13:19:59  pierre
    * merged from 0_99_12 branch
 
   Revision 1.34.2.1  1999/06/17 12:33:39  pierre

+ 9 - 3
compiler/tokens.pas

@@ -196,7 +196,8 @@ type
     _SHORTSTRING,
     _FINALIZATION,
     _IMPLEMENTATION,
-    _INITIALIZATION
+    _INITIALIZATION,
+    _RESOURCESTRING
   );
 
   tokenrec=record
@@ -375,7 +376,8 @@ const
       (str:'SHORTSTRING'   ;special:false;keyword:m_none),
       (str:'FINALIZATION'  ;special:false;keyword:m_initfinal),
       (str:'IMPLEMENTATION';special:false;keyword:m_all),
-      (str:'INITIALIZATION';special:false;keyword:m_initfinal)
+      (str:'INITIALIZATION';special:false;keyword:m_initfinal),
+      (str:'RESOURCESTRING';special:false;keyword:m_class)
   );
 
 implementation
@@ -383,7 +385,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.8  1999-07-10 10:26:21  peter
+  Revision 1.9  1999-07-22 09:38:01  florian
+    + resourcestring implemented
+    + start of longstring support
+
+  Revision 1.8  1999/07/10 10:26:21  peter
     * merged
 
   Revision 1.7.2.1  1999/07/10 10:03:18  peter