Ver Fonte

* all tokens now start with an underscore
* PowerPC compiles!!

Jonas Maebe há 26 anos atrás
pai
commit
ace7ff6983

+ 17 - 5
compiler/compiler.pas

@@ -62,11 +62,19 @@
      {$fatal cannot define two CPU switches}
    {$endif}
    {$endif}
-   
+
+   {$ifdef powerpc}
    {$ifndef CPUOK}
-   {$fatal One of the switches I386,Alpha or M68K must be defined}
+   {$DEFINE CPUOK}
+   {$else}
+     {$fatal cannot define two CPU switches}
+   {$endif}
    {$endif}
-   
+
+   {$ifndef CPUOK}
+   {$fatal One of the switches I386, Alpha, PowerPC or M68K must be defined}
+   {$endif}
+
    {$ifdef support_mmx}
      {$ifndef i386}
        {$fatal I386 switch must be on for MMX support}
@@ -240,7 +248,7 @@ begin
 {$ifdef TP}
 {$ifndef Delphi}
   Comment(V_Info,'Memory: '+tostr(MemAvail)+' Bytes Free');
-{$endif Delphi}  
+{$endif Delphi}
 {$endif}
 
 {$ifdef USEEXCEPT}
@@ -290,7 +298,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.27  1999-08-02 21:28:56  florian
+  Revision 1.28  1999-08-04 13:02:40  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.27  1999/08/02 21:28:56  florian
     * the main branch psub.pas is now used for
       newcg compiler
 

+ 12 - 4
compiler/export.pas

@@ -31,7 +31,7 @@ const
        eo_resident = $1;
        eo_index    = $2;
        eo_name     = $4;
-   
+
 type
    pexported_item = ^texported_item;
    texported_item = object(tlinkedlist_item)
@@ -152,9 +152,13 @@ begin
       exportlib:=new(pexportlib,Init);
 {$endif m68k}
 {$ifdef alpha}
-    target_m68k_Linux :
+    target_alpha_Linux :
       exportlib:=new(pexportlib,Init);
-{$endif m68k}
+{$endif alpha}
+{$ifdef powerpc}
+    target_alpha_Linux :
+      exportlib:=new(pexportlib,Init);
+{$endif powerpc}
     else
       exportlib:=new(pexportlib,Init);
   end;
@@ -164,7 +168,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.5  1999-08-03 17:09:34  florian
+  Revision 1.6  1999-08-04 13:02:41  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.5  1999/08/03 17:09:34  florian
     * the alpha compiler can be compiled now
 
   Revision 1.4  1998/11/30 09:43:09  pierre

+ 12 - 1
compiler/globtype.pas

@@ -48,6 +48,13 @@ interface
        ts80real = extended;
        ts64comp = comp;
 {$endif}
+{$ifdef powerpc}
+       bestreal = double;
+       ts32real = single;
+       ts64real = double;
+       ts80real = extended;
+       ts64comp = comp;
+{$endif powerpc}
        pbestreal=^bestreal;
 
        { Switches which can be changed locally }
@@ -169,7 +176,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.14  1999-08-01 23:04:48  michael
+  Revision 1.15  1999-08-04 13:02:42  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.14  1999/08/01 23:04:48  michael
   + Changes for Alpha
 
   Revision 1.13  1999/07/23 16:05:21  peter

+ 7 - 3
compiler/htypechk.pas

@@ -651,8 +651,8 @@ implementation
           convtyp : tconverttype;
        begin
           assignment_overloaded:=nil;
-          if assigned(overloaded_operators[assignment]) then
-            passproc:=overloaded_operators[assignment]^.definition
+          if assigned(overloaded_operators[_assignment]) then
+            passproc:=overloaded_operators[_assignment]^.definition
           else
             exit;
           while passproc<>nil do
@@ -671,7 +671,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.32  1999-08-03 22:02:53  peter
+  Revision 1.33  1999-08-04 13:02:43  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.32  1999/08/03 22:02:53  peter
     * moved bitmask constants to sets
     * some other type/const renamings
 

+ 9 - 1
compiler/import.pas

@@ -190,6 +190,10 @@ begin
     target_alpha_Linux :
       importlib:=new(pimportliblinux,Init);
 {$endif alpha}
+{$ifdef powerpc}
+    target_alpha_Linux :
+      importlib:=new(pimportliblinux,Init);
+{$endif powerpc}
     else
       importlib:=new(pimportlib,Init);
   end;
@@ -199,7 +203,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.11  1999-08-03 13:50:16  michael
+  Revision 1.12  1999-08-04 13:02:44  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.11  1999/08/03 13:50:16  michael
   + Changes for alpha
 
   Revision 1.10  1999/05/17 14:33:01  pierre

+ 1 - 6
compiler/mppc386.bat

@@ -1,6 +1 @@
-ppc386 -O-p3 -Ch8000000 -dI386 -dGDB -dBROWSERLOG -Sg pp.pas %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel 0 goto success
-goto failed
-:success
-copy pp.exe ppc386.exe
-:failed
+ppt5 -Xs -Ch8000000 -dI386 -dGDB -Sg -dnoag386int -dnoag386nsm pp.pas %1 %2 %3 %4 %5 %6 %7 %8 %9

+ 15 - 2
compiler/options.pas

@@ -971,6 +971,9 @@ begin
 {$ifdef alpha}
   option:=new(poption,Init);
 {$endif}
+{$ifdef powerpc}
+  option:=new(poption,Init);
+{$endif}
 { Load messages }
   if (cmd='') and (paramcount=0) then
    Option^.WriteHelpPages;
@@ -988,7 +991,7 @@ begin
 { Temporary defines, until things settle down }
   def_symbol('INT64');
   def_symbol('HASRESOURCESTRINGS');
-  
+
 { some stuff for TP compatibility }
 {$ifdef i386}
   def_symbol('CPU86');
@@ -1002,6 +1005,9 @@ begin
 {$ifdef ALPHA}
   def_symbol('ALPHA');
 {$endif}
+{$ifdef powerpc}
+  def_symbol('POWERPC');
+{$endif}
 
 { get default messagefile }
 {$ifdef Delphi}
@@ -1025,6 +1031,9 @@ begin
 {$endif}
 {$ifdef alpha}
      ppccfg:='ppcalpha.cfg';
+{$endif}
+{$ifdef powerpc}
+     ppccfg:='ppcppc.cfg';
 {$endif}
    end;
 
@@ -1151,7 +1160,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.8  1999-08-03 17:09:36  florian
+  Revision 1.9  1999-08-04 13:02:46  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.8  1999/08/03 17:09:36  florian
     * the alpha compiler can be compiled now
 
   Revision 1.7  1999/08/02 23:13:19  florian

+ 6 - 2
compiler/opts386.pas

@@ -53,7 +53,7 @@ begin
                            cs_regalloc,cs_uncertainopts];
                  'g' : initglobalswitches:=initglobalswitches+[cs_littlesize];
                  'G' : initglobalswitches:=initglobalswitches-[cs_littlesize];
-                 'r' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_regalloc];
+                 'r' : initglobalswitches:=initglobalswitches+[cs_regalloc];
                  'u' : initglobalswitches:=initglobalswitches+[cs_optimize,cs_uncertainopts];
                  '1' : initglobalswitches:=initglobalswitches-[cs_slowoptimize,cs_uncertainopts]+[cs_optimize,cs_fastoptimize];
                  '2' : initglobalswitches:=initglobalswitches-[cs_uncertainopts]+[cs_optimize,cs_fastoptimize,cs_slowoptimize];
@@ -97,7 +97,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.15  1998-12-11 00:03:22  peter
+  Revision 1.16  1999-08-04 13:02:47  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.15  1998/12/11 00:03:22  peter
     + globtype,tokens,version unit splitted from globals
 
   Revision 1.14  1998/11/12 09:00:26  michael

+ 10 - 3
compiler/parser.pas

@@ -299,6 +299,9 @@ unit parser;
 {$ifdef alpha}
          cg:=new(pcgalpha,init);
 {$endif alpha}
+{$ifdef powerpc}
+         cg:=new(pcgppc,init);
+{$endif powerpc}
 {$endif newcg}
 
          { If the compile level > 1 we get a nice "unit expected" error
@@ -441,9 +444,9 @@ unit parser;
 {$ifdef BrowserCol}
               { Write Browser Collections }
               CreateBrowserCol;
-{$endif}     
+{$endif}
               { Write resource stringtable file }
-            
+
               If not (Main_Module^.is_unit) then
                 WriteResourceFile(Current_module^.ModuleName^);
               end;
@@ -472,7 +475,11 @@ unit parser;
 end.
 {
   $Log$
-  Revision 1.80  1999-08-03 17:09:37  florian
+  Revision 1.81  1999-08-04 13:02:48  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.80  1999/08/03 17:09:37  florian
     * the alpha compiler can be compiled now
 
   Revision 1.79  1999/08/01 23:36:40  florian

+ 9 - 5
compiler/pbase.pas

@@ -97,7 +97,7 @@ unit pbase;
     procedure consume(i : ttoken);
       begin
         if (token<>i) and (idtoken<>i) then
-          if token=ID then
+          if token=_id then
             Message2(scan_f_syn_expected,tokeninfo[i].str,'identifier '+pattern)
           else
             Message2(scan_f_syn_expected,tokeninfo[i].str,tokeninfo[token].str)
@@ -141,7 +141,7 @@ unit pbase;
     procedure emptystats;
       begin
          repeat
-         until not try_to_consume(semicolon);
+         until not try_to_consume(_SEMICOLON);
       end;
 
 
@@ -154,8 +154,8 @@ unit pbase;
          repeat
            sc^.insert_with_tokeninfo(pattern,
              tokenpos);
-           consume(ID);
-           if token=COMMA then consume(COMMA)
+           consume(_id);
+           if token=_COMMA then consume(_COMMA)
              else break
          until false;
          idlist:=sc;
@@ -165,7 +165,11 @@ end.
 
 {
   $Log$
-  Revision 1.23  1999-07-27 23:42:10  peter
+  Revision 1.24  1999-08-04 13:02:50  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.23  1999/07/27 23:42:10  peter
     * indirect type referencing is now allowed
 
   Revision 1.22  1999/07/26 09:42:10  florian

+ 136 - 132
compiler/pdecl.pas

@@ -127,11 +127,11 @@ unit pdecl;
          repeat
            name:=pattern;
            filepos:=tokenpos;
-           consume(ID);
+           consume(_ID);
            case token of
-              EQUAL:
+             _EQUAL:
                 begin
-                   consume(EQUAL);
+                   consume(_EQUAL);
                    p:=comp_expr(true);
                    do_firstpass(p);
                    storetokenpos:=tokenpos;
@@ -177,15 +177,15 @@ unit pdecl;
                         Message(cg_e_illegal_expression);
                    end;
                    tokenpos:=storetokenpos;
-                   consume(SEMICOLON);
+                   consume(_SEMICOLON);
                    disposetree(p);
                 end;
-              COLON:
+             _COLON:
                 begin
                    { set the blocktype first so a consume also supports a
                      caret, to support const s : ^string = nil }
                    block_type:=bt_type;
-                   consume(COLON);
+                   consume(_COLON);
                    ignore_equal:=true;
                    def:=read_type('');
                    ignore_equal:=false;
@@ -210,18 +210,18 @@ unit pdecl;
                      end;
                    tokenpos:=storetokenpos;
                    symtablestack^.insert(sym);
-                   consume(EQUAL);
+                   consume(_EQUAL);
 {$ifdef DELPHI_CONST_IN_RODATA}
                    if m_delphi in aktmodeswitches then
                      readtypedconst(def,ptypedconstsym(sym),true)
                    else
 {$endif DELPHI_CONST_IN_RODATA}
                      readtypedconst(def,ptypedconstsym(sym),false);
-                   consume(SEMICOLON);
+                   consume(_SEMICOLON);
                 end;
-              else consume(EQUAL);
+              else consume(_EQUAL);
            end;
-         until token<>ID;
+         until token<>_ID;
          block_type:=old_block_type;
       end;
 
@@ -235,17 +235,17 @@ unit pdecl;
          if not(cs_support_goto in aktmoduleswitches) then
            Message(sym_e_goto_and_label_not_supported);
          repeat
-           if not(token in [ID,INTCONST]) then
-             consume(ID)
+           if not(token in [_ID,_INTCONST]) then
+             consume(_ID)
            else
              begin
                 getlabel(hl);
                 symtablestack^.insert(new(plabelsym,init(pattern,hl)));
                 consume(token);
              end;
-           if token<>SEMICOLON then consume(COMMA);
-         until not(token in [ID,INTCONST]);
-         consume(SEMICOLON);
+           if token<>_SEMICOLON then consume(_COMMA);
+         until not(token in [_ID,_INTCONST]);
+         consume(_SEMICOLON);
       end;
 
     const
@@ -328,25 +328,25 @@ unit pdecl;
          block_type:=bt_type;
          is_gpc_name:=false;
          { Force an expected ID error message }
-         if not (token in [ID,_CASE,_END]) then
-          consume(ID);
+         if not (token in [_ID,_CASE,_END]) then
+          consume(_ID);
          { read vars }
-         while (token=ID) and
+         while (token=_ID) and
                not(is_object and (idtoken in [_PUBLIC,_PRIVATE,_PUBLISHED,_PROTECTED])) do
            begin
              C_name:=orgpattern;
              sc:=idlist;
-             consume(COLON);
+             consume(_COLON);
              if (m_gpc in aktmodeswitches) and
                 not(is_record or is_object or is_threadvar) and
-                (token=ID) and (orgpattern='__asmname__') then
+                (token=_ID) and (orgpattern='__asmname__') then
                begin
-                 consume(ID);
+                 consume(_ID);
                  C_name:=pattern;
-                 if token=CCHAR then
-                  consume(CCHAR)
+                 if token=_CCHAR then
+                  consume(_CCHAR)
                  else
-                  consume(CSTRING);
+                  consume(_CSTRING);
                  Is_gpc_name:=true;
                end;
              { this is needed for Delphi mode at least
@@ -385,10 +385,10 @@ unit pdecl;
                  Message(parser_e_absolute_only_one_var);
                 dispose(sc,done);
                 { parse the rest }
-                if token=ID then
+                if token=_ID then
                  begin
                    getsym(pattern,true);
-                   consume(ID);
+                   consume(_ID);
                    { we should check the result type of srsym }
                    if not (srsym^.typ in [varsym,typedconstsym]) then
                      Message(parser_e_absolute_only_to_var_or_const);
@@ -401,7 +401,7 @@ unit pdecl;
                    tokenpos:=storetokenpos;
                  end
                 else
-                 if (token=CSTRING) or (token=CCHAR) then
+                 if (token=_CSTRING) or (token=_CCHAR) then
                   begin
                     storetokenpos:=tokenpos;
                     tokenpos:=declarepos;
@@ -415,7 +415,7 @@ unit pdecl;
                   end
                 else
                 { absolute address ?!? }
-                 if token=INTCONST then
+                 if token=_INTCONST then
                   begin
                     if (target_info.target=target_i386_go32v2) then
                      begin
@@ -425,13 +425,13 @@ unit pdecl;
                        abssym^.abstyp:=toaddr;
                        abssym^.absseg:=false;
                        s:=pattern;
-                       consume(INTCONST);
+                       consume(_INTCONST);
                        val(s,abssym^.address,code);
-                       if token=COLON then
+                       if token=_COLON then
                         begin
                           consume(token);
                           s:=pattern;
-                          consume(INTCONST);
+                          consume(_INTCONST);
                           val(s,l,code);
                           abssym^.address:=abssym^.address shl 4+l;
                           abssym^.absseg:=true;
@@ -451,7 +451,7 @@ unit pdecl;
                - in parasymtable
                - in record or object
                - ... (PM) }
-             if (m_delphi in aktmodeswitches) and (token=EQUAL) and
+             if (m_delphi in aktmodeswitches) and (token=_EQUAL) and
                 not (symtablestack^.symtabletype in [parasymtable]) and
                 not is_record and not is_object then
                begin
@@ -465,13 +465,13 @@ unit pdecl;
                    pconstsym:=new(ptypedconstsym,init(s,p,false));
                   symtablestack^.insert(pconstsym);
                   tokenpos:=storetokenpos;
-                  consume(EQUAL);
+                  consume(_EQUAL);
                   readtypedconst(p,pconstsym,false);
                   symdone:=true;
                end;
              { for a record there doesn't need to be a ; before the END or ) }
-             if not((is_record or is_object) and (token in [_END,RKLAMMER])) then
-               consume(SEMICOLON);
+             if not((is_record or is_object) and (token in [_END,_RKLAMMER])) then
+               consume(_SEMICOLON);
              { procvar handling }
              if (p^.deftype=procvardef) and (p^.sym=nil) then
                begin
@@ -482,7 +482,7 @@ unit pdecl;
                   dispose(newtype,done);
                end;
              { Check for variable directives }
-             if not symdone and (token=ID) then
+             if not symdone and (token=_ID) then
               begin
                 { Check for C Variable declarations }
                 if (m_cvar_support in aktmodeswitches) and
@@ -503,7 +503,7 @@ unit pdecl;
                    if idtoken=_CVAR then
                     begin
                       consume(_CVAR);
-                      consume(SEMICOLON);
+                      consume(_SEMICOLON);
                       is_cdecl:=true;
                       C_name:=target_os.Cprefix+C_name;
                     end;
@@ -516,7 +516,7 @@ unit pdecl;
                    { export }
                    if idtoken in [_EXPORT,_PUBLIC] then
                     begin
-                      consume(ID);
+                      consume(_ID);
                       if extern_aktvarsym then
                        Message(parser_e_not_external_and_export)
                       else
@@ -536,7 +536,7 @@ unit pdecl;
                     end;
                    { consume the ; when export or external is used }
                    if extern_aktvarsym or export_aktvarsym then
-                    consume(SEMICOLON);
+                    consume(_SEMICOLON);
                    { insert in the symtable }
                    storetokenpos:=tokenpos;
                    tokenpos:=declarepos;
@@ -600,7 +600,7 @@ unit pdecl;
                     current_object_option:=current_object_option-[sp_static];
 {$endif}
                     consume(_STATIC);
-                    consume(SEMICOLON);
+                    consume(_SEMICOLON);
                     symdone:=true;
                   end;
               end;
@@ -628,8 +628,8 @@ unit pdecl;
                 casedef:=read_type('')
               else
                 begin
-                  consume(ID);
-                  consume(COLON);
+                  consume(_ID);
+                  consume(_COLON);
                   casedef:=read_type('');
                   symtablestack^.insert(new(pvarsym,init(s,casedef)));
                 end;
@@ -644,28 +644,28 @@ unit pdecl;
                   if not(pt^.treetype=ordconstn) then
                     Message(cg_e_illegal_expression);
                   disposetree(pt);
-                  if token=COMMA then
-                   consume(COMMA)
+                  if token=_COMMA then
+                   consume(_COMMA)
                   else
                    break;
                 until false;
-                consume(COLON);
+                consume(_COLON);
                 { read the vars }
-                consume(LKLAMMER);
+                consume(_LKLAMMER);
                 inc(variantrecordlevel);
-                if token<>RKLAMMER then
+                if token<>_RKLAMMER then
                   read_var_decs(true,false,false);
                 dec(variantrecordlevel);
-                consume(RKLAMMER);
+                consume(_RKLAMMER);
                 { calculates maximal variant size }
                 maxsize:=max(maxsize,symtablestack^.datasize);
                 { the items of the next variant are overlayed }
                 symtablestack^.datasize:=startvarrec;
-                if (token<>_END) and (token<>RKLAMMER) then
-                  consume(SEMICOLON)
+                if (token<>_END) and (token<>_RKLAMMER) then
+                  consume(_SEMICOLON)
                 else
                   break;
-              until (token=_END) or (token=RKLAMMER);
+              until (token=_END) or (token=_RKLAMMER);
               { at last set the record size to that of the biggest variant }
               symtablestack^.datasize:=maxsize;
            end;
@@ -682,9 +682,9 @@ unit pdecl;
          d : pdef;
       begin
          consume(_STRING);
-         if token=LECKKLAMMER then
+         if token=_LECKKLAMMER then
            begin
-              consume(LECKKLAMMER);
+              consume(_LECKKLAMMER);
               p:=comp_expr(true);
               do_firstpass(p);
               if not is_constintnode(p) then
@@ -694,7 +694,7 @@ unit pdecl;
                    Message(parser_e_invalid_string_size);
                    p^.value:=255;
                 end;
-              consume(RECKKLAMMER);
+              consume(_RECKKLAMMER);
               if p^.value>255 then
                 d:=new(pstringdef,longinit(p^.value))
               else
@@ -721,7 +721,7 @@ unit pdecl;
     { the type to allow name mangling          }
       begin
          s:=pattern;
-         consume(ID);
+         consume(_ID);
          { classes can be used also in classes }
          if (curobjectname=pattern) and aktobjectdef^.is_class then
            begin
@@ -739,10 +739,10 @@ unit pdecl;
            begin
               if srsym^.typ=unitsym then
                 begin
-                   consume(POINT);
+                   consume(_POINT);
                    getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
                    s:=pattern;
-                   consume(ID);
+                   consume(_ID);
                 end;
               if not assigned(srsym) or
                  (srsym^.typ<>typesym) then
@@ -832,7 +832,7 @@ unit pdecl;
 {$else}
            aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_constructor];
 {$endif}
-           consume(SEMICOLON);
+           consume(_SEMICOLON);
              begin
                 if (aktclass^.is_class) then
                   begin
@@ -901,19 +901,19 @@ unit pdecl;
            consume(_PROPERTY);
            propertyparas:=nil;
            datacoll:=nil;
-           if token=ID then
+           if token=_ID then
              begin
                 p:=new(ppropertysym,init(pattern));
                 propname:=pattern;
-                consume(ID);
+                consume(_ID);
                 { property parameters ? }
-                if token=LECKKLAMMER then
+                if token=_LECKKLAMMER then
                   begin
                      if (sp_published in current_object_option) then
                        Message(parser_e_cant_publish_that_property);
 
                      { create a list of the parameters in propertyparas }
-                     consume(LECKKLAMMER);
+                     consume(_LECKKLAMMER);
                      inc(testcurobject);
                      repeat
                        if token=_VAR then
@@ -928,9 +928,9 @@ unit pdecl;
                          end
                        else varspez:=vs_value;
                        sc:=idlist;
-                       if token=COLON then
+                       if token=_COLON then
                          begin
-                            consume(COLON);
+                            consume(_COLON);
                             if token=_ARRAY then
                               begin
                                  {
@@ -964,17 +964,17 @@ unit pdecl;
                             s:=sc^.get_with_tokeninfo(declarepos);
                          end;
                        dispose(sc,done);
-                       if token=SEMICOLON then consume(SEMICOLON)
+                       if token=_SEMICOLON then consume(_SEMICOLON)
                      else break;
                      until false;
                      dec(testcurobject);
-                     consume(RECKKLAMMER);
+                     consume(_RECKKLAMMER);
                   end;
                 { overriden property ?                                 }
                 { force property interface, if there is a property parameter }
-                if (token=COLON) or assigned(propertyparas) then
+                if (token=_COLON) or assigned(propertyparas) then
                   begin
-                     consume(COLON);
+                     consume(_COLON);
                      p^.proptype:=single_type(hs);
                      if (idtoken=_INDEX) then
                        begin
@@ -984,9 +984,9 @@ unit pdecl;
 {$else}
                           p^.propoptions:=p^.propoptions+[ppo_indexed];
 {$endif}
-                          if token=INTCONST then
+                          if token=_INTCONST then
                             val(pattern,p^.index,code);
-                          consume(INTCONST);
+                          consume(_INTCONST);
                           { concat a longint to the para template }
                           new(hp2);
                           hp2^.paratyp:=vs_value;
@@ -1037,20 +1037,20 @@ unit pdecl;
                      if not(assigned(sym)) then
                        begin
                          Message1(sym_e_unknown_id,pattern);
-                         consume(ID);
+                         consume(_ID);
                        end
                      else
                        begin
-                          consume(ID);
-                          if (token=POINT) and
+                          consume(_ID);
+                          if (token=_POINT) and
                              ((sym^.typ=varsym) and (pvarsym(sym)^.definition^.deftype=recorddef)) then
                            begin
-                             consume(POINT);
+                             consume(_POINT);
                              getsymonlyin(precorddef(pvarsym(sym)^.definition)^.symtable,pattern);
                              if not assigned(srsym) then
                                Message1(sym_e_illegal_field,pattern);
                              sym:=srsym;
-                             consume(ID);
+                             consume(_ID);
                            end;
                        end;
 
@@ -1091,20 +1091,20 @@ unit pdecl;
                      if not(assigned(sym)) then
                        begin
                          Message1(sym_e_unknown_id,pattern);
-                         consume(ID);
+                         consume(_ID);
                        end
                      else
                        begin
-                          consume(ID);
-                          if (token=POINT) and
+                          consume(_ID);
+                          if (token=_POINT) and
                              ((sym^.typ=varsym) and (pvarsym(sym)^.definition^.deftype=recorddef)) then
                            begin
-                             consume(POINT);
+                             consume(_POINT);
                              getsymonlyin(precorddef(pvarsym(sym)^.definition)^.symtable,pattern);
                              if not assigned(srsym) then
                                Message1(sym_e_illegal_field,pattern);
                              sym:=srsym;
-                             consume(ID);
+                             consume(_ID);
                            end;
                        end;
 
@@ -1184,7 +1184,7 @@ unit pdecl;
                   end;
                 symtablestack^.insert(p);
                 { default property ? }
-                consume(SEMICOLON);
+                consume(_SEMICOLON);
                 if (idtoken=_DEFAULT) then
                   begin
                      consume(_DEFAULT);
@@ -1202,7 +1202,7 @@ unit pdecl;
                           if not(assigned(propertyparas)) then
                             message(parser_e_property_need_paras);
                        end;
-                     consume(SEMICOLON);
+                     consume(_SEMICOLON);
                   end;
                 { clean up }
                 if assigned(datacoll) then
@@ -1210,8 +1210,8 @@ unit pdecl;
              end
            else
              begin
-                consume(ID);
-                consume(SEMICOLON);
+                consume(_ID);
+                consume(_SEMICOLON);
              end;
            if assigned(propertyparas) then
              disposepdefcoll(propertyparas);
@@ -1230,7 +1230,7 @@ unit pdecl;
 {$else}
            aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_destructor];
 {$endif}
-           consume(SEMICOLON);
+           consume(_SEMICOLON);
            if assigned(aktprocsym^.definition^.para1) then
             Message(parser_e_no_paras_for_destructor);
            { no return value }
@@ -1312,7 +1312,7 @@ unit pdecl;
                    exit;
                 end
               { forward class }
-              else if not(assigned(fd)) and (token=SEMICOLON) then
+              else if not(assigned(fd)) and (token=_SEMICOLON) then
                 begin
                    { also anonym objects aren't allow (o : object a : longint; end;) }
                    if n='' then
@@ -1342,12 +1342,12 @@ unit pdecl;
            Message(parser_f_no_anonym_objects);
 
          { read the parent class }
-         if token=LKLAMMER then
+         if token=_LKLAMMER then
            begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               { does not allow objects.tobject !! }
               {if token<>ID then
-                consume(ID);
+                consume(_ID);
               getsym(pattern,true);}
               childof:=pobjectdef(id_type(pattern));
               if (childof^.deftype<>objectdef) then
@@ -1378,7 +1378,7 @@ unit pdecl;
                 end
               else
                 aktclass:=new(pobjectdef,init(n,childof));
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
            end
          { if no parent class, then a class get tobject as parent }
          else if is_a_class then
@@ -1445,7 +1445,7 @@ unit pdecl;
          curobjectname:=n;
 
        { short class declaration ? }
-         if (not is_a_class) or (token<>SEMICOLON) then
+         if (not is_a_class) or (token<>_SEMICOLON) then
           begin
           { Parse componenten }
             repeat
@@ -1462,7 +1462,7 @@ unit pdecl;
                 aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_protected];
 {$endif}
               case token of
-               ID : begin
+              _ID : begin
                       case idtoken of
                        _PRIVATE : begin
                                     consume(_PRIVATE);
@@ -1562,7 +1562,7 @@ unit pdecl;
                       break;
                     end;
               else
-               consume(ID); { Give a ident expected message, like tp7 }
+               consume(_ID); { Give a ident expected message, like tp7 }
               end;
             until false;
             current_object_option:=[sp_public];
@@ -1724,9 +1724,9 @@ unit pdecl;
            procvardef : pprocvardef;
         begin
            procvardef:=new(pprocvardef,init);
-           if token=LKLAMMER then
+           if token=_LKLAMMER then
              begin
-                consume(LKLAMMER);
+                consume(_LKLAMMER);
                 inc(testcurobject);
                 repeat
                   if try_to_consume(_VAR) then
@@ -1745,16 +1745,16 @@ unit pdecl;
                      procvardef^.procoptions:=procvardef^.procoptions+[po_containsself];
 {$endif}
                      consume(idtoken);
-                     consume(COLON);
+                     consume(_COLON);
                      p:=single_type(hs1);
                      procvardef^.concatdef(p,vs_value);
                    end
                   else
                    begin
                      sc:=idlist;
-                     if (token=COLON) or (varspez=vs_value) then
+                     if (token=_COLON) or (varspez=vs_value) then
                        begin
-                          consume(COLON);
+                          consume(_COLON);
                           if token=_ARRAY then
                             begin
                               consume(_ARRAY);
@@ -1791,9 +1791,9 @@ unit pdecl;
                        end;
                      dispose(sc,done);
                    end;
-                until not try_to_consume(SEMICOLON);
+                until not try_to_consume(_SEMICOLON);
                 dec(testcurobject);
-                consume(RKLAMMER);
+                consume(_RKLAMMER);
              end;
            handle_procvar:=procvardef;
         end;
@@ -1814,18 +1814,18 @@ unit pdecl;
            pt1,pt2 : ptree;
         begin
            { use of current parsed object ? }
-           if (token=ID) and (testcurobject=2) and (curobjectname=pattern) then
+           if (token=_ID) and (testcurobject=2) and (curobjectname=pattern) then
              begin
-                consume(ID);
+                consume(_ID);
                 p:=aktobjectdef;
                 exit;
              end;
            { we can't accept a equal in type }
            pt1:=comp_expr(not(ignore_equal));
            do_firstpass(pt1);
-           if (token=POINTPOINT) then
+           if (token=_POINTPOINT) then
              begin
-               consume(POINTPOINT);
+               consume(_POINTPOINT);
                { get high value of range }
                pt2:=comp_expr(not(ignore_equal));
                do_firstpass(pt2);
@@ -1881,7 +1881,7 @@ unit pdecl;
           arraytype : pdef;
         begin
            consume(_ARRAY);
-           consume(LECKKLAMMER);
+           consume(_LECKKLAMMER);
            { defaults }
            arraytype:=generrordef;
            lowval:=$80000000;
@@ -1946,12 +1946,12 @@ unit pdecl;
                 ap:=parraydef(ap^.definition);
               end;
 
-             if token=COMMA then
-               consume(COMMA)
+             if token=_COMMA then
+               consume(_COMMA)
              else
                break;
            until false;
-           consume(RECKKLAMMER);
+           consume(_RECKKLAMMER);
            consume(_OF);
            hp1:=read_type('');
            { if no error, set element type }
@@ -1968,19 +1968,19 @@ unit pdecl;
                 p:=single_type(hs);
                 readtypesym:=nil;
               end;
-            LKLAMMER:
+           _LKLAMMER:
               begin
-                 consume(LKLAMMER);
+                 consume(_LKLAMMER);
                  { allow negativ value_str }
                  l:=-1;
                  aufsym := Nil;
                  aufdef:=new(penumdef,init);
                  repeat
                    s:=pattern;
-                   consume(ID);
-                   if token=ASSIGNMENT then
+                   consume(_ID);
+                   if token=_ASSIGNMENT then
                      begin
-                        consume(ASSIGNMENT);
+                        consume(_ASSIGNMENT);
                         v:=get_intconst;
                         { please leave that a note, allows type save }
                         { declarations in the win32 units !       }
@@ -1991,8 +1991,8 @@ unit pdecl;
                    else
                      inc(l);
                    constsymtable^.insert(new(penumsym,init(s,aufdef,l)));
-                   if token=COMMA then
-                     consume(COMMA)
+                   if token=_COMMA then
+                     consume(_COMMA)
                    else
                      break;
                  until false;
@@ -2001,7 +2001,7 @@ unit pdecl;
                  this can be wrong
                  min and max are now set in tenumsym.init PM }
                  p:=aufdef;
-                 consume(RKLAMMER);
+                 consume(_RKLAMMER);
                 readtypesym:=nil;
               end;
             _ARRAY:
@@ -2048,9 +2048,9 @@ unit pdecl;
                  p:=generrordef;
                 readtypesym:=nil;
               end;
-            CARET:
+           _CARET:
               begin
-                consume(CARET);
+                consume(_CARET);
                 { forwards allowed only inside TYPE statements }
                 if typecanbeforward then
                   forwardsallowed:=true;
@@ -2109,7 +2109,7 @@ unit pdecl;
               begin
                 consume(_FUNCTION);
                 p:=handle_procvar;
-                consume(COLON);
+                consume(_COLON);
                 pprocvardef(p)^.retdef:=single_type(hs);
                 if token=_OF then
                   begin
@@ -2145,8 +2145,8 @@ unit pdecl;
          typecanbeforward:=true;
          repeat
            typename:=pattern;
-           consume(ID);
-           consume(EQUAL);
+           consume(_ID);
+           consume(_EQUAL);
              { here you loose the strictness of pascal
              for which a redefinition like
                childtype = parenttype;
@@ -2155,7 +2155,7 @@ unit pdecl;
              here all vars from childtype and child2type
              get the definition of parenttype !!            }
 {$ifdef testequaltype}
-           if (token = ID) or (token=_FILE) or (token=_STRING) then
+           if (token = _ID) or (token=_FILE) or (token=_STRING) then
              begin
                 olddef := single_type(s);
                 { make a clone of olddef }
@@ -2202,10 +2202,10 @@ unit pdecl;
                    newtype:=ptypesym(symtablestack^.insert(newtype));
                  end;
              end;
-           consume(SEMICOLON);
+           consume(_SEMICOLON);
            if assigned(newtype^.definition) and (newtype^.definition^.deftype=procvardef) then
              parse_var_proc_directives(newtype);
-         until token<>ID;
+         until token<>_ID;
          typecanbeforward:=false;
          symtablestack^.foreach({$ifndef TP}@{$endif}testforward_type);
          resolve_forwards;
@@ -2249,11 +2249,11 @@ unit pdecl;
          repeat
            name:=pattern;
            filepos:=tokenpos;
-           consume(ID);
+           consume(_ID);
            case token of
-              EQUAL:
+             _EQUAL:
                 begin
-                   consume(EQUAL);
+                   consume(_EQUAL);
                    p:=comp_expr(true);
                    do_firstpass(p);
                    storetokenpos:=tokenpos;
@@ -2281,12 +2281,12 @@ unit pdecl;
                         Message(cg_e_illegal_expression);
                    end;
                    tokenpos:=storetokenpos;
-                   consume(SEMICOLON);
+                   consume(_SEMICOLON);
                    disposetree(p);
                 end;
-              else consume(EQUAL);
+              else consume(_EQUAL);
            end;
-         until token<>ID;
+         until token<>_ID;
          block_type:=old_block_type;
 
       end;
@@ -2348,7 +2348,7 @@ unit pdecl;
                       (not islibrary and not DLLsource) then
                      begin
                         Message(parser_e_syntax_error);
-                        consume_all_until(SEMICOLON);
+                        consume_all_until(_SEMICOLON);
                      end
                    else if islibrary then
                      read_exports;
@@ -2385,7 +2385,11 @@ unit pdecl;
 end.
 {
   $Log$
-  Revision 1.140  1999-08-04 00:23:11  florian
+  Revision 1.141  1999-08-04 13:02:51  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.140  1999/08/04 00:23:11  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.139  1999/08/03 22:02:56  peter

+ 15 - 11
compiler/pexports.pas

@@ -50,16 +50,16 @@ unit pexports;
          while true do
            begin
               hp:=new(pexported_item,init);
-              if token=ID then
+              if token=_ID then
                 begin
                    getsym(pattern,true);
                    if srsym^.typ=unitsym then
                      begin
-                        consume(ID);
-                        consume(POINT);
+                        consume(_ID);
+                        consume(_POINT);
                         getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
                      end;
-                   consume(ID);
+                   consume(_ID);
                    if assigned(srsym) then
                      begin
                         hp^.sym:=srsym;
@@ -79,7 +79,7 @@ unit pexports;
                              consume(_INDEX);
                              hp^.options:=hp^.options or eo_index;
                              val(pattern,hp^.index,code);
-                             consume(INTCONST);
+                             consume(_INTCONST);
                              DefString:=ProcName+'='+InternalProcName;{Index ignored!}
                           end;
                         if (idtoken=_NAME) then
@@ -87,7 +87,7 @@ unit pexports;
                              consume(_NAME);
                              hp^.name:=stringdup(pattern);
                              hp^.options:=hp^.options or eo_name;
-                             consume(CSTRING); {Bug fixed?}
+                             consume(_CSTRING); {Bug fixed?}
                              DefString:=hp^.name^+'='+InternalProcName;
                           end;
                         if (idtoken=_RESIDENT) then
@@ -105,13 +105,13 @@ unit pexports;
                      end;
                 end
               else
-                consume(ID);
-              if token=COMMA then
-                consume(COMMA)
+                consume(_ID);
+              if token=_COMMA then
+                consume(_COMMA)
               else
                 break;
            end;
-         consume(SEMICOLON);
+         consume(_SEMICOLON);
         if not DefFile.empty then
          DefFile.writefile;
       end;
@@ -120,7 +120,11 @@ end.
 
 {
   $Log$
-  Revision 1.10  1999-08-03 22:02:58  peter
+  Revision 1.11  1999-08-04 13:02:54  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.10  1999/08/03 22:02:58  peter
     * moved bitmask constants to sets
     * some other type/const renamings
 

+ 179 - 175
compiler/pexpr.pas

@@ -63,7 +63,7 @@ unit pexpr;
       allow_type : boolean = true;
       got_addrn  : boolean = false;
 
-    function parse_paras(_colon,in_prop_paras : boolean) : ptree;
+    function parse_paras(__colon,in_prop_paras : boolean) : ptree;
 
       var
          p1,p2 : ptree;
@@ -71,9 +71,9 @@ unit pexpr;
 
       begin
          if in_prop_paras  then
-           end_of_paras:=RECKKLAMMER
+           end_of_paras:=_RECKKLAMMER
          else
-           end_of_paras:=RKLAMMER;
+           end_of_paras:=_RKLAMMER;
          if token=end_of_paras then
            begin
               parse_paras:=nil;
@@ -86,22 +86,22 @@ unit pexpr;
               p1:=comp_expr(true);
               p2:=gencallparanode(p1,p2);
               { it's for the str(l:5,s); }
-              if _colon and (token=COLON) then
+              if __colon and (token=_COLON) then
                 begin
-                   consume(COLON);
+                   consume(_COLON);
                    p1:=comp_expr(true);
                    p2:=gencallparanode(p1,p2);
                    p2^.is_colon_para:=true;
-                   if token=COLON then
+                   if token=_COLON then
                      begin
-                        consume(COLON);
+                        consume(_COLON);
                         p1:=comp_expr(true);
                         p2:=gencallparanode(p1,p2);
                         p2^.is_colon_para:=true;
                      end
                 end;
-              if token=COMMA then
-                consume(COMMA)
+              if token=_COMMA then
+                consume(_COMMA)
               else
                 break;
            end;
@@ -149,11 +149,11 @@ unit pexpr;
         case l of
           in_ord_x :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               Must_be_valid:=true;
               p1:=comp_expr(true);
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               do_firstpass(p1);
               p1:=geninlinenode(in_ord_x,false,p1);
               do_firstpass(p1);
@@ -175,12 +175,12 @@ unit pexpr;
 
           in_typeof_x :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               {allow_type:=true;}
               p1:=comp_expr(true);
               {allow_type:=false;}
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               pd:=voidpointerdef;
               if p1^.treetype=typen then
                begin
@@ -227,12 +227,12 @@ unit pexpr;
 
           in_sizeof_x :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               {allow_type:=true;}
               p1:=comp_expr(true);
               {allow_type:=false; }
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               pd:=s32bitdef;
               if p1^.treetype=typen then
                begin
@@ -260,7 +260,7 @@ unit pexpr;
 
           in_assigned_x :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               p1:=comp_expr(true);
               Must_be_valid:=true;
@@ -276,14 +276,14 @@ unit pexpr;
               end;
               p2:=gencallparanode(p1,nil);
               p2:=geninlinenode(in_assigned_x,false,p2);
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               pd:=booldef;
               statement_syssym:=p2;
             end;
 
           in_ofs_x :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               p1:=comp_expr(true);
               p1:=gensinglenode(addrn,p1);
@@ -292,26 +292,26 @@ unit pexpr;
               { Ofs() returns a longint, not a pointer }
               p1^.resulttype:=u32bitdef;
               pd:=p1^.resulttype;
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               statement_syssym:=p1;
             end;
 
           in_addr_x :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               p1:=comp_expr(true);
               p1:=gensinglenode(addrn,p1);
               Must_be_valid:=false;
               do_firstpass(p1);
               pd:=p1^.resulttype;
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               statement_syssym:=p1;
             end;
 
           in_seg_x :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               p1:=comp_expr(true);
               do_firstpass(p1);
@@ -320,14 +320,14 @@ unit pexpr;
               p1:=genordinalconstnode(0,s32bitdef);
               Must_be_valid:=false;
               pd:=s32bitdef;
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               statement_syssym:=p1;
             end;
 
           in_high_x,
           in_low_x :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               {allow_type:=true;}
               p1:=comp_expr(true);
@@ -337,7 +337,7 @@ unit pexpr;
                 p1^.resulttype:=p1^.typenodetype;
               Must_be_valid:=false;
               p2:=geninlinenode(l,false,p1);
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               pd:=s32bitdef;
               statement_syssym:=p2;
             end;
@@ -345,13 +345,13 @@ unit pexpr;
           in_succ_x,
           in_pred_x :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               p1:=comp_expr(true);
               do_firstpass(p1);
               Must_be_valid:=false;
               p2:=geninlinenode(l,false,p1);
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               pd:=p1^.resulttype;
               statement_syssym:=p2;
             end;
@@ -359,26 +359,26 @@ unit pexpr;
           in_inc_x,
           in_dec_x :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               p1:=comp_expr(true);
               Must_be_valid:=false;
-              if token=COMMA then
+              if token=_COMMA then
                begin
-                 consume(COMMA);
+                 consume(_COMMA);
                  p2:=gencallparanode(comp_expr(true),nil);
                end
               else
                p2:=nil;
               p2:=gencallparanode(p1,p2);
               statement_syssym:=geninlinenode(l,false,p2);
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               pd:=voiddef;
             end;
 
           in_concat_x :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               p2:=nil;
               while true do
@@ -394,12 +394,12 @@ unit pexpr;
                   p2:=gennode(addn,p2,p1)
                  else
                   p2:=p1;
-                 if token=COMMA then
-                  consume(COMMA)
+                 if token=_COMMA then
+                  consume(_COMMA)
                  else
                   break;
                end;
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               pd:=cshortstringdef;
               statement_syssym:=p2;
             end;
@@ -407,13 +407,13 @@ unit pexpr;
           in_read_x,
           in_readln_x :
             begin
-              if token=LKLAMMER then
+              if token=_LKLAMMER then
                begin
-                 consume(LKLAMMER);
+                 consume(_LKLAMMER);
                  in_args:=true;
                  Must_be_valid:=false;
                  paras:=parse_paras(false,false);
-                 consume(RKLAMMER);
+                 consume(_RKLAMMER);
                end
               else
                paras:=nil;
@@ -426,13 +426,13 @@ unit pexpr;
           in_write_x,
           in_writeln_x :
             begin
-              if token=LKLAMMER then
+              if token=_LKLAMMER then
                begin
-                 consume(LKLAMMER);
+                 consume(_LKLAMMER);
                  in_args:=true;
                  Must_be_valid:=true;
                  paras:=parse_paras(true,false);
-                 consume(RKLAMMER);
+                 consume(_RKLAMMER);
                end
               else
                paras:=nil;
@@ -444,10 +444,10 @@ unit pexpr;
 
           in_str_x_string :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               paras:=parse_paras(true,false);
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               p1 := geninlinenode(l,false,paras);
               do_firstpass(p1);
               statement_syssym := p1;
@@ -456,18 +456,18 @@ unit pexpr;
 
           in_val_x:
             Begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args := true;
               p1:= gencallparanode(comp_expr(true), nil);
               Must_be_valid := False;
-              consume(COMMA);
+              consume(_COMMA);
               p2 := gencallparanode(comp_expr(true),p1);
-              if (token = COMMA) then
+              if (token = _COMMA) then
                 Begin
-                  consume(COMMA);
+                  consume(_COMMA);
                   p2 := gencallparanode(comp_expr(true),p2)
                 End;
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               p2 := geninlinenode(l,false,p2);
               do_firstpass(p2);
               statement_syssym := p2;
@@ -477,25 +477,25 @@ unit pexpr;
           in_include_x_y,
           in_exclude_x_y :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               p1:=comp_expr(true);
               Must_be_valid:=false;
-              consume(COMMA);
+              consume(_COMMA);
               p2:=comp_expr(true);
               statement_syssym:=geninlinenode(l,false,gencallparanode(p1,gencallparanode(p2,nil)));
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               pd:=voiddef;
             end;
 
           in_assert_x_y :
             begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               in_args:=true;
               p1:=comp_expr(true);
-              if token=COMMA then
+              if token=_COMMA then
                begin
-                 consume(COMMA);
+                 consume(_COMMA);
                  p2:=comp_expr(true);
                end
               else
@@ -504,7 +504,7 @@ unit pexpr;
                  p2:=genstringconstnode('');
                end;
               statement_syssym:=geninlinenode(l,false,gencallparanode(p1,gencallparanode(p2,nil)));
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               pd:=voiddef;
             end;
 
@@ -530,12 +530,12 @@ unit pexpr;
          { a subroutine ?                       }
          if not(getaddr) then
            begin
-              if token=LKLAMMER then
+              if token=_LKLAMMER then
                 begin
-                   consume(LKLAMMER);
+                   consume(_LKLAMMER);
                    in_args:=true;
                    p1^.left:=parse_paras(false,false);
-                   consume(RKLAMMER);
+                   consume(_RKLAMMER);
                 end
               else p1^.left:=nil;
 
@@ -599,11 +599,11 @@ unit pexpr;
       begin
          paras:=nil;
          { property parameters? }
-         if token=LECKKLAMMER then
+         if token=_LECKKLAMMER then
            begin
-              consume(LECKKLAMMER);
+              consume(_LECKKLAMMER);
               paras:=parse_paras(false,true);
-              consume(RECKKLAMMER);
+              consume(_RECKKLAMMER);
            end;
          { indexed property }
          if (ppo_indexed in ppropertysym(sym)^.propoptions) then
@@ -613,7 +613,7 @@ unit pexpr;
            end;
          { we need only a write property if a := follows }
          { if not(afterassignment) and not(in_args) then }
-         if token=ASSIGNMENT then
+         if token=_ASSIGNMENT then
            begin
               { write property: }
               { no result }
@@ -629,7 +629,7 @@ unit pexpr;
                           force the usage of that procedure }
                         p1^.procdefinition:=pprocdef(ppropertysym(sym)^.writeaccessdef);
                         p1^.left:=paras;
-                        consume(ASSIGNMENT);
+                        consume(_ASSIGNMENT);
                         { read the expression }
                         getprocvar:=ppropertysym(sym)^.proptype^.deftype=procvardef;
                         p2:=comp_expr(true);
@@ -654,7 +654,7 @@ unit pexpr;
                           p1:=genloadnode(pvarsym(ppropertysym(sym)^.writeaccesssym),st)
                         else
                           p1:=gensubscriptnode(pvarsym(ppropertysym(sym)^.writeaccesssym),p1);
-                        consume(ASSIGNMENT);
+                        consume(_ASSIGNMENT);
                         { read the expression }
                         p2:=comp_expr(true);
                         p1:=gennode(assignn,p1,p2);
@@ -846,7 +846,7 @@ unit pexpr;
                    ((pvarsym(sym)=opsym) and
                     ((p^.flags and pi_operator)<>0))) and
                   (p^.retdef<>pdef(voiddef)) and
-                  (token<>LKLAMMER) and
+                  (token<>_LKLAMMER) and
                   (not ((m_tp in aktmodeswitches) and
                   (afterassignment or in_args))) then
                  begin
@@ -893,7 +893,7 @@ unit pexpr;
               assigned(aktprocsym) and
               (procinfo.retdef<>pdef(voiddef)) then
             begin
-              consume(ID);
+              consume(_ID);
               p1:=genzeronode(funcretn);
               pd:=procinfo.retdef;
               p1^.funcretprocinfo:=pointer(@procinfo);
@@ -909,17 +909,17 @@ unit pexpr;
                end
               else
                getsym(pattern,true);
-              consume(ID);
+              consume(_ID);
                if not is_func_ret(srsym) then
               { else it's a normal symbol }
                 begin
                 { is it defined like UNIT.SYMBOL ? }
                   if srsym^.typ=unitsym then
                    begin
-                     consume(POINT);
+                     consume(_POINT);
                      getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
                      unit_specific:=true;
-                     consume(ID);
+                     consume(_ID);
                    end
                   else
                    unit_specific:=false;
@@ -997,20 +997,20 @@ unit pexpr;
                                    end
                                  else { not type block }
                                   begin
-                                    if token=LKLAMMER then
+                                    if token=_LKLAMMER then
                                      begin
-                                       consume(LKLAMMER);
+                                       consume(_LKLAMMER);
                                        p1:=comp_expr(true);
-                                       consume(RKLAMMER);
+                                       consume(_RKLAMMER);
                                        p1:=gentypeconvnode(p1,pd);
                                        p1^.explizit:=true;
                                      end
                                     else { not LKLAMMER}
-                                     if (token=POINT) and
+                                     if (token=_POINT) and
                                         (pd^.deftype=objectdef) and
                                         not(pobjectdef(pd)^.is_class) then
                                        begin
-                                         consume(POINT);
+                                         consume(_POINT);
                                          if assigned(procinfo._class) then
                                           begin
                                             if procinfo._class^.is_related(pobjectdef(pd)) then
@@ -1026,7 +1026,7 @@ unit pexpr;
                                                   srsymtable:=pobjectdef(pd)^.symtable;
                                                   sym:=pvarsym(srsymtable^.search(pattern));
                                                 end;
-                                               consume(ID);
+                                               consume(_ID);
                                                do_member_read(false,sym,p1,pd,again);
                                              end
                                             else
@@ -1054,7 +1054,7 @@ unit pexpr;
                                               Message(sym_e_only_static_in_static)
                                             else
                                              begin
-                                               consume(ID);
+                                               consume(_ID);
                                                do_member_read(getaddr,sym,p1,pd,again);
                                              end;
                                           end;
@@ -1160,11 +1160,11 @@ unit pexpr;
                               p1:=genzeronode(errorn);
                               p1^.resulttype:=generrordef;
                               pd:=generrordef;
-                              if token=LKLAMMER then
+                              if token=_LKLAMMER then
                                begin
-                                 consume(LKLAMMER);
+                                 consume(_LKLAMMER);
                                  parse_paras(false,false);
-                                 consume(RKLAMMER);
+                                 consume(_RKLAMMER);
                                end;
                             end;
                      else
@@ -1193,16 +1193,16 @@ unit pexpr;
            buildp:=nil;
          { be sure that a least one arrayconstructn is used, also for an
            empty [] }
-           if token=RECKKLAMMER then
+           if token=_RECKKLAMMER then
             buildp:=gennode(arrayconstructn,nil,buildp)
            else
             begin
               while true do
                begin
                  p1:=comp_expr(true);
-                 if token=POINTPOINT then
+                 if token=_POINTPOINT then
                   begin
-                    consume(POINTPOINT);
+                    consume(_POINTPOINT);
                     p2:=comp_expr(true);
                     p1:=gennode(arrayconstructrangen,p1,p2);
                   end;
@@ -1218,8 +1218,8 @@ unit pexpr;
                     lastp:=lastp^.right;
                   end;
                { there could be more elements }
-                 if token=COMMA then
-                   consume(COMMA)
+                 if token=_COMMA then
+                   consume(_COMMA)
                  else
                    break;
                end;
@@ -1263,20 +1263,20 @@ unit pexpr;
                 { try to recover }
                 repeat
                   case token of
-                   CARET:
-                     consume(CARET);
+                  _CARET:
+                     consume(_CARET);
 
-                   POINT:
+                  _POINT:
                      begin
-                        consume(POINT);
-                        consume(ID);
+                        consume(_POINT);
+                        consume(_ID);
                      end;
 
-                   LECKKLAMMER:
+                  _LECKKLAMMER:
                      begin
                         repeat
                           consume(token);
-                          until token in [RECKKLAMMER,SEMICOLON];
+                          until token in [_RECKKLAMMER,_SEMICOLON];
                      end;
                   else
                     break;
@@ -1286,9 +1286,9 @@ unit pexpr;
               end;
            { handle token }
              case token of
-                CARET:
+               _CARET:
                   begin
-                    consume(CARET);
+                    consume(_CARET);
                     if (pd^.deftype<>pointerdef) then
                       begin
                          { ^ as binary operator is a problem!!!! (FK) }
@@ -1304,7 +1304,7 @@ unit pexpr;
                       end;
                   end;
 
-                LECKKLAMMER:
+               _LECKKLAMMER:
                   begin
                     if (pd^.deftype=objectdef) and pobjectdef(pd)^.is_class then
                       begin
@@ -1322,7 +1322,7 @@ unit pexpr;
                       end
                     else
                       begin
-                        consume(LECKKLAMMER);
+                        consume(_LECKKLAMMER);
                         repeat
                           case pd^.deftype of
                             pointerdef:
@@ -1349,9 +1349,9 @@ unit pexpr;
                                        (p1^.symtableentry^.name='MEMW') or
                                        (p1^.symtableentry^.name='MEML')) then
                                      begin
-                                       if (token=COLON) then
+                                       if (token=_COLON) then
                                         begin
-                                          consume(COLON);
+                                          consume(_COLON);
                                           p3:=gennode(muln,genordinalconstnode($10,s32bitdef),p2);
                                           p2:=comp_expr(true);
                                           p2:=gennode(addn,p2,p3);
@@ -1377,16 +1377,16 @@ unit pexpr;
                               again:=false;
                             end;
                           end;
-                          if token=COMMA then
-                            consume(COMMA)
+                          if token=_COMMA then
+                            consume(_COMMA)
                           else
                             break;
                         until false;
-                        consume(RECKKLAMMER);
+                        consume(_RECKKLAMMER);
                       end;
                   end;
-          POINT : begin
-                    consume(POINT);
+         _POINT : begin
+                    consume(_POINT);
                     if (pd^.deftype=pointerdef) and
                       (m_autoderef in aktmodeswitches) then
                       begin
@@ -1408,7 +1408,7 @@ unit pexpr;
                                 p1:=gensubscriptnode(sym,p1);
                                 pd:=sym^.definition;
                               end;
-                            consume(ID);
+                            consume(_ID);
                           end;
 
                         classrefdef:
@@ -1423,7 +1423,7 @@ unit pexpr;
                                  break;
                                 classh:=classh^.childof;
                               end;
-                             consume(ID);
+                             consume(_ID);
                              do_member_read(getaddr,sym,p1,pd,again);
                            end;
 
@@ -1442,7 +1442,7 @@ unit pexpr;
                                 classh:=classh^.childof;
                               end;
                              allow_only_static:=store_static;
-                             consume(ID);
+                             consume(_ID);
                              do_member_read(getaddr,sym,p1,pd,again);
                            end;
 
@@ -1470,9 +1470,9 @@ unit pexpr;
                        if getprocvar and is_equal(pd,getprocvardef) then
                          again:=false
                        else
-                         if (token=LKLAMMER) or
+                         if (token=_LKLAMMER) or
                             ((pprocvardef(pd)^.para1=nil) and
-                             (not((token in [ASSIGNMENT,UNEQUAL,EQUAL]))) and
+                             (not((token in [_ASSIGNMENT,_UNEQUAL,_EQUAL]))) and
                              (not afterassignment) and
                              (not in_args)) then
                            begin
@@ -1483,15 +1483,15 @@ unit pexpr;
                               p1^.right:=p2;
                               p1^.unit_specific:=unit_specific;
                               p1^.symtableprocentry:=pprocsym(sym);
-                              if token=LKLAMMER then
+                              if token=_LKLAMMER then
                                 begin
-                                   consume(LKLAMMER);
+                                   consume(_LKLAMMER);
                                    p1^.left:=parse_paras(false,false);
-                                   consume(RKLAMMER);
+                                   consume(_RKLAMMER);
                                 end;
                               pd:=pprocvardef(pd)^.retdef;
                            { proc():= is never possible }
-                              if token=ASSIGNMENT then
+                              if token=_ASSIGNMENT then
                                begin
                                  Message(cg_e_illegal_expression);
                                  p1:=genzeronode(errorn);
@@ -1523,7 +1523,7 @@ unit pexpr;
         oldp1:=nil;
         p1:=nil;
         filepos:=tokenpos;
-        if token=ID then
+        if token=_ID then
          begin
            factor_read_id;
            { handle post fix operators }
@@ -1533,7 +1533,7 @@ unit pexpr;
          case token of
         _NEW : begin
                  consume(_NEW);
-                 consume(LKLAMMER);
+                 consume(_LKLAMMER);
                  {allow_type:=true;}
                  p1:=factor(false);
                  {allow_type:=false;}
@@ -1550,14 +1550,14 @@ unit pexpr;
                  if (pd^.deftype<>pointerdef) then
                    Message(type_e_pointer_type_expected)
                  else if {(ppointerdef(pd)^.definition^.deftype<>objectdef)}
-                       token=RKLAMMER then
+                       token=_RKLAMMER then
                   begin
                     if (ppointerdef(pd)^.definition^.deftype=objectdef) and
                        (oo_has_vmt in pobjectdef(ppointerdef(pd)^.definition)^.objectoptions)  then
                      Message(parser_w_use_extended_syntax_for_objects);
                     p1:=gensinglenode(newn,nil);
                     p1^.resulttype:=pd2;
-                    consume(RKLAMMER);
+                    consume(_RKLAMMER);
                     (*Message(parser_e_pointer_to_class_expected);
                     { if an error occurs, read til the end of
                       the new statement }
@@ -1566,8 +1566,8 @@ unit pexpr;
                     while true do
                      begin
                        case token of
-                        LKLAMMER : inc(l);
-                        RKLAMMER : dec(l);
+                        _LKLAMMER : inc(l);
+                        _RKLAMMER : dec(l);
                        end;
                        consume(token);
                        if l=0 then
@@ -1579,7 +1579,7 @@ unit pexpr;
                     disposetree(p1);
                     p1:=genzeronode(hnewn);
                     p1^.resulttype:=ppointerdef(pd)^.definition;
-                    consume(COMMA);
+                    consume(_COMMA);
                     afterassignment:=false;
                     { determines the current object defintion }
                     classh:=pobjectdef(ppointerdef(pd)^.definition);
@@ -1601,7 +1601,7 @@ unit pexpr;
                        classh:=classh^.childof;
                      end;
 
-                    consume(ID);
+                    consume(_ID);
                     do_member_read(false,sym,p1,pd,again);
                     if (p1^.treetype<>calln) or
                        (assigned(p1^.procdefinition) and
@@ -1610,7 +1610,7 @@ unit pexpr;
                     p1:=gensinglenode(newn,p1);
                     { set the resulttype }
                     p1^.resulttype:=pd2;
-                    consume(RKLAMMER);
+                    consume(_RKLAMMER);
                   end;
                end;
        _SELF : begin
@@ -1656,7 +1656,7 @@ unit pexpr;
                           p1:=genzeronode(typen);
                           p1^.resulttype:=classh;
                           pd:=p1^.resulttype;
-                          consume(ID);
+                          consume(_ID);
                           do_member_read(false,sym,p1,pd,again);
                           break;
                         end;
@@ -1679,7 +1679,7 @@ unit pexpr;
                    end;
                  postfixoperators;
                end;
-    INTCONST : begin
+   _INTCONST : begin
                  valint(pattern,l,code);
                  if code<>0 then
                   begin
@@ -1687,40 +1687,40 @@ unit pexpr;
                     if code<>0 then
                      begin
                        Message(cg_e_invalid_integer);
-                       consume(INTCONST);
+                       consume(_INTCONST);
                        l:=1;
                        p1:=genordinalconstnode(l,s32bitdef);
                      end
                     else
                      begin
-                       consume(INTCONST);
+                       consume(_INTCONST);
                        p1:=genrealconstnode(d,bestrealdef^);
                      end;
                   end
                  else
                   begin
-                    consume(INTCONST);
+                    consume(_INTCONST);
                     p1:=genordinalconstnode(l,s32bitdef);
                   end;
                end;
-  REALNUMBER : begin
+ _REALNUMBER : begin
                  val(pattern,d,code);
                  if code<>0 then
                   begin
                     Message(parser_e_error_in_real);
                     d:=1.0;
                   end;
-                 consume(REALNUMBER);
+                 consume(_REALNUMBER);
                  p1:=genrealconstnode(d,bestrealdef^);
                end;
      _STRING : begin
                  pd:=stringtype;
                  { STRING can be also a type cast }
-                 if token=LKLAMMER then
+                 if token=_LKLAMMER then
                   begin
-                    consume(LKLAMMER);
+                    consume(_LKLAMMER);
                     p1:=comp_expr(true);
-                    consume(RKLAMMER);
+                    consume(_RKLAMMER);
                     p1:=gentypeconvnode(p1,pd);
                     p1^.explizit:=true;
                     { handle postfix operators here e.g. string(a)[10] }
@@ -1734,11 +1734,11 @@ unit pexpr;
                  pd:=cfiledef;
                  consume(_FILE);
                  { FILE can be also a type cast }
-                 if token=LKLAMMER then
+                 if token=_LKLAMMER then
                   begin
-                    consume(LKLAMMER);
+                    consume(_LKLAMMER);
                     p1:=comp_expr(true);
-                    consume(RKLAMMER);
+                    consume(_RKLAMMER);
                     p1:=gentypeconvnode(p1,pd);
                     p1^.explizit:=true;
                     { handle postfix operators here e.g. string(a)[10] }
@@ -1748,28 +1748,28 @@ unit pexpr;
                  else
                   p1:=gentypenode(pd,nil);
                end;
-     CSTRING : begin
+    _CSTRING : begin
                  p1:=genstringconstnode(pattern);
-                 consume(CSTRING);
+                 consume(_CSTRING);
                end;
-       CCHAR : begin
+      _CCHAR : begin
                  p1:=genordinalconstnode(ord(pattern[1]),cchardef);
-                 consume(CCHAR);
+                 consume(_CCHAR);
                end;
- KLAMMERAFFE : begin
-                 consume(KLAMMERAFFE);
+_KLAMMERAFFE : begin
+                 consume(_KLAMMERAFFE);
                  got_addrn:=true;
                  p1:=factor(true);
                  got_addrn:=false;
                  p1:=gensinglenode(addrn,p1);
                end;
-    LKLAMMER : begin
-                 consume(LKLAMMER);
+   _LKLAMMER : begin
+                 consume(_LKLAMMER);
                  p1:=comp_expr(true);
-                 consume(RKLAMMER);
+                 consume(_RKLAMMER);
                  { it's not a good solution     }
                  { but (a+b)^ makes some problems  }
-                 if token in [CARET,POINT,LECKKLAMMER] then
+                 if token in [_CARET,_POINT,_LECKKLAMMER] then
                   begin
                     { we need the resulttype  }
                     { of the expression in pd }
@@ -1779,17 +1779,17 @@ unit pexpr;
                     postfixoperators;
                   end;
                end;
- LECKKLAMMER : begin
-                 consume(LECKKLAMMER);
+_LECKKLAMMER : begin
+                 consume(_LECKKLAMMER);
                  p1:=factor_read_set;
-                 consume(RECKKLAMMER);
+                 consume(_RECKKLAMMER);
                end;
-        PLUS : begin
-                 consume(PLUS);
+       _PLUS : begin
+                 consume(_PLUS);
                  p1:=factor(false);
                end;
-       MINUS : begin
-                 consume(MINUS);
+      _MINUS : begin
+                 consume(_MINUS);
                  p1:=factor(false);
                  p1:=gensinglenode(umminusn,p1);
                end;
@@ -1823,7 +1823,7 @@ unit pexpr;
         { tp7 procvar handling, but not if the next token
           will be a := }
         if (m_tp_procvar in aktmodeswitches) and
-           (token<>ASSIGNMENT) then
+           (token<>_ASSIGNMENT) then
           check_tp_procvar(p1);
         factor:=p1;
         check_tokenpos;
@@ -1844,19 +1844,19 @@ unit pexpr;
     const
       tok2nodes=23;
       tok2node:array[1..tok2nodes] of ttok2noderec=(
-        (tok:PLUS    ;nod:addn),
-        (tok:MINUS   ;nod:subn),
-        (tok:STAR    ;nod:muln),
-        (tok:SLASH   ;nod:slashn),
-        (tok:EQUAL   ;nod:equaln),
-        (tok:GT      ;nod:gtn),
-        (tok:LT      ;nod:ltn),
-        (tok:GTE     ;nod:gten),
-        (tok:LTE     ;nod:lten),
-        (tok:SYMDIF  ;nod:symdifn),
-        (tok:STARSTAR;nod:starstarn),
-        (tok:CARET   ;nod:caretn),
-        (tok:UNEQUAL ;nod:unequaln),
+        (tok:_PLUS    ;nod:addn),
+        (tok:_MINUS   ;nod:subn),
+        (tok:_STAR    ;nod:muln),
+        (tok:_SLASH   ;nod:slashn),
+        (tok:_EQUAL   ;nod:equaln),
+        (tok:_GT      ;nod:gtn),
+        (tok:_LT      ;nod:ltn),
+        (tok:_GTE     ;nod:gten),
+        (tok:_LTE     ;nod:lten),
+        (tok:_SYMDIF  ;nod:symdifn),
+        (tok:_STARSTAR;nod:starstarn),
+        (tok:_CARET   ;nod:caretn),
+        (tok:_UNEQUAL ;nod:unequaln),
         (tok:_AS     ;nod:asn),
         (tok:_IN     ;nod:inn),
         (tok:_IS     ;nod:isn),
@@ -1869,9 +1869,9 @@ unit pexpr;
         (tok:_XOR    ;nod:xorn)
       );
       operator_levels:array[Toperator_precedence] of set of Ttoken=
-         ([LT,LTE,GT,GTE,EQUAL,UNEQUAL,_IN,_IS],
-          [PLUS,MINUS,_OR,_XOR],
-          [CARET,SYMDIF,STARSTAR,STAR,SLASH,_DIV,_MOD,_AND,_SHL,_SHR,_AS]);
+         ([_LT,_LTE,_GT,_GTE,_EQUAL,_UNEQUAL,_IN,_IS],
+          [_PLUS,_MINUS,_OR,_XOR],
+          [_CARET,_SYMDIF,_STARSTAR,_STAR,_SLASH,_DIV,_MOD,_AND,_SHL,_SHR,_AS]);
 
     function sub_expr(pred_level:Toperator_precedence;accept_equal : boolean):Ptree;
     {Reads a subexpression while the operators are of the current precedence
@@ -1889,7 +1889,7 @@ unit pexpr;
           p1:=sub_expr(succ(pred_level),true);
         repeat
           if (token in operator_levels[pred_level]) and
-             ((token<>EQUAL) or accept_equal) then
+             ((token<>_EQUAL) or accept_equal) then
            begin
              oldt:=token;
              filepos:=tokenpos;
@@ -1946,19 +1946,19 @@ unit pexpr;
          p1:=sub_expr(opcompare,true);
          filepos:=tokenpos;
          if (m_tp_procvar in aktmodeswitches) and
-            (token<>ASSIGNMENT) then
+            (token<>_ASSIGNMENT) then
            check_tp_procvar(p1);
-         if token in [ASSIGNMENT,_PLUSASN,_MINUSASN,_STARASN,_SLASHASN] then
+         if token in [_ASSIGNMENT,_PLUSASN,_MINUSASN,_STARASN,_SLASHASN] then
            afterassignment:=true;
          oldp1:=p1;
          case token of
-            POINTPOINT : begin
-                            consume(POINTPOINT);
+           _POINTPOINT : begin
+                            consume(_POINTPOINT);
                             p2:=sub_expr(opcompare,true);
                             p1:=gennode(rangen,p1,p2);
                          end;
-            ASSIGNMENT : begin
-                            consume(ASSIGNMENT);
+           _ASSIGNMENT : begin
+                            consume(_ASSIGNMENT);
                             { avoid a firstpass of a procedure if
                             it must be assigned to a procvar }
                             { should be recursive for a:=b:=c !!! }
@@ -2061,7 +2061,11 @@ unit pexpr;
 end.
 {
   $Log$
-  Revision 1.130  1999-08-04 00:23:12  florian
+  Revision 1.131  1999-08-04 13:02:55  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.130  1999/08/04 00:23:12  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.129  1999/08/03 22:02:59  peter

+ 31 - 19
compiler/pmodules.pas

@@ -176,6 +176,10 @@ unit pmodules;
             target_alpha_linux:
               ;
 {$endif alpha}
+{$ifdef powerpc}
+            target_powerpc_linux:
+              ;
+{$endif powerpc}
 {$ifdef m68k}
             target_m68k_Mac:
               bsssegment^.concat(new(pai_datablock,init_global('HEAP',4)));
@@ -205,6 +209,10 @@ unit pmodules;
           target_alpha_linux:
             ;
 {$endif alpha}
+{$ifdef powerpc}
+          target_powerpc_linux:
+            ;
+{$endif powerpc}
 {$ifdef i386}
           target_i386_GO32V2 :
             begin
@@ -557,8 +565,8 @@ unit pmodules;
         make_ref:=true;
         { if POWER is defined in the RTL then use it for starstar overloading }
         getsym('POWER',false);
-        if assigned(srsym) and (srsym^.typ=procsym) and (overloaded_operators[STARSTAR]=nil) then
-          overloaded_operators[STARSTAR]:=pprocsym(srsym);
+        if assigned(srsym) and (srsym^.typ=procsym) and (overloaded_operators[_STARSTAR]=nil) then
+          overloaded_operators[_STARSTAR]:=pprocsym(srsym);
       { Objpas unit? }
         if m_objpas in aktmodeswitches then
          begin
@@ -615,7 +623,7 @@ unit pmodules;
 {$endif DEBUG}
          repeat
            s:=pattern;
-           consume(ID);
+           consume(_ID);
          { Give a warning if objpas is loaded }
            if s='OBJPAS' then
             Message(parser_w_no_objpas_use_mode);
@@ -641,15 +649,15 @@ unit pmodules;
             end
            else
             Message1(sym_e_duplicate_id,s);
-           if token=COMMA then
+           if token=_COMMA then
             begin
               pattern:='';
-              consume(COMMA);
+              consume(_COMMA);
             end
            else
             break;
          until false;
-         consume(SEMICOLON);
+         consume(_SEMICOLON);
 
          { set the symtable to systemunit so it gets reorderd correctly }
          symtablestack:=defaultsymtablestack;
@@ -820,7 +828,7 @@ unit pmodules;
          s1,s2  : ^string; {Saves stack space}
       begin
          consume(_UNIT);
-         if token=ID then
+         if token=_ID then
           begin
           { create filenames and unit name }
              current_module^.SetFileName(current_scanner^.inputfile^.path^+current_scanner^.inputfile^.name^,true);
@@ -852,8 +860,8 @@ unit pmodules;
              dispose(s1);
           end;
 
-         consume(ID);
-         consume(SEMICOLON);
+         consume(_ID);
+         consume(_SEMICOLON);
          consume(_INTERFACE);
          { global switches are read, so further changes aren't allowed }
          current_module^.in_global:=false;
@@ -1057,7 +1065,7 @@ unit pmodules;
            end;
 
          { the last char should always be a point }
-         consume(POINT);
+         consume(_POINT);
 
          { avoid self recursive destructor call !! PM }
          aktprocsym^.definition^.localst:=nil;
@@ -1190,8 +1198,8 @@ unit pmodules;
               current_module^.modulename:=stringdup(pattern);
               current_module^.islibrary:=true;
               exportlib^.preparelib(pattern);
-              consume(ID);
-              consume(SEMICOLON);
+              consume(_ID);
+              consume(_SEMICOLON);
            end
          else
            { is there an program head ? }
@@ -1200,14 +1208,14 @@ unit pmodules;
               consume(_PROGRAM);
               stringdispose(current_module^.modulename);
               current_module^.modulename:=stringdup(pattern);
-              consume(ID);
-              if token=LKLAMMER then
+              consume(_ID);
+              if token=_LKLAMMER then
                 begin
-                   consume(LKLAMMER);
+                   consume(_LKLAMMER);
                    idlist;
-                   consume(RKLAMMER);
+                   consume(_RKLAMMER);
                 end;
-              consume(SEMICOLON);
+              consume(_SEMICOLON);
             end;
 
          { global switches are read, so further changes aren't allowed }
@@ -1286,7 +1294,7 @@ unit pmodules;
          codegen_doneprocedure;
 
          { consume the last point }
-         consume(POINT);
+         consume(_POINT);
 
 {$ifdef New_GDB}
          write_gdb_info;
@@ -1353,7 +1361,11 @@ unit pmodules;
 end.
 {
   $Log$
-  Revision 1.139  1999-08-04 00:23:15  florian
+  Revision 1.140  1999-08-04 13:02:57  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.139  1999/08/04 00:23:15  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.138  1999/08/03 22:03:02  peter

+ 59 - 52
compiler/pstatmnt.pas

@@ -64,6 +64,9 @@ unit pstatmnt;
 {$ifdef alpha}
        ,tgeni386  { this is a dummy!! }
 {$endif alpha}
+{$ifdef powerpc}
+       ,tgeni386  { this is a dummy!! }
+{$endif powerpc}
        ;
 
 
@@ -112,7 +115,7 @@ unit pstatmnt;
                    last^.left:=gennode(statementn,nil,statement);
                    last:=last^.left;
                 end;
-              if not try_to_consume(SEMICOLON) then
+              if not try_to_consume(_SEMICOLON) then
                 break;
               emptystats;
            end;
@@ -233,13 +236,13 @@ unit pstatmnt;
                   newcaselabel(hl1,hl1,firstlabel);
                end;
              disposetree(p);
-             if token=COMMA then
-               consume(COMMA)
+             if token=_COMMA then
+               consume(_COMMA)
              else
                break;
              firstlabel:=false;
            until false;
-           consume(COLON);
+           consume(_COLON);
 
            { handles instruction block }
            p:=gensinglenode(labeln,statement);
@@ -249,7 +252,7 @@ unit pstatmnt;
            instruc:=gennode(statementn,instruc,p);
 
            if not((token=_ELSE) or (token=_OTHERWISE) or (token=_END)) then
-             consume(SEMICOLON);
+             consume(_SEMICOLON);
          until (token=_ELSE) or (token=_OTHERWISE) or (token=_END);
 
          if (token=_ELSE) or (token=_OTHERWISE) then
@@ -295,7 +298,7 @@ unit pstatmnt;
                    last^.left:=gennode(statementn,nil,statement);
                    last:=last^.left;
                 end;
-              if not try_to_consume(SEMICOLON) then
+              if not try_to_consume(_SEMICOLON) then
                 break;
               emptystats;
            end;
@@ -413,9 +416,9 @@ unit pstatmnt;
                            symtablestack:=withsymtable;
                         end;
             end;
-            if token=COMMA then
+            if token=_COMMA then
              begin
-               consume(COMMA);
+               consume(_COMMA);
              {$ifdef tp}
                right:=_with_statement;
              {$else}
@@ -425,7 +428,7 @@ unit pstatmnt;
             else
              begin
                consume(_DO);
-               if token<>SEMICOLON then
+               if token<>_SEMICOLON then
                 right:=statement
                else
                 right:=nil;
@@ -438,9 +441,9 @@ unit pstatmnt;
           begin
             Message(parser_e_false_with_expr);
             { try to recover from error }
-            if token=COMMA then
+            if token=_COMMA then
              begin
-               consume(COMMA);
+               consume(_COMMA);
              {$ifdef tp}
                hp:=_with_statement;
              {$else}
@@ -451,7 +454,7 @@ unit pstatmnt;
              begin
                consume(_DO);
                { ignore all }
-               if token<>SEMICOLON then
+               if token<>_SEMICOLON then
                 statement;
              end;
             _with_statement:=nil;
@@ -475,12 +478,12 @@ unit pstatmnt;
          p1:=nil;
          p2:=nil;
          consume(_RAISE);
-         if token<>SEMICOLON then
+         if token<>_SEMICOLON then
            begin
               p1:=comp_expr(true);
               if (idtoken=_AT) then
                 begin
-                   consume(ID);
+                   consume(_ID);
                    p2:=comp_expr(true);
                 end;
            end
@@ -528,7 +531,7 @@ unit pstatmnt;
                    last^.left:=gennode(statementn,nil,statement);
                    last:=last^.left;
                 end;
-              if not try_to_consume(SEMICOLON) then
+              if not try_to_consume(_SEMICOLON) then
                 break;
               emptystats;
            end;
@@ -552,21 +555,21 @@ unit pstatmnt;
                 begin
                    repeat
                      consume(_ON);
-                     if token=ID then
+                     if token=_ID then
                        begin
                           getsym(pattern,false);
                           objname:=pattern;
-                          consume(ID);
+                          consume(_ID);
                           { is a explicit name for the exception given ? }
-                          if try_to_consume(COLON) then
+                          if try_to_consume(_COLON) then
                             begin
                                getsym(pattern,true);
-                               consume(ID);
+                               consume(_ID);
                                if srsym^.typ=unitsym then
                                  begin
-                                    consume(POINT);
+                                    consume(_POINT);
                                     getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
-                                    consume(ID);
+                                    consume(_ID);
                                  end;
                                if (srsym^.typ=typesym) and
                                  (ptypesym(srsym)^.definition^.deftype=objectdef) and
@@ -589,9 +592,9 @@ unit pstatmnt;
                                { only exception type }
                                if srsym^.typ=unitsym then
                                  begin
-                                    consume(POINT);
+                                    consume(_POINT);
                                     getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
-                                    consume(ID);
+                                    consume(_ID);
                                  end;
                                if (srsym^.typ=typesym) and
                                  (ptypesym(srsym)^.definition^.deftype=objectdef) and
@@ -606,7 +609,7 @@ unit pstatmnt;
                             end;
                        end
                      else
-                       consume(ID);
+                       consume(_ID);
                      consume(_DO);
                      hp:=gennode(onn,nil,statement);
                      if ot^.deftype=errordef then
@@ -631,7 +634,7 @@ unit pstatmnt;
                      { remove exception symtable }
                      if assigned(exceptsymtable) then
                        dellexlevel;
-                     if not try_to_consume(SEMICOLON) then
+                     if not try_to_consume(_SEMICOLON) then
                         break;
                      emptystats;
                    until (token=_END) or(token=_ELSE);
@@ -664,10 +667,10 @@ unit pstatmnt;
 
       begin
          consume(_EXIT);
-         if try_to_consume(LKLAMMER) then
+         if try_to_consume(_LKLAMMER) then
            begin
               p:=comp_expr(true);
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
               if in_except_block then
                 Message(parser_e_exit_with_argument_not__possible);
               if procinfo.retdef=pdef(voiddef) then
@@ -735,11 +738,11 @@ unit pstatmnt;
 
 {$ifndef newcg}
          { END is read }
-         if try_to_consume(LECKKLAMMER) then
+         if try_to_consume(_LECKKLAMMER) then
            begin
               { it's possible to specify the modified registers }
               asmstat^.object_preserved:=true;
-              if token<>RECKKLAMMER then
+              if token<>_RECKKLAMMER then
                 repeat
                 { uppercase, because it's a CSTRING }
                   uppervar(pattern);
@@ -772,12 +775,12 @@ unit pstatmnt;
                   else if pattern='A1' then
                     usedinproc:=usedinproc or ($800 shr word(R_A1))
 {$endif m68k}
-                  else consume(RECKKLAMMER);
-                  consume(CSTRING);
-                  if not try_to_consume(COMMA) then
+                  else consume(_RECKKLAMMER);
+                  consume(_CSTRING);
+                  if not try_to_consume(_COMMA) then
                     break;
                 until false;
-              consume(RECKKLAMMER);
+              consume(_RECKKLAMMER);
            end
          else usedinproc:=$ff;
 {$endif newcg}
@@ -817,7 +820,7 @@ unit pstatmnt;
                 consume(_DISPOSE);
                 tt:=hdisposen;
             end;
-          consume(LKLAMMER);
+          consume(_LKLAMMER);
 
           { displaced here to avoid warnings in BP mode (PM) }
           Store_valid := Must_be_valid;
@@ -838,13 +841,13 @@ unit pstatmnt;
                new(o,init);     (*Also a valid new statement*)
            end;}
 
-          if try_to_consume(COMMA) then
+          if try_to_consume(_COMMA) then
             begin
                    { extended syntax of new and dispose }
                    { function styled new is handled in factor }
                    { destructors have no parameters }
                    destrukname:=pattern;
-                   consume(ID);
+                   consume(_ID);
 
                    pd:=p^.resulttype;
                    pd2:=pd;
@@ -852,7 +855,7 @@ unit pstatmnt;
                      begin
                         Message(type_e_pointer_type_expected);
                         p:=factor(false);
-                        consume(RKLAMMER);
+                        consume(_RKLAMMER);
                         new_dispose_statement:=genzeronode(errorn);
                         exit;
                      end;
@@ -861,8 +864,8 @@ unit pstatmnt;
                      begin
                         Message(parser_e_pointer_to_class_expected);
                         new_dispose_statement:=factor(false);
-                        consume_all_until(RKLAMMER);
-                        consume(RKLAMMER);
+                        consume_all_until(_RKLAMMER);
+                        consume(_RKLAMMER);
                         exit;
                      end;
                    { check, if the first parameter is a pointer to a _class_ }
@@ -871,8 +874,8 @@ unit pstatmnt;
                      begin
                         Message(parser_e_no_new_or_dispose_for_classes);
                         new_dispose_statement:=factor(false);
-                        consume_all_until(RKLAMMER);
-                        consume(RKLAMMER);
+                        consume_all_until(_RKLAMMER);
+                        consume(_RKLAMMER);
                         exit;
                      end;
                    { search cons-/destructor, also in parent classes }
@@ -943,7 +946,7 @@ unit pstatmnt;
                      end;
                  end;
             end;
-          consume(RKLAMMER);
+          consume(_RKLAMMER);
       end;
 
 
@@ -976,12 +979,12 @@ unit pstatmnt;
               else
                 begin
                    { if no semicolon, then error and go on }
-                   if token<>SEMICOLON then
+                   if token<>_SEMICOLON then
                      begin
-                        consume(SEMICOLON);
-                        consume_all_until(SEMICOLON);
+                        consume(_SEMICOLON);
+                        consume_all_until(_SEMICOLON);
                      end;
-                   consume(SEMICOLON);
+                   consume(_SEMICOLON);
                 end;
               emptystats;
            end;
@@ -1018,7 +1021,7 @@ unit pstatmnt;
                        if not(cs_support_goto in aktmoduleswitches)then
                         Message(sym_e_goto_and_label_not_supported);
                        consume(_GOTO);
-                       if (token<>INTCONST) and (token<>ID) then
+                       if (token<>_INTCONST) and (token<>_ID) then
                          begin
                             Message(sym_e_label_not_found);
                             code:=genzeronode(errorn);
@@ -1049,7 +1052,7 @@ unit pstatmnt;
             _TRY : code:=try_statement;
             _RAISE : code:=raise_statement;
             { semicolons,else until and end are ignored }
-            SEMICOLON,
+            _SEMICOLON,
             _ELSE,
             _UNTIL,
             _END:
@@ -1070,8 +1073,8 @@ unit pstatmnt;
                    end;
          else
            begin
-              if (token=INTCONST) or
-                 ((token=ID) and not((m_result in aktmodeswitches) and (idtoken=_RESULT))) then
+              if (token=_INTCONST) or
+                 ((token=_ID) and not((m_result in aktmodeswitches) and (idtoken=_RESULT))) then
                 begin
                    getsym(pattern,true);
                    lastsymknown:=true;
@@ -1082,7 +1085,7 @@ unit pstatmnt;
                    if assigned(srsym) and (srsym^.typ=labelsym) then
                      begin
                         consume(token);
-                        consume(COLON);
+                        consume(_COLON);
                         if plabelsym(srsym)^.defined then
                           Message(sym_e_label_already_defined);
                         plabelsym(srsym)^.defined:=true;
@@ -1288,7 +1291,11 @@ unit pstatmnt;
 end.
 {
   $Log$
-  Revision 1.96  1999-08-04 00:23:19  florian
+  Revision 1.97  1999-08-04 13:02:59  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.96  1999/08/04 00:23:19  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.95  1999/08/03 22:03:03  peter

+ 43 - 39
compiler/psub.pas

@@ -98,7 +98,7 @@ var
   varspez : Tvarspez;
   inserthigh : boolean;
 begin
-  consume(LKLAMMER);
+  consume(_LKLAMMER);
   inc(testcurobject);
   repeat
     if try_to_consume(_VAR) then
@@ -131,7 +131,7 @@ begin
 {$endif}
             inc(procinfo.ESI_offset,vs^.address);
             consume(idtoken);
-            consume(COLON);
+            consume(_COLON);
             p:=single_type(hs1);
             if assigned(readtypesym) then
              aktprocsym^.definition^.concattypesym(readtypesym,vs_value)
@@ -140,16 +140,16 @@ begin
             CheckTypes(p,procinfo._class);
            end
          else
-           consume(ID);
+           consume(_ID);
       end
     else
       begin
        { read identifiers }
          sc:=idlist;
        { read type declaration, force reading for value and const paras }
-         if (token=COLON) or (varspez=vs_value) then
+         if (token=_COLON) or (varspez=vs_value) then
           begin
-            consume(COLON);
+            consume(_COLON);
           { check for an open array }
             if token=_ARRAY then
              begin
@@ -270,9 +270,9 @@ begin
          tokenpos:=storetokenpos;
       end;
     aktprocsym^.definition^.setmangledname(hs2);
-  until not try_to_consume(SEMICOLON);
+  until not try_to_consume(_SEMICOLON);
   dec(testcurobject);
-  consume(RKLAMMER);
+  consume(_RKLAMMER);
 end;
 
 
@@ -301,11 +301,11 @@ begin
     begin
       sp:=pattern;
       realname:=orgpattern;
-      consume(ID);
+      consume(_ID);
     end;
 
 { method ? }
-  if not(parse_only) and try_to_consume(POINT) then
+  if not(parse_only) and try_to_consume(_POINT) then
    begin
      getsym(sp,true);
      sym:=srsym;
@@ -315,7 +315,7 @@ begin
        begin
           Message(parser_e_class_id_expected);
           aktprocsym:=nil;
-          consume(ID);
+          consume(_ID);
        end
      else
        begin
@@ -323,7 +323,7 @@ begin
           aktobjectdef:=pobjectdef(ptypesym(sym)^.definition);
           sp:=pattern;
           realname:=orgpattern;
-          consume(ID);
+          consume(_ID);
           procinfo._class:=pobjectdef(ptypesym(sym)^.definition);
           aktprocsym:=pprocsym(procinfo._class^.symtable^.search(sp));
           aktobjectdef:=nil;
@@ -525,7 +525,7 @@ begin
   { otherwise we get subbtle problems with
     definitions of args defs in staticsymtable for
     implementation of a global method }
-  if token=LKLAMMER then
+  if token=_LKLAMMER then
     formal_parameter_list;
   { so we only restore the symtable now }
   symtablestack:=st;
@@ -552,18 +552,18 @@ begin
      _FUNCTION : begin
                    consume(_FUNCTION);
                    parse_proc_head(potype_none);
-                   if token<>COLON then
+                   if token<>_COLON then
                     begin
                        if not(aktprocsym^.definition^.forwarddef) or
                          (m_repeat_forward in aktmodeswitches) then
                        begin
-                         consume(COLON);
-                         consume_all_until(SEMICOLON);
+                         consume(_COLON);
+                         consume_all_until(_SEMICOLON);
                        end;
                     end
                    else
                     begin
-                      consume(COLON);
+                      consume(_COLON);
                       inc(testcurobject);
                       aktprocsym^.definition^.retdef:=single_type(hs);
                       aktprocsym^.definition^.test_if_fpu_result;
@@ -603,35 +603,35 @@ begin
                    if lexlevel>normal_function_level then
                      Message(parser_e_no_local_operator);
                    consume(_OPERATOR);
-                   if not(token in [PLUS..last_overloaded]) then
+                   if not(token in [_PLUS..last_overloaded]) then
                      Message(parser_e_overload_operator_failed);
                    optoken:=token;
                    consume(Token);
                    procinfo.flags:=procinfo.flags or pi_operator;
                    parse_proc_head(potype_operator);
-                   if token<>ID then
+                   if token<>_ID then
                      begin
                         opsym:=nil;
                         if not(m_result in aktmodeswitches) then
-                          consume(ID);
+                          consume(_ID);
                      end
                    else
                      begin
                        opsym:=new(pvarsym,init(pattern,voiddef));
-                       consume(ID);
+                       consume(_ID);
                      end;
-                   if not try_to_consume(COLON) then
+                   if not try_to_consume(_COLON) then
                      begin
-                       consume(COLON);
+                       consume(_COLON);
                        aktprocsym^.definition^.retdef:=generrordef;
-                       consume_all_until(SEMICOLON);
+                       consume_all_until(_SEMICOLON);
                      end
                    else
                     begin
                       aktprocsym^.definition^.retdef:=
                        single_type(hs);
                       aktprocsym^.definition^.test_if_fpu_result;
-                      if (optoken in [EQUAL,GT,LT,GTE,LTE]) and
+                      if (optoken in [_EQUAL,_GT,_LT,_GTE,_LTE]) and
                          ((aktprocsym^.definition^.retdef^.deftype<>
                          orddef) or (porddef(aktprocsym^.definition^.
                          retdef)^.typ<>bool8bit)) then
@@ -652,7 +652,7 @@ begin
 {$else}
     aktprocsym^.definition^.procoptions:=aktprocsym^.definition^.procoptions+[po_classmethod];
 {$endif}
-  consume(SEMICOLON);
+  consume(_SEMICOLON);
   dec(lexlevel);
 end;
 
@@ -717,24 +717,24 @@ end;
 
 procedure pd_alias(const procnames:Tstringcontainer);
 begin
-  consume(COLON);
+  consume(_COLON);
   procnames.insert(get_stringconst);
 end;
 
 procedure pd_asmname(const procnames:Tstringcontainer);
 begin
   aktprocsym^.definition^.setmangledname(target_os.Cprefix+pattern);
-  if token=CCHAR then
-    consume(CCHAR)
+  if token=_CCHAR then
+    consume(_CCHAR)
   else
-    consume(CSTRING);
+    consume(_CSTRING);
   { we don't need anything else }
   aktprocsym^.definition^.forwarddef:=false;
 end;
 
 procedure pd_intern(const procnames:Tstringcontainer);
 begin
-  consume(COLON);
+  consume(_COLON);
   aktprocsym^.definition^.extnumber:=get_intconst;
 end;
 
@@ -861,7 +861,7 @@ begin
   follow (FK) }
   import_nr:=0;
   import_name:='';
-  if not(token=SEMICOLON) and not(idtoken=_NAME) then
+  if not(token=_SEMICOLON) and not(idtoken=_NAME) then
     begin
       import_dll:=get_stringconst;
       if (idtoken=_NAME) then
@@ -1332,7 +1332,7 @@ begin
            if not(m_repeat_forward in aktmodeswitches) or
               (equal_paras(aktprocsym^.definition^.para1,pd^.nextoverloaded^.para1,false) and
               { for operators equal_paras is not enough !! }
-              ((aktprocsym^.definition^.proctypeoption<>potype_operator) or (optoken<>ASSIGNMENT) or
+              ((aktprocsym^.definition^.proctypeoption<>potype_operator) or (optoken<>_ASSIGNMENT) or
                is_equal(pd^.nextoverloaded^.retdef,aktprocsym^.definition^.retdef))) then
              begin
                if pd^.nextoverloaded^.forwarddef then
@@ -1791,14 +1791,14 @@ procedure parse_proc_directives(Anames:Pstringcontainer;var pdflags:word);
 var
   res : boolean;
 begin
-  while token in [ID,LECKKLAMMER] do
+  while token in [_ID,_LECKKLAMMER] do
    begin
-     if try_to_consume(LECKKLAMMER) then
+     if try_to_consume(_LECKKLAMMER) then
       begin
         repeat
           parse_proc_direc(Anames^,pdflags);
-        until not try_to_consume(COMMA);
-        consume(RECKKLAMMER);
+        until not try_to_consume(_COMMA);
+        consume(_RECKKLAMMER);
         { we always expect at least '[];' }
         res:=true;
       end
@@ -1806,7 +1806,7 @@ begin
       res:=parse_proc_direc(Anames^,pdflags);
    { A procedure directive is always followed by a semicolon }
      if res then
-      consume(SEMICOLON)
+      consume(_SEMICOLON)
      else
       break;
    end;
@@ -2013,7 +2013,7 @@ begin
         tokeninfo[_FAIL].keyword:=m_none;
       if assigned(aktprocsym^.definition^._class) and (lexlevel=main_program_level) then
         tokeninfo[_SELF].keyword:=m_none;
-       consume(SEMICOLON);
+       consume(_SEMICOLON);
      end;
 { close }
    dispose(names,done);
@@ -2033,7 +2033,11 @@ end.
 
 {
   $Log$
-  Revision 1.10  1999-08-04 00:23:20  florian
+  Revision 1.11  1999-08-04 13:03:01  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.10  1999/08/04 00:23:20  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.9  1999/08/03 22:03:05  peter

+ 38 - 34
compiler/ptconst.pas

@@ -286,9 +286,9 @@ unit ptconst;
                         (*if token=POINT then
                           begin
                              offset:=0;
-                             while token=POINT do
+                             while token=_POINT do
                                begin
-                                  consume(POINT);
+                                  consume(_POINT);
                                   lsym:=pvarsym(precdef(
                                         ppointerdef(p^.resulttype)^.definition)^.symtable^.search(pattern));
                                   if assigned(sym) then
@@ -297,7 +297,7 @@ unit ptconst;
                                     begin
                                        Message1(sym_e_illegal_field,pattern);
                                     end;
-                                  consume(ID);
+                                  consume(_ID);
                                end;
                              curconstsegment^.concat(new(pai_const_symbol_offset,init(
                                strpnew(p^.left^.symtableentry^.mangledname),offset)));
@@ -483,16 +483,16 @@ unit ptconst;
            end;
          arraydef:
            begin
-              if token=LKLAMMER then
+              if token=_LKLAMMER then
                 begin
-                    consume(LKLAMMER);
+                    consume(_LKLAMMER);
                     for l:=parraydef(def)^.lowrange to parraydef(def)^.highrange-1 do
                       begin
                          readtypedconst(parraydef(def)^.definition,nil,no_change_allowed);
-                         consume(COMMA);
+                         consume(_COMMA);
                       end;
                     readtypedconst(parraydef(def)^.definition,nil,no_change_allowed);
-                    consume(RKLAMMER);
+                    consume(_RKLAMMER);
                  end
               else
               { if array of char then we allow also a string }
@@ -544,7 +544,7 @@ unit ptconst;
               else
                 begin
                   { we want the ( }
-                  consume(LKLAMMER);
+                  consume(_LKLAMMER);
                 end;
            end;
          procvardef:
@@ -559,15 +559,15 @@ unit ptconst;
                 end
               else
                 if not(m_tp_procvar in aktmodeswitches) then
-                  if token=KLAMMERAFFE then
-                    consume(KLAMMERAFFE);
+                  if token=_KLAMMERAFFE then
+                    consume(_KLAMMERAFFE);
               getsym(pattern,true);
-              consume(ID);
+              consume(_ID);
               if srsym^.typ=unitsym then
                 begin
-                   consume(POINT);
+                   consume(_POINT);
                    getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
-                   consume(ID);
+                   consume(_ID);
                 end;
               if srsym^.typ<>procsym then
                 Message(cg_e_illegal_expression)
@@ -584,18 +584,18 @@ unit ptconst;
          { reads a typed constant record }
          recorddef:
            begin
-              consume(LKLAMMER);
+              consume(_LKLAMMER);
               aktpos:=0;
-              while token<>RKLAMMER do
+              while token<>_RKLAMMER do
                 begin
                    s:=pattern;
-                   consume(ID);
-                   consume(COLON);
+                   consume(_ID);
+                   consume(_COLON);
                    srsym:=precorddef(def)^.symtable^.search(s);
                    if srsym=nil then
                      begin
                         Message1(sym_e_id_not_found,s);
-                        consume_all_until(SEMICOLON);
+                        consume_all_until(_SEMICOLON);
                      end
                    else
                      begin
@@ -614,14 +614,14 @@ unit ptconst;
                         { read the data }
                         readtypedconst(pvarsym(srsym)^.definition,nil,no_change_allowed);
 
-                        if token=SEMICOLON then
-                          consume(SEMICOLON)
+                        if token=_SEMICOLON then
+                          consume(_SEMICOLON)
                         else break;
                      end;
                 end;
               for i:=1 to def^.size-aktpos do
                 curconstsegment^.concat(new(pai_const,init_8bit(0)));
-              consume(RKLAMMER);
+              consume(_RKLAMMER);
            end;
          { reads a typed object }
          objectdef:
@@ -629,17 +629,17 @@ unit ptconst;
               if ([oo_has_vmt,oo_is_class]*pobjectdef(def)^.objectoptions)<>[] then
                 begin
                    Message(parser_e_type_const_not_possible);
-                   consume_all_until(RKLAMMER);
+                   consume_all_until(_RKLAMMER);
                 end
               else
                 begin
-                   consume(LKLAMMER);
+                   consume(_LKLAMMER);
                    aktpos:=0;
-                   while token<>RKLAMMER do
+                   while token<>_RKLAMMER do
                      begin
                         s:=pattern;
-                        consume(ID);
-                        consume(COLON);
+                        consume(_ID);
+                        consume(_COLON);
                         srsym:=nil;
                         obj:=pobjectdef(def);
                         symt:=obj^.symtable;
@@ -657,7 +657,7 @@ unit ptconst;
                         if srsym=nil then
                           begin
                              Message1(sym_e_id_not_found,s);
-                             consume_all_until(SEMICOLON);
+                             consume_all_until(_SEMICOLON);
                           end
                         else
                           begin
@@ -676,23 +676,23 @@ unit ptconst;
                              { read the data }
                              readtypedconst(pvarsym(srsym)^.definition,nil,no_change_allowed);
 
-                             if token=SEMICOLON then
-                               consume(SEMICOLON)
+                             if token=_SEMICOLON then
+                               consume(_SEMICOLON)
                              else break;
                           end;
                      end;
                    for i:=1 to def^.size-aktpos do
                      curconstsegment^.concat(new(pai_const,init_8bit(0)));
-                   consume(RKLAMMER);
+                   consume(_RKLAMMER);
                 end;
            end;
          errordef:
            begin
               { try to consume something useful }
-              if token=LKLAMMER then
-                consume_all_until(RKLAMMER)
+              if token=_LKLAMMER then
+                consume_all_until(_RKLAMMER)
               else
-                consume_all_until(SEMICOLON);
+                consume_all_until(_SEMICOLON);
            end;
          else Message(parser_e_type_const_not_possible);
          end;
@@ -701,7 +701,11 @@ unit ptconst;
 end.
 {
   $Log$
-  Revision 1.50  1999-08-04 00:23:21  florian
+  Revision 1.51  1999-08-04 13:03:02  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.50  1999/08/04 00:23:21  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.49  1999/08/03 22:03:08  peter

+ 28 - 24
compiler/scandir.inc

@@ -119,11 +119,11 @@ const
          mac : pmacrosym;
          len : byte;
       begin
-         if preproc_token=ID then
+         if preproc_token=_ID then
            begin
               if preprocpat='NOT' then
                 begin
-                   preproc_consume(ID);
+                   preproc_consume(_ID);
                    hs:=read_expr;
                    if hs='0' then
                      read_factor:='1'
@@ -134,7 +134,7 @@ const
                 begin
                    mac:=pmacrosym(macros^.search(hs));
                    hs:=preprocpat;
-                   preproc_consume(ID);
+                   preproc_consume(_ID);
                    if assigned(mac) then
                      begin
                         if mac^.defined and assigned(mac^.buftext) then
@@ -164,11 +164,11 @@ const
                      read_factor:=hs;
                 end
            end
-         else if preproc_token=LKLAMMER then
+         else if preproc_token=_LKLAMMER then
            begin
-              preproc_consume(LKLAMMER);
+              preproc_consume(_LKLAMMER);
               read_factor:=read_expr;
-              preproc_consume(RKLAMMER);
+              preproc_consume(_RKLAMMER);
            end
          else
            Message(scan_e_error_in_preproc_expr);
@@ -182,11 +182,11 @@ const
          hs1:=read_factor;
          while true do
            begin
-              if (preproc_token=ID) then
+              if (preproc_token=_ID) then
                 begin
                    if preprocpat='AND' then
                      begin
-                        preproc_consume(ID);
+                        preproc_consume(_ID);
                         hs2:=read_factor;
                         if (hs1<>'0') and (hs2<>'0') then
                           hs1:='1';
@@ -208,11 +208,11 @@ const
          hs1:=read_term;
          while true do
            begin
-              if (preproc_token=ID) then
+              if (preproc_token=_ID) then
                 begin
                    if preprocpat='OR' then
                      begin
-                        preproc_consume(ID);
+                        preproc_consume(_ID);
                         hs2:=read_term;
                         if (hs1<>'0') or (hs2<>'0') then
                           hs1:='1';
@@ -237,7 +237,7 @@ const
       begin
          hs1:=read_simple_expr;
          t:=preproc_token;
-         if not(t in [EQUAL,UNEQUAL,LT,GT,LTE,GTE]) then
+         if not(t in [_EQUAL,_UNEQUAL,_LT,_GT,_LTE,_GTE]) then
            begin
               read_expr:=hs1;
               exit;
@@ -249,23 +249,23 @@ const
               valint(hs1,l1,w);
               valint(hs2,l2,w);
               case t of
-                 EQUAL : b:=l1=l2;
-               UNEQUAL : b:=l1<>l2;
-                    LT : b:=l1<l2;
-                    GT : b:=l1>l2;
-                   GTE : b:=l1>=l2;
-                   LTE : b:=l1<=l2;
+                 _EQUAL : b:=l1=l2;
+               _UNEQUAL : b:=l1<>l2;
+                    _LT : b:=l1<l2;
+                    _GT : b:=l1>l2;
+                   _GTE : b:=l1>=l2;
+                   _LTE : b:=l1<=l2;
               end;
            end
          else
            begin
               case t of
-                 EQUAL : b:=hs1=hs2;
-               UNEQUAL : b:=hs1<>hs2;
-                    LT : b:=hs1<hs2;
-                    GT : b:=hs1>hs2;
-                   GTE : b:=hs1>=hs2;
-                   LTE : b:=hs1<=hs2;
+                 _EQUAL : b:=hs1=hs2;
+               _UNEQUAL : b:=hs1<>hs2;
+                    _LT : b:=hs1<hs2;
+                    _GT : b:=hs1>hs2;
+                   _GTE : b:=hs1>=hs2;
+                   _LTE : b:=hs1<=hs2;
               end;
            end;
          if b then
@@ -1090,7 +1090,11 @@ const
 
 {
   $Log$
-  Revision 1.57  1999-07-26 14:55:36  florian
+  Revision 1.58  1999-08-04 13:03:03  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.57  1999/07/26 14:55:36  florian
     * $mode gives now a warning if an unknown mode keyword follows
 
   Revision 1.56  1999/07/23 16:05:27  peter

+ 61 - 57
compiler/scanner.pas

@@ -1126,8 +1126,8 @@ implementation
         if c in ['A'..'Z','a'..'z','_'] then
          begin
            readstring;
-           token:=ID;
-           idtoken:=ID;
+           token:=_ID;
+           idtoken:=_ID;
          { keyword or any other known token,
            pattern is always uppercased }
            if (pattern[1]<>'_') and (length(pattern) in [2..tokenidlen]) then
@@ -1150,7 +1150,7 @@ implementation
                end;
             end;
          { Only process identifiers and not keywords }
-           if token=ID then
+           if token=_ID then
             begin
             { this takes some time ... }
               if (cs_support_macro in aktmoduleswitches) then
@@ -1178,20 +1178,20 @@ implementation
          end
         else
          begin
-           idtoken:=NOID;
+           idtoken:=_NOID;
            case c of
 
              '$' :
                begin
                  readnumber;
-                 token:=INTCONST;
+                 token:=_INTCONST;
                  goto exit_label;
                end;
 
              '%' :
                begin
                  readnumber;
-                 token:=INTCONST;
+                 token:=_INTCONST;
                  goto exit_label;
                end;
 
@@ -1209,15 +1209,15 @@ implementation
                          '.' :
                            begin
                              readchar;
-                             token:=INTCONST;
-                             nexttoken:=POINTPOINT;
+                             token:=_INTCONST;
+                             nexttoken:=_POINTPOINT;
                              goto exit_label;
                            end;
                          ')' :
                            begin
                              readchar;
-                             token:=INTCONST;
-                             nexttoken:=RECKKLAMMER;
+                             token:=_INTCONST;
+                             nexttoken:=_RECKKLAMMER;
                              goto exit_label;
                            end;
                        end;
@@ -1247,31 +1247,31 @@ implementation
                           readchar;
                         end;
                      end;
-                    token:=REALNUMBER;
+                    token:=_REALNUMBER;
                     goto exit_label;
                   end;
-                 token:=INTCONST;
+                 token:=_INTCONST;
                  goto exit_label;
                end;
 
              ';' :
                begin
                  readchar;
-                 token:=SEMICOLON;
+                 token:=_SEMICOLON;
                  goto exit_label;
                end;
 
              '[' :
                begin
                  readchar;
-                 token:=LECKKLAMMER;
+                 token:=_LECKKLAMMER;
                  goto exit_label;
                end;
 
              ']' :
                begin
                  readchar;
-                 token:=RECKKLAMMER;
+                 token:=_RECKKLAMMER;
                  goto exit_label;
                end;
 
@@ -1288,18 +1288,18 @@ implementation
                    '.' :
                      begin
                        readchar;
-                       token:=LECKKLAMMER;
+                       token:=_LECKKLAMMER;
                        goto exit_label;
                      end;
                  end;
-                 token:=LKLAMMER;
+                 token:=_LKLAMMER;
                  goto exit_label;
                end;
 
              ')' :
                begin
                  readchar;
-                 token:=RKLAMMER;
+                 token:=_RKLAMMER;
                  goto exit_label;
                end;
 
@@ -1312,7 +1312,7 @@ implementation
                     token:=_PLUSASN;
                     goto exit_label;
                   end;
-                 token:=PLUS;
+                 token:=_PLUS;
                  goto exit_label;
                end;
 
@@ -1325,7 +1325,7 @@ implementation
                     token:=_MINUSASN;
                     goto exit_label;
                   end;
-                 token:=MINUS;
+                 token:=_MINUS;
                  goto exit_label;
                end;
 
@@ -1335,10 +1335,10 @@ implementation
                  if c='=' then
                   begin
                     readchar;
-                    token:=ASSIGNMENT;
+                    token:=_ASSIGNMENT;
                     goto exit_label;
                   end;
-                 token:=COLON;
+                 token:=_COLON;
                  goto exit_label;
                end;
 
@@ -1354,10 +1354,10 @@ implementation
                   if c='*' then
                    begin
                      readchar;
-                     token:=STARSTAR;
+                     token:=_STARSTAR;
                    end
                  else
-                  token:=STAR;
+                  token:=_STAR;
                  goto exit_label;
                end;
 
@@ -1387,14 +1387,14 @@ implementation
                       exit;
                     end;
                  end;
-                 token:=SLASH;
+                 token:=_SLASH;
                  goto exit_label;
                end;
 
              '=' :
                begin
                  readchar;
-                 token:=EQUAL;
+                 token:=_EQUAL;
                  goto exit_label;
                end;
 
@@ -1405,17 +1405,17 @@ implementation
                    '.' :
                      begin
                        readchar;
-                       token:=POINTPOINT;
+                       token:=_POINTPOINT;
                        goto exit_label;
                      end;
                    ')' :
                      begin
                        readchar;
-                       token:=RECKKLAMMER;
+                       token:=_RECKKLAMMER;
                        goto exit_label;
                      end;
                  end;
-                 token:=POINT;
+                 token:=_POINT;
                  goto exit_label;
                end;
 
@@ -1425,17 +1425,17 @@ implementation
                  if c='@' then
                   begin
                     readchar;
-                    token:=DOUBLEADDR;
+                    token:=_DOUBLEADDR;
                   end
                  else
-                  token:=KLAMMERAFFE;
+                  token:=_KLAMMERAFFE;
                  goto exit_label;
                end;
 
              ',' :
                begin
                  readchar;
-                 token:=COMMA;
+                 token:=_COMMA;
                  goto exit_label;
                end;
 
@@ -1446,10 +1446,10 @@ implementation
                     readchar;
                     c:=upcase(c);
                     if (block_type=bt_type) or
-                       (lasttoken=ID) or
-                       (lasttoken=RKLAMMER) or (lasttoken=RECKKLAMMER) or (lasttoken=CARET) then
+                       (lasttoken=_ID) or
+                       (lasttoken=_RKLAMMER) or (lasttoken=_RECKKLAMMER) or (lasttoken=_CARET) then
                      begin
-                       token:=CARET;
+                       token:=_CARET;
                        goto exit_label;
                      end
                     else
@@ -1528,9 +1528,9 @@ implementation
                  until false;
                { strings with length 1 become const chars }
                  if length(pattern)=1 then
-                  token:=CCHAR
+                  token:=_CCHAR
                  else
-                  token:=CSTRING;
+                  token:=_CSTRING;
                  goto exit_label;
                end;
 
@@ -1541,7 +1541,7 @@ implementation
                    '=' :
                      begin
                        readchar;
-                       token:=GTE;
+                       token:=_GTE;
                        goto exit_label;
                      end;
                    '>' :
@@ -1553,11 +1553,11 @@ implementation
                    '<' :
                      begin { >< is for a symetric diff for sets }
                        readchar;
-                       token:=SYMDIF;
+                       token:=_SYMDIF;
                        goto exit_label;
                      end;
                  end;
-                 token:=GT;
+                 token:=_GT;
                  goto exit_label;
                end;
 
@@ -1568,13 +1568,13 @@ implementation
                    '>' :
                      begin
                        readchar;
-                       token:=UNEQUAL;
+                       token:=_UNEQUAL;
                        goto exit_label;
                      end;
                    '=' :
                      begin
                        readchar;
-                       token:=LTE;
+                       token:=_LTE;
                        goto exit_label;
                      end;
                    '<' :
@@ -1584,7 +1584,7 @@ implementation
                        goto exit_label;
                      end;
                  end;
-                 token:=LT;
+                 token:=_LT;
                  goto exit_label;
                end;
 
@@ -1613,58 +1613,58 @@ exit_label:
         'a'..'z',
     '_','0'..'9' : begin
                      preprocpat:=readid;
-                     readpreproc:=ID;
+                     readpreproc:=_ID;
                    end;
              '(' : begin
                      readchar;
-                     readpreproc:=LKLAMMER;
+                     readpreproc:=_LKLAMMER;
                    end;
              ')' : begin
                      readchar;
-                     readpreproc:=RKLAMMER;
+                     readpreproc:=_RKLAMMER;
                    end;
              '+' : begin
                      readchar;
-                     readpreproc:=PLUS;
+                     readpreproc:=_PLUS;
                    end;
              '-' : begin
                      readchar;
-                     readpreproc:=MINUS;
+                     readpreproc:=_MINUS;
                    end;
              '*' : begin
                      readchar;
-                     readpreproc:=STAR;
+                     readpreproc:=_STAR;
                    end;
              '/' : begin
                      readchar;
-                     readpreproc:=SLASH;
+                     readpreproc:=_SLASH;
                    end;
              '=' : begin
                      readchar;
-                     readpreproc:=EQUAL;
+                     readpreproc:=_EQUAL;
                    end;
              '>' : begin
                      readchar;
                      if c='=' then
                       begin
                         readchar;
-                        readpreproc:=GTE;
+                        readpreproc:=_GTE;
                       end
                      else
-                      readpreproc:=GT;
+                      readpreproc:=_GT;
                    end;
              '<' : begin
                      readchar;
                      case c of
                       '>' : begin
                               readchar;
-                              readpreproc:=UNEQUAL;
+                              readpreproc:=_UNEQUAL;
                             end;
                       '=' : begin
                               readchar;
-                              readpreproc:=LTE;
+                              readpreproc:=_LTE;
                             end;
-                     else   readpreproc:=LT;
+                     else   readpreproc:=_LT;
                      end;
                    end;
              #26 :
@@ -1733,7 +1733,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.89  1999-07-29 11:43:22  peter
+  Revision 1.90  1999-08-04 13:03:05  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.89  1999/07/29 11:43:22  peter
     * always output preprocstack when unexpected eof is found
     * fixed tp7/delphi skipuntildirective parsing
 

+ 5 - 13
compiler/symdef.inc

@@ -2399,10 +2399,6 @@
 {$ifdef m68k}
          usedregisters:=$FFFF;
 {$endif}
-{$ifdef alpha}
-         usedregisters_int:=$ffffffff;
-         usedregisters_fpu:=$ffffffff;
-{$endif alpha}
 {$endif newcg}
          forwarddef:=true;
          interfacedef:=false;
@@ -2429,10 +2425,6 @@
 {$ifdef m68k}
          usedregisters:=readword;
 {$endif}
-{$ifdef alpha}
-         usedregisters_int:=readlong;
-         usedregisters_fpu:=readlong;
-{$endif alpha}
 {$endif newcg}
          s:=readstring;
          setstring(_mangledname,s);
@@ -2633,10 +2625,6 @@ Const local_symtable_index : longint = $8001;
 {$ifdef m68k}
          writeword(usedregisters);
 {$endif}
-{$ifdef alpha}
-         writelong(usedregisters_int);
-         writelong(usedregisters_fpu);
-{$endif alpha}
 {$endif newcg}
          writestring(mangledname);
          current_ppu^.do_interface_crc:=true;
@@ -3569,7 +3557,11 @@ Const local_symtable_index : longint = $8001;
 
 {
   $Log$
-  Revision 1.139  1999-08-03 22:03:14  peter
+  Revision 1.140  1999-08-04 13:03:07  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.139  1999/08/03 22:03:14  peter
     * moved bitmask constants to sets
     * some other type/const renamings
 

+ 7 - 3
compiler/symtable.pas

@@ -354,8 +354,8 @@ unit symtable;
 
     const
        { last operator which can be overloaded }
-       first_overloaded = PLUS;
-       last_overloaded  = ASSIGNMENT;
+       first_overloaded = _PLUS;
+       last_overloaded  = _ASSIGNMENT;
     var
        overloaded_operators : array[first_overloaded..last_overloaded] of pprocsym;
        { unequal is not equal}
@@ -2335,7 +2335,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.36  1999-08-04 00:23:31  florian
+  Revision 1.37  1999-08-04 13:03:09  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.36  1999/08/04 00:23:31  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.35  1999/08/03 22:03:22  peter

+ 128 - 16
compiler/systems.pas

@@ -29,7 +29,7 @@ unit systems;
        tendian = (endian_little,endian_big);
 
        ttargetcpu=(no_cpu
-            ,i386,m68k,alpha
+            ,i386,m68k,alpha,powerpc
        );
 
        tprocessors = (no_processor
@@ -46,20 +46,22 @@ unit systems;
      type
        tasmmode= (asmmode_none
             ,asmmode_i386_direct,asmmode_i386_att,asmmode_i386_intel
-            ,asmmode_m68k_mot,asmmode_alpha_direct
+            ,asmmode_m68k_mot,asmmode_alpha_direct,asmmode_powerpc_direct
        );
      const
        {$ifdef i386}  i386asmmodecnt=3;  {$else} i386asmmodecnt=0; {$endif}
        {$ifdef m68k}  m68kasmmodecnt=1;  {$else} m68kasmmodecnt=0; {$endif}
        {$ifdef alpha} alphaasmmodecnt=1; {$else} alphaasmmodecnt=0; {$endif}
-       asmmodecnt=i386asmmodecnt+m68kasmmodecnt+Alphaasmmodecnt+1;
+       {$ifdef powerpc} powerpcasmmodecnt=1; {$else} powerpcasmmodecnt=0; {$endif}
+       asmmodecnt=i386asmmodecnt+m68kasmmodecnt+Alphaasmmodecnt+powerpcasmmodecnt+1;
 
      type
        ttarget = (target_none
             ,target_i386_GO32V1,target_i386_GO32V2,target_i386_linux,
             target_i386_OS2,target_i386_Win32
             ,target_m68k_Amiga,target_m68k_Atari,target_m68k_Mac,
-            target_m68k_linux,target_m68k_PalmOS,target_alpha_linux
+            target_m68k_linux,target_m68k_PalmOS,target_alpha_linux,
+            target_powerpc_linux
        );
 
        ttargetflags = (tf_none,
@@ -70,7 +72,8 @@ unit systems;
        {$ifdef i386} i386targetcnt=5; {$else} i386targetcnt=0; {$endif}
        {$ifdef m68k} m68ktargetcnt=5; {$else} m68ktargetcnt=0; {$endif}
        {$ifdef alpha} alphatargetcnt=1; {$else} alphatargetcnt=0; {$endif}
-       targetcnt=i386targetcnt+m68ktargetcnt+alphatargetcnt+1;
+       {$ifdef powerpc} powerpctargetcnt=1; {$else} powerpctargetcnt=0; {$endif}
+       targetcnt=i386targetcnt+m68ktargetcnt+alphatargetcnt+powerpctargetcnt+1;
 
      type
        tasm = (as_none
@@ -79,14 +82,15 @@ unit systems;
             as_i386_tasm,as_i386_masm,
             as_i386_dbg,as_i386_coff,as_i386_pecoff
             ,as_m68k_as,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw,
-            as_alpha_as
+            as_alpha_as,as_powerpc_as
        );
        { binary assembler writers, needed to test for -a }
      const
        {$ifdef i386} i386asmcnt=11; {$else} i386asmcnt=0; {$endif}
        {$ifdef m68k} m68kasmcnt=5; {$else} m68kasmcnt=0; {$endif}
        {$ifdef alpha} alphaasmcnt=1; {$else} alphaasmcnt=0; {$endif}
-       asmcnt=i386asmcnt+m68kasmcnt+alphaasmcnt+1;
+       {$ifdef powerpc} powerpcasmcnt=1; {$else} powerpcasmcnt=0; {$endif}
+       asmcnt=i386asmcnt+m68kasmcnt+alphaasmcnt+powerpcasmcnt+1;
 
        binassem : set of tasm = [
          as_i386_dbg,as_i386_coff,as_i386_pecoff
@@ -97,24 +101,26 @@ unit systems;
             ,link_i386_ld,link_i386_ldgo32v1,
             link_i386_ldgo32v2,link_i386_ldw,
             link_i386_ldos2
-            ,link_m68k_ld,link_alpha_ld
+            ,link_m68k_ld,link_alpha_ld,link_powerpc_ld
        );
      const
        {$ifdef i386} i386linkcnt=5; {$else} i386linkcnt=0; {$endif}
        {$ifdef m68k} m68klinkcnt=1; {$else} m68klinkcnt=0; {$endif}
        {$ifdef alpha} alphalinkcnt=1; {$else} alphalinkcnt=0; {$endif}
-       linkcnt=i386linkcnt+m68klinkcnt+alphalinkcnt+1;
+       {$ifdef powerpc} powerpclinkcnt=1; {$else} powerpclinkcnt=0; {$endif}
+       linkcnt=i386linkcnt+m68klinkcnt+alphalinkcnt+powerpclinkcnt+1;
 
      type
        tar = (ar_none
             ,ar_i386_ar,ar_i386_arw
-            ,ar_m68k_ar,ar_alpha_ar
+            ,ar_m68k_ar,ar_alpha_ar,ar_powerpc_ar
        );
      const
        {$ifdef i386} i386arcnt=2; {$else} i386arcnt=0; {$endif}
        {$ifdef m68k} m68karcnt=1; {$else} m68karcnt=0; {$endif}
        {$ifdef alpha} alphaarcnt=1; {$else} alphaarcnt=0; {$endif}
-       arcnt=i386arcnt+m68karcnt+alphaarcnt+1;
+       {$ifdef powerpc} powerpcarcnt=1; {$else} powerpcarcnt=0; {$endif}
+       arcnt=i386arcnt+m68karcnt+alphaarcnt+powerpcarcnt+1;
 
      type
        tres = (res_none
@@ -124,20 +130,22 @@ unit systems;
        {$ifdef i386} i386rescnt=1; {$else} i386rescnt=0; {$endif}
        {$ifdef m68k} m68krescnt=0; {$else} m68krescnt=0; {$endif}
        {$ifdef alpha} alpharescnt=0; {$else} alpharescnt=0; {$endif}
-       rescnt=i386rescnt+m68krescnt+alpharescnt+1;
+       {$ifdef powerpc} powerpcrescnt=0; {$else} powerpcrescnt=0; {$endif}
+       rescnt=i386rescnt+m68krescnt+alpharescnt+powerpcrescnt+1;
 
      type
        tos = ( os_none,
             os_i386_GO32V1,os_i386_GO32V2,os_i386_Linux,os_i386_OS2,
             os_i386_Win32,
             os_m68k_Amiga,os_m68k_Atari,os_m68k_Mac,os_m68k_Linux,
-            os_m68k_PalmOS,os_alpha_linux
+            os_m68k_PalmOS,os_alpha_linux,os_powerpc_linux
        );
      const
        i386oscnt=5;
        m68koscnt=5;
        alphaoscnt=1;
-       oscnt=i386oscnt+m68koscnt+alphaoscnt+1;
+       powerpcoscnt=1;
+       oscnt=i386oscnt+m68koscnt+alphaoscnt+powerpcoscnt+1;
 
    type
        tosinfo = packed record
@@ -504,6 +512,27 @@ implementation
             size_of_longint : 4;
             use_bound_instruction : false;
             use_function_relative_addresses : true
+          ),
+          (
+            id     : os_powerpc_linux;
+            name         : 'Linux for PowerPC';
+            shortname    : 'linuxppc';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            libprefix    : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            endian       : endian_big;
+            stackalignment : 8;
+            size_of_pointer : 4;
+            size_of_longint : 4;
+            use_bound_instruction : false;
+            use_function_relative_addresses : true
           )
           );
 
@@ -778,6 +807,23 @@ implementation
               '','','','','','',
               '.stab','.stabstr')
           )
+{$endif}
+{$ifdef powerpc}
+          ,(
+            id     : as_powerpc_as;
+            idtxt  : 'AS';
+            asmbin : 'as';
+            asmcmd : '-o $OBJ $ASM';
+            allowdirect : true;
+            externals : false;
+            needar : true;
+            labelprefix : '.L';
+            comment : '# ';
+            secnames : ('',
+              '.text','.data','.bss',
+              '','','','','','',
+              '.stab','.stabstr')
+          )
 {$endif}
           );
 
@@ -916,6 +962,25 @@ implementation
             inputend   : ')';
             libprefix  : '-l'
           )
+{$endif}
+{$ifdef powerpc}
+          ,(
+            id      : link_powerpc_ld;
+            linkbin : 'ld';
+            linkcmd : '$OPT -o $EXE $RES';
+            binders : 0;
+            bindbin : ('','');
+            bindcmd : ('','');
+            stripopt   : '-s';
+            stripbind  : false;
+            libpathprefix : 'SEARCH_DIR(';
+            libpathsuffix : ')';
+            groupstart : 'GROUP(';
+            groupend   : ')';
+            inputstart : 'INPUT(';
+            inputend   : ')';
+            libprefix  : '-l'
+          )
 {$endif}
           );
 
@@ -951,6 +1016,13 @@ implementation
             arbin : 'ar';
             arcmd : 'rs $LIB $FILES'
           )
+{$endif}
+{$ifdef powerpc}
+          ,(
+            id    : ar_powerpc_ar;
+            arbin : 'ar';
+            arcmd : 'rs $LIB $FILES'
+          )
 {$endif}
           );
 
@@ -1262,6 +1334,33 @@ implementation
             maxheapsize : 32768*1024;
             stacksize   : 8192
           )
+{$endif}
+{$ifdef powerpc}
+          ,(
+            target      : target_powerpc_LINUX;
+            flags       : [];
+            cpu         : alpha;
+            short_name  : 'LINUX';
+            unit_env    : 'LINUXUNITS';
+            system_unit : 'syslinux';
+            smartext    : '.sl';
+            unitext     : '.ppu';
+            unitlibext  : '.ppl';
+            asmext      : '.s';
+            objext      : '.o';
+            resext      : '.res';
+            resobjext   : '.or';
+            exeext      : '';
+            os          : os_powerpc_Linux;
+            link        : link_powerpc_ld;
+            assem       : as_powerpc_as;
+            assemsrc    : as_powerpc_as;
+            ar          : ar_powerpc_ar;
+            res         : res_none;
+            heapsize    : 256*1024;
+            maxheapsize : 32768*1024;
+            stacksize   : 8192
+          )
 {$endif}
           );
 
@@ -1298,6 +1397,12 @@ implementation
             id    : asmmode_alpha_direct;
             idtxt : 'DIRECT'
           )
+{$endif}
+{$ifdef powerpc}
+          ,(
+            id    : asmmode_powerpc_direct;
+            idtxt : 'DIRECT'
+          )
 {$endif}
           );
 
@@ -1617,7 +1722,10 @@ begin
 {$endif m68k}
 {$ifdef alpha}
   default_os(target_alpha_linux);
-{$endif i386}
+{$endif alpha}
+{$ifdef powerpc}
+  default_os(target_alpha_linux);
+{$endif powerpc}
 end;
 
 
@@ -1626,7 +1734,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.89  1999-08-04 00:23:32  florian
+  Revision 1.90  1999-08-04 13:03:11  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.89  1999/08/04 00:23:32  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.88  1999/08/03 22:03:23  peter

+ 15 - 11
compiler/tcadd.pas

@@ -130,25 +130,25 @@ implementation
                  { the nil as symtable signs firstcalln that this is
                    an overloaded operator }
                  addn:
-                   t:=gencallnode(overloaded_operators[plus],nil);
+                   t:=gencallnode(overloaded_operators[_plus],nil);
                  subn:
-                   t:=gencallnode(overloaded_operators[minus],nil);
+                   t:=gencallnode(overloaded_operators[_minus],nil);
                  muln:
-                   t:=gencallnode(overloaded_operators[star],nil);
+                   t:=gencallnode(overloaded_operators[_star],nil);
                  starstarn:
-                   t:=gencallnode(overloaded_operators[starstar],nil);
+                   t:=gencallnode(overloaded_operators[_starstar],nil);
                  slashn:
-                   t:=gencallnode(overloaded_operators[slash],nil);
+                   t:=gencallnode(overloaded_operators[_slash],nil);
                  ltn:
-                   t:=gencallnode(overloaded_operators[tokens.lt],nil);
+                   t:=gencallnode(overloaded_operators[tokens._lt],nil);
                  gtn:
-                   t:=gencallnode(overloaded_operators[gt],nil);
+                   t:=gencallnode(overloaded_operators[_gt],nil);
                  lten:
-                   t:=gencallnode(overloaded_operators[lte],nil);
+                   t:=gencallnode(overloaded_operators[_lte],nil);
                  gten:
-                   t:=gencallnode(overloaded_operators[gte],nil);
+                   t:=gencallnode(overloaded_operators[_gte],nil);
                  equaln,unequaln :
-                   t:=gencallnode(overloaded_operators[equal],nil);
+                   t:=gencallnode(overloaded_operators[_equal],nil);
                  else goto no_overload;
               end;
               { we have to convert p^.left and p^.right into
@@ -1111,7 +1111,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.39  1999-08-04 00:23:33  florian
+  Revision 1.40  1999-08-04 13:03:13  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.39  1999/08/04 00:23:33  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.38  1999/08/03 22:03:24  peter

+ 6 - 2
compiler/tccnv.pas

@@ -631,7 +631,7 @@ implementation
        if assigned(aprocdef) then
          begin
             procinfo.flags:=procinfo.flags or pi_do_call;
-            hp:=gencallnode(overloaded_operators[assignment],nil);
+            hp:=gencallnode(overloaded_operators[_assignment],nil);
             { tell explicitly which def we must use !! (PM) }
             hp^.procdefinition:=aprocdef;
             hp^.left:=gencallparanode(p^.left,nil);
@@ -919,7 +919,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.43  1999-08-04 00:23:36  florian
+  Revision 1.44  1999-08-04 13:03:14  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.43  1999/08/04 00:23:36  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.42  1999/08/03 22:03:28  peter

+ 8 - 4
compiler/tcmat.pas

@@ -295,8 +295,8 @@ implementation
            end
          else
            begin
-              if assigned(overloaded_operators[minus]) then
-                minusdef:=overloaded_operators[minus]^.definition
+              if assigned(overloaded_operators[_minus]) then
+                minusdef:=overloaded_operators[_minus]^.definition
               else
                 minusdef:=nil;
               while assigned(minusdef) do
@@ -304,7 +304,7 @@ implementation
                    if (minusdef^.para1^.data=p^.left^.resulttype) and
                      (minusdef^.para1^.next=nil) then
                      begin
-                        t:=gencallnode(overloaded_operators[minus],nil);
+                        t:=gencallnode(overloaded_operators[_minus],nil);
                         t^.left:=gencallparanode(p^.left,nil);
                         putnode(p);
                         p:=t;
@@ -406,7 +406,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.18  1999-08-04 00:23:43  florian
+  Revision 1.19  1999-08-04 13:03:15  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.18  1999/08/04 00:23:43  florian
     * renamed i386asm and i386base to cpuasm and cpubase
 
   Revision 1.17  1999/08/03 22:03:34  peter

+ 39 - 35
compiler/tokens.pas

@@ -31,42 +31,42 @@ const
 type
   ttoken=(NOTOKEN,
     { operators, which can also be overloaded }
-    PLUS,
-    MINUS,
-    STAR,
-    SLASH,
-    EQUAL,
-    GT,
-    LT,
-    GTE,
-    LTE,
-    SYMDIF,
-    STARSTAR,
-    OP_IS,
-    OP_AS,
-    OP_IN,
-    ASSIGNMENT,
+    _PLUS,
+    _MINUS,
+    _STAR,
+    _SLASH,
+    _EQUAL,
+    _GT,
+    _LT,
+    _GTE,
+    _LTE,
+    _SYMDIF,
+    _STARSTAR,
+    _OP_IS,
+    _OP_AS,
+    _OP_IN,
+    _ASSIGNMENT,
     { special chars }
-    CARET,
-    UNEQUAL,
-    LECKKLAMMER,
-    RECKKLAMMER,
-    POINT,
-    COMMA,
-    LKLAMMER,
-    RKLAMMER,
-    COLON,
-    SEMICOLON,
-    KLAMMERAFFE,
-    POINTPOINT,
-    DOUBLEADDR,
+    _CARET,
+    _UNEQUAL,
+    _LECKKLAMMER,
+    _RECKKLAMMER,
+    _POINT,
+    _COMMA,
+    _LKLAMMER,
+    _RKLAMMER,
+    _COLON,
+    _SEMICOLON,
+    _KLAMMERAFFE,
+    _POINTPOINT,
+    _DOUBLEADDR,
     _EOF,
-    ID,
-    NOID,
-    REALNUMBER,
-    INTCONST,
-    CSTRING,
-    CCHAR,
+    _ID,
+    _NOID,
+    _REALNUMBER,
+    _INTCONST,
+    _CSTRING,
+    _CCHAR,
     { C like operators }
     _PLUSASN,
     _MINUSASN,
@@ -387,7 +387,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.10  1999-08-03 22:03:39  peter
+  Revision 1.11  1999-08-04 13:03:17  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.10  1999/08/03 22:03:39  peter
     * moved bitmask constants to sets
     * some other type/const renamings
 

+ 8 - 1
compiler/version.pas

@@ -57,6 +57,9 @@ interface
 {$ifdef alpha}
        target_cpu_string = 'alpha';
 {$endif}
+{$ifdef powerpc}
+       target_cpu_string = 'powerpc';
+{$endif}
 
        { source cpu string }
 {$ifdef cpu86}
@@ -73,7 +76,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.11  1999-08-02 17:17:12  florian
+  Revision 1.12  1999-08-04 13:03:18  jonas
+    * all tokens now start with an underscore
+    * PowerPC compiles!!
+
+  Revision 1.11  1999/08/02 17:17:12  florian
     * small changes for the new code generator
 
   Revision 1.10  1999/08/01 23:36:42  florian