+ adding operators "|" and "&" for macpas

This commit is contained in:
olle 2004-07-05 23:25:34 +00:00
parent 7793f8aa27
commit 98df0978e1
3 changed files with 42 additions and 11 deletions

View File

@ -2231,9 +2231,9 @@ implementation
{ Warning these stay be ordered !! } { Warning these stay be ordered !! }
operator_levels:array[Toperator_precedence] of set of Ttoken= operator_levels:array[Toperator_precedence] of set of Ttoken=
([_LT,_LTE,_GT,_GTE,_EQUAL,_UNEQUAL,_OP_IN,_OP_IS], ([_LT,_LTE,_GT,_GTE,_EQUAL,_UNEQUAL,_OP_IN,_OP_IS],
[_PLUS,_MINUS,_OP_OR,_OP_XOR], [_PLUS,_MINUS,_OP_OR,_PIPE,_OP_XOR],
[_CARET,_SYMDIF,_STARSTAR,_STAR,_SLASH, [_CARET,_SYMDIF,_STARSTAR,_STAR,_SLASH,
_OP_AS,_OP_AND,_OP_DIV,_OP_MOD,_OP_SHL,_OP_SHR], _OP_AS,_OP_AND,_AMPERSAND,_OP_DIV,_OP_MOD,_OP_SHL,_OP_SHR],
[_STARSTAR] ); [_STARSTAR] );
function sub_expr(pred_level:Toperator_precedence;accept_equal : boolean):tnode; function sub_expr(pred_level:Toperator_precedence;accept_equal : boolean):tnode;
@ -2289,9 +2289,11 @@ implementation
p1:=cinnode.create(p1,p2); p1:=cinnode.create(p1,p2);
_OP_IS : _OP_IS :
p1:=cisnode.create(p1,p2); p1:=cisnode.create(p1,p2);
_OP_OR : _OP_OR,
_PIPE {macpas only} :
p1:=caddnode.create(orn,p1,p2); p1:=caddnode.create(orn,p1,p2);
_OP_AND : _OP_AND,
_AMPERSAND {macpas only} :
p1:=caddnode.create(andn,p1,p2); p1:=caddnode.create(andn,p1,p2);
_OP_DIV : _OP_DIV :
p1:=cmoddivnode.create(divn,p1,p2); p1:=cmoddivnode.create(divn,p1,p2);
@ -2453,7 +2455,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.161 2004-07-05 21:49:43 olle Revision 1.162 2004-07-05 23:25:34 olle
+ adding operators "|" and "&" for macpas
Revision 1.161 2004/07/05 21:49:43 olle
+ macpas style: exit, cycle, leave + macpas style: exit, cycle, leave
+ macpas compiler directive: PUSH POP + macpas compiler directive: PUSH POP

View File

@ -2388,14 +2388,20 @@ implementation
'&' : '&' :
begin begin
if not(m_fpc in aktmodeswitches) then if m_fpc in aktmodeswitches then
Illegal_Char(c)
else
begin begin
readnumber; readnumber;
token:=_INTCONST; token:=_INTCONST;
goto exit_label; goto exit_label;
end; end
else if m_mac in aktmodeswitches then
begin
readchar;
token:=_AMPERSAND;
goto exit_label;
end
else
Illegal_Char(c);
end; end;
'0'..'9' : '0'..'9' :
@ -2589,6 +2595,16 @@ implementation
goto exit_label; goto exit_label;
end; end;
'|' :
if m_mac in aktmodeswitches then
begin
readchar;
token:=_PIPE;
goto exit_label;
end
else
Illegal_Char(c);
'=' : '=' :
begin begin
readchar; readchar;
@ -3145,7 +3161,10 @@ exit_label:
end. end.
{ {
$Log$ $Log$
Revision 1.80 2004-06-20 08:55:30 florian Revision 1.81 2004-07-05 23:25:34 olle
+ adding operators "|" and "&" for macpas
Revision 1.80 2004/06/20 08:55:30 florian
* logs truncated * logs truncated
Revision 1.79 2004/05/23 20:55:38 peter Revision 1.79 2004/05/23 20:55:38 peter

View File

@ -68,6 +68,8 @@ type
_KLAMMERAFFE, _KLAMMERAFFE,
_POINTPOINT, _POINTPOINT,
_POINTPOINTPOINT, _POINTPOINTPOINT,
_PIPE,
_AMPERSAND,
_EOF, _EOF,
_ID, _ID,
_NOID, _NOID,
@ -296,6 +298,8 @@ 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:'...' ;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:'end of file' ;special:true ;keyword:m_none;op:NOTOKEN),
(str:'identifier' ;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), (str:'non identifier';special:true ;keyword:m_none;op:NOTOKEN),
@ -514,7 +518,10 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.30 2004-06-20 08:55:30 florian Revision 1.31 2004-07-05 23:25:34 olle
+ adding operators "|" and "&" for macpas
Revision 1.30 2004/06/20 08:55:30 florian
* logs truncated * logs truncated
Revision 1.29 2004/06/16 20:07:10 florian Revision 1.29 2004/06/16 20:07:10 florian