+ added language constructs UNIV, C, ... for mode mac

* consolidated macro expression to conform to Pascal
  * macro true is defined as <> 0
This commit is contained in:
olle 2004-05-03 10:06:38 +00:00
parent 90bf09aa35
commit 758c940518
3 changed files with 73 additions and 19 deletions

View File

@ -59,7 +59,7 @@ interface
function parse_proc_head(aclass:tobjectdef;potype:tproctypeoption;var pd:tprocdef):boolean;
function parse_proc_dec(aclass:tobjectdef):tprocdef;
procedure change_forward_to_external(pd:tabstractprocdef);
implementation
@ -390,6 +390,13 @@ implementation
consume(_OUT);
varspez:=vs_out
end
else
if (token=_POINTPOINTPOINT) and (m_mac in aktmodeswitches) then
begin
consume(_POINTPOINTPOINT);
include(pd.procoptions,po_varargs);
break;
end
else
varspez:=vs_value;
defaultvalue:=nil;
@ -453,6 +460,8 @@ implementation
else
begin
{ everything else }
if (m_mac in aktmodeswitches) then
try_to_consume(_UNIV); {currently does nothing}
single_type(tt,hs1,false);
end;
@ -465,11 +474,11 @@ implementation
consume(_CSTRING);
end
else
begin
begin
if explicit_paraloc then
Message(parser_e_paraloc_all_paras);
locationstr:='';
end;
locationstr:='';
end;
end
else
locationstr:='';
@ -1266,7 +1275,7 @@ type
end;
const
{Should contain the number of procedure directives we support.}
num_proc_directives=35;
num_proc_directives=36;
proc_direcdata:array[1..num_proc_directives] of proc_dir_rec=
(
(
@ -1305,6 +1314,15 @@ const
mutexclpocall : [];
mutexclpotype : [];
mutexclpo : [po_external]
),(
idtok:_C; {same as cdecl for mode mac}
pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar];
handler : nil;
pocall : pocall_cdecl;
pooption : [];
mutexclpocall : [];
mutexclpotype : [potype_constructor,potype_destructor];
mutexclpo : [po_assembler,po_external]
),(
idtok:_CDECL;
pd_flags : [pd_interface,pd_implemen,pd_body,pd_procvar];
@ -2217,7 +2235,12 @@ const
end.
{
$Log$
Revision 1.171 2004-05-01 22:38:13 florian
Revision 1.172 2004-05-03 10:06:38 olle
+ added language constructs UNIV, C, ... for mode mac
* consolidated macro expression to conform to Pascal
* macro true is defined as <> 0
Revision 1.171 2004/05/01 22:38:13 florian
* fixed MorphOS syscall without parameters
Revision 1.170 2004/05/01 22:05:01 florian

View File

@ -374,6 +374,9 @@ implementation
mac: tmacro;
srsym : tsym;
srsymtable : tsymtable;
l : longint;
w : integer;
begin
if current_scanner.preproc_token=_ID then
begin
@ -461,11 +464,12 @@ implementation
if preproc_substitutedtoken='NOT' then
begin
preproc_consume(_ID);
hs:=read_expr;
if hs='0' then
read_factor:='1'
hs:=read_factor();
valint(hs,l,w);
if l<>0 then
read_factor:='0'
else
read_factor:='0';
read_factor:='1';
end
else
if (m_mac in aktmodeswitches) and (preproc_substitutedtoken='TRUE') then
@ -509,10 +513,10 @@ implementation
if preproc_substitutedtoken<>'AND' then
break;
preproc_consume(_ID);
hs2:=read_expr;
hs2:=read_factor;
valint(hs1,l1,w);
valint(hs2,l2,w);
if (l1>0) and (l2>0) then
if (l1<>0) and (l2<>0) then
hs1:='1'
else
hs1:='0';
@ -534,10 +538,10 @@ implementation
if preproc_substitutedtoken<>'OR' then
break;
preproc_consume(_ID);
hs2:=read_expr;
hs2:=read_term;
valint(hs1,l1,w);
valint(hs2,l2,w);
if (l1>0) or (l2>0) then
if (l1<>0) or (l2<>0) then
hs1:='1'
else
hs1:='0';
@ -2521,8 +2525,19 @@ implementation
'.' :
begin
readchar;
token:=_POINTPOINT;
goto exit_label;
case c of
'.' :
begin
readchar;
token:=_POINTPOINTPOINT;
goto exit_label;
end;
else
begin
token:=_POINTPOINT;
goto exit_label;
end;
end;
end;
')' :
begin
@ -3028,7 +3043,12 @@ exit_label:
end.
{
$Log$
Revision 1.75 2004-03-04 17:23:10 peter
Revision 1.76 2004-05-03 10:06:38 olle
+ added language constructs UNIV, C, ... for mode mac
* consolidated macro expression to conform to Pascal
* macro true is defined as <> 0
Revision 1.75 2004/03/04 17:23:10 peter
* $elseif support
* conditiotnal in // returns warning isntead of error

View File

@ -67,6 +67,7 @@ type
_SEMICOLON,
_KLAMMERAFFE,
_POINTPOINT,
_POINTPOINTPOINT,
_EOF,
_ID,
_NOID,
@ -88,6 +89,7 @@ type
_NOTASN,
_XORASN,
{ Normal words }
_C,
_AS,
_AT,
_DO,
@ -129,6 +131,7 @@ type
_TRUE,
_TYPE,
_UNIT,
_UNIV,
_USES,
_WITH,
_ALIAS,
@ -225,7 +228,7 @@ type
);
const
tokenlenmin = 2;
tokenlenmin = 1;
tokenlenmax = 14;
{ last operator which can be overloaded, the first_overloaded should
@ -291,6 +294,7 @@ const
(str:';' ;special:true ;keyword:m_none;op:NOTOKEN),
(str:'@' ;special:true ;keyword:m_none;op:NOTOKEN),
(str:'..' ;special:true ;keyword:m_none;op:NOTOKEN),
(str:'...' ;special:true ;keyword:m_none;op:NOTOKEN),
(str:'end of file' ;special:true ;keyword:m_none;op:NOTOKEN),
(str:'identifier' ;special:true ;keyword:m_none;op:NOTOKEN),
(str:'non identifier';special:true ;keyword:m_none;op:NOTOKEN),
@ -312,6 +316,7 @@ const
(str:'' ;special:true ;keyword:m_none;op:NOTOKEN),
(str:'' ;special:true ;keyword:m_none;op:NOTOKEN),
{ Normal words }
(str:'C' ;special:false;keyword:m_none;op:NOTOKEN),
(str:'AS' ;special:false;keyword:m_class;op:_OP_AS),
(str:'AT' ;special:false;keyword:m_none;op:NOTOKEN),
(str:'DO' ;special:false;keyword:m_all;op:NOTOKEN),
@ -353,6 +358,7 @@ const
(str:'TRUE' ;special:false;keyword:m_all;op:NOTOKEN),
(str:'TYPE' ;special:false;keyword:m_all;op:NOTOKEN),
(str:'UNIT' ;special:false;keyword:m_all;op:NOTOKEN),
(str:'UNIV' ;special:false;keyword:m_mac;op:NOTOKEN),
(str:'USES' ;special:false;keyword:m_all;op:NOTOKEN),
(str:'WITH' ;special:false;keyword:m_all;op:NOTOKEN),
(str:'ALIAS' ;special:false;keyword:m_none;op:NOTOKEN),
@ -506,7 +512,12 @@ end;
end.
{
$Log$
Revision 1.27 2004-04-18 15:22:24 florian
Revision 1.28 2004-05-03 10:06:38 olle
+ added language constructs UNIV, C, ... for mode mac
* consolidated macro expression to conform to Pascal
* macro true is defined as <> 0
Revision 1.27 2004/04/18 15:22:24 florian
+ location support for arguments, currently PowerPC/MorphOS only
Revision 1.26 2004/02/17 17:38:11 daniel