PushTFtok (Res, GetSType (Var), combinedtok)
ELSE
MetaErrorT1 (combinedtok,
- 'the parameter to {%A1kABS} must be a variable or constant, seen {%E1ad}',
+ 'the parameter to {%A1kABS} must be a variable or constant, seen {%1ad}',
Var)
END
ELSE
THEN
(* not sensible to try and recover when we dont know the return type. *)
MetaErrorT1 (typetok,
- 'undeclared type found in builtin procedure function {%AkVAL} {%A1ad}',
+ 'undeclared type found in builtin procedure function {%AkVAL} {%1ad}',
Type)
(* non recoverable error. *)
ELSIF (IsSet (Type) OR IsEnumeration (Type) OR IsSubrange (Type) OR
ELSE
(* not sensible to try and recover when we dont know the return type. *)
MetaErrorT0 (functok,
- 'the builtin procedure {%AkVAL} has thw following formal parameter declaration {%kVAL} (type, expression)')
+ 'the builtin procedure {%AkVAL} has the following formal parameter declaration {%kVAL} (type, expression)')
(* non recoverable error. *)
END
ELSE
ELSE
(* not sensible to try and recover when we dont know the return type. *)
MetaErrorT0 (functok,
- 'the second parameter to the builtin procedure {%AkCAST} must either be a variable, constant or a procedure. The formal parameters to cast are CAST(type, variable or constant or procedure)')
+ 'the second parameter to the builtin procedure {%AkCAST} must either be a variable, constant or a procedure. The formal parameters to cast are {%kCAST} (type, variable or constant or procedure)')
(* non recoverable error. *)
END
ELSE
ELSIF GetSType (type) = NulSym
THEN
MetaErrorT1 (tok,
- 'unable to obtain the {%AkMIN} value for type {%1Aad}', type) ;
+ 'unable to obtain the {%AkMIN} value for type {%1ad}', type) ;
(* non recoverable error. *)
InternalError ('MetaErrorT1 {%AkMIN} should call abort')
ELSE
ELSIF GetSType (type) = NulSym
THEN
MetaErrorT1 (tok,
- 'unable to obtain the {%AkMAX} value for type {%1Aad}', type) ;
+ 'unable to obtain the {%AkMAX} value for type {%1ad}', type) ;
(* non recoverable error. *)
InternalError ('MetaErrorT1 {%AkMAX} should call abort')
ELSE
ELSE
(* we dont know the type therefore cannot fake a return. *)
MetaErrorT1 (vartok,
- 'parameter to {%AkMIN} must be a type or a variable, seen {%1Aad}',
+ 'parameter to {%AkMIN} must be a type or a variable, seen {%1ad}',
Var)
(* non recoverable error. *)
END
ELSE
(* we dont know the type therefore cannot fake a return. *)
MetaErrorT1 (functok,
- 'the pseudo builtin procedure function {%AkMIN} only has one parameter, seen {%1An}',
+ 'the pseudo builtin procedure function {%AkMIN} only has one parameter, seen {%1n}',
NoOfParam)
(* non recoverable error. *)
END
ELSE
(* we dont know the type therefore cannot fake a return. *)
MetaErrorT1 (vartok,
- 'parameter to {%AkMAX} must be a type or a variable, seen {%1Aad}',
+ 'parameter to {%AkMAX} must be a type or a variable, seen {%1ad}',
Var)
(* non recoverable error. *) ;
END
ELSE
(* we dont know the type therefore cannot fake a return. *)
MetaErrorT1 (functok,
- 'the pseudo builtin procedure function {%AkMAX} only has one parameter, seen {%1An}',
+ 'the pseudo builtin procedure function {%AkMAX} only has one parameter, seen {%1n}',
NoOfParam)
(* non recoverable error. *)
END
ELSE
(* we dont know the type therefore cannot fake a return. *)
MetaErrorT1 (functok,
- 'the pseudo builtin procedure function {%AkTRUNC} only has one parameter, seen {%1An}', NoOfParam)
+ 'the pseudo builtin procedure function {%AkTRUNC} only has one parameter, seen {%1n}', NoOfParam)
(* non recoverable error. *)
END
END BuildTruncFunction ;
THEN
paramtok := OperandTok (1) ;
resulttok := MakeVirtualTok (functok, functok, paramtok) ;
- BuildSizeCheckEnd (ProcSym) ; (* quadruple generation now on *)
+ BuildSizeCheckEnd (ProcSym) ; (* Quadruple generation now on. *)
ReturnVar := MakeTemporary (resulttok, ImmediateValue) ;
GenQuadO (resulttok, SizeOp, ReturnVar, NulSym, OperandT(1), TRUE)
ELSIF IsVar (OperandT (1))
THEN
- BuildSizeCheckEnd (ProcSym) ; (* quadruple generation now on *)
+ BuildSizeCheckEnd (ProcSym) ; (* Quadruple generation now on. *)
Type := GetSType (OperandT (1)) ;
paramtok := OperandTok (1) ;
resulttok := MakeVirtualTok (functok, functok, paramtok) ;
IF IsUnbounded (Type)
THEN
- (* eg. SIZE(a) ; where a is unbounded dereference HIGH and multiply by the TYPE *)
+ (* Eg. SIZE(a) ; where a is unbounded dereference HIGH and multiply by the TYPE. *)
dim := OperandD (1) ;
IF dim = 0
THEN
OperandT (1)) ;
ReturnVar := MakeConstLit (resulttok, MakeKey('0'), Cardinal)
END ;
- PopN (NoOfParam+1) ; (* destroy the arguments and function *)
+ PopN (NoOfParam+1) ; (* Destroy the arguments and function. *)
PushTFtok (ReturnVar, GetSType(ProcSym), resulttok)
END BuildSizeFunction ;
CONST
Debugging = FALSE ;
- Pass1 = FALSE ; (* permanently disabled for the time being *)
- Pass2 = FALSE ;
- Pass3 = TRUE ; (* permanently disabled for the time being *)
DebugAsm = FALSE ;
VAR
*)
PROCEDURE Expect (t: toktype; stopset0: SetOfStop0; stopset1: SetOfStop1; stopset2: SetOfStop2) ;
+CONST
+ Pass1 = FALSE ;
BEGIN
IF currenttoken=t
THEN
DefProcedureHeading ";" =:
AsmStatement := % VAR CurrentAsm: CARDINAL ; %
- 'ASM' % IF Pass3
- THEN
- PushAutoOn ;
- PushT(0) ; (* operand count *)
- PushT(MakeGnuAsm())
- END
+ 'ASM' % PushAutoOn ;
+ PushT(0) ; (* operand count *)
+ PushT(MakeGnuAsm())
%
- [ 'VOLATILE' % IF Pass3
- THEN
- PopT(CurrentAsm) ;
- PutGnuAsmVolatile(CurrentAsm) ;
- PushT(CurrentAsm)
- END
+ [ 'VOLATILE' % PopT(CurrentAsm) ;
+ PutGnuAsmVolatile(CurrentAsm) ;
+ PushT(CurrentAsm)
%
- ] '(' AsmOperands % IF Pass3
- THEN
- PopNothing ; (* throw away interface sym *)
- BuildInline ;
- PopNothing ; (* throw away count *)
- PopAuto
- END
+ ] '(' AsmOperands % PopNothing ; (* throw away interface sym *)
+ BuildInline ;
+ PopNothing ; (* throw away count *)
+ PopAuto
%
')' =:
AsmOperands := % VAR CurrentAsm, count: CARDINAL ;
str: CARDINAL ;
%
- ConstExpression % IF Pass3
+ ConstExpression % PopT(str) ;
+ PopT(CurrentAsm) ;
+ Assert(IsGnuAsm(CurrentAsm) OR IsGnuAsmVolatile(CurrentAsm)) ;
+ PopT(count) ;
+ IF DebugAsm
THEN
- PopT(str) ;
- PopT(CurrentAsm) ;
- Assert(IsGnuAsm(CurrentAsm) OR IsGnuAsmVolatile(CurrentAsm)) ;
- PopT(count) ;
- IF DebugAsm
- THEN
- printf1('1: count of asm operands: %d\n', count)
- END ;
- PushT(count) ;
- (* adds the name/instruction for this asm *)
- PutGnuAsm(CurrentAsm, str) ;
- PushT(CurrentAsm) ;
- PushT(NulSym) (* the InterfaceSym *)
- END
+ printf1('1: count of asm operands: %d\n', count)
+ END ;
+ PushT(count) ;
+ (* adds the name/instruction for this asm *)
+ PutGnuAsm(CurrentAsm, str) ;
+ PushT(CurrentAsm) ;
+ PushT(NulSym) (* the InterfaceSym *)
%
( AsmOperandSpec | % (* epsilon *)
- IF Pass3
- THEN
- PutGnuAsmSimple(CurrentAsm)
- END
+ PutGnuAsmSimple(CurrentAsm)
%
)
=:
AsmOperandSpec := % VAR CurrentAsm, outputs, inputs, trash, count: CARDINAL ;
%
- ':' AsmOutputList % IF Pass3
+ ':' AsmOutputList % PopT(outputs) ;
+ PopT(CurrentAsm) ;
+ Assert(IsGnuAsm(CurrentAsm) OR IsGnuAsmVolatile(CurrentAsm)) ;
+ PopT(count) ;
+ IF DebugAsm
THEN
- PopT(outputs) ;
- PopT(CurrentAsm) ;
- Assert(IsGnuAsm(CurrentAsm) OR IsGnuAsmVolatile(CurrentAsm)) ;
- PopT(count) ;
- IF DebugAsm
- THEN
- printf1('2: output count of asm operands: %d\n', count)
- END ;
- PutGnuAsmOutput(CurrentAsm, outputs) ;
- PushT(0) ; (* reset count *)
- PushT(CurrentAsm) ;
- PushT(NulSym) (* the InterfaceSym *)
- END
+ printf1('2: output count of asm operands: %d\n', count)
+ END ;
+ PutGnuAsmOutput(CurrentAsm, outputs) ;
+ PushT(0) ; (* reset count *)
+ PushT(CurrentAsm) ;
+ PushT(NulSym) (* the InterfaceSym *)
%
- [ ':' AsmInputList % IF Pass3
+ [ ':' AsmInputList % PopT(inputs) ;
+ PopT(CurrentAsm) ;
+ Assert(IsGnuAsm(CurrentAsm) OR IsGnuAsmVolatile(CurrentAsm)) ;
+ PopT(count) ;
+ IF DebugAsm
THEN
- PopT(inputs) ;
- PopT(CurrentAsm) ;
- Assert(IsGnuAsm(CurrentAsm) OR IsGnuAsmVolatile(CurrentAsm)) ;
- PopT(count) ;
- IF DebugAsm
- THEN
- printf1('3: input count of asm operands: %d\n', count)
- END ;
- PutGnuAsmInput(CurrentAsm, inputs) ;
- PushT(0) ; (* reset count *)
- PushT(CurrentAsm) ;
- PushT(NulSym) (* the InterfaceSym *)
- END
+ printf1('3: input count of asm operands: %d\n', count)
+ END ;
+ PutGnuAsmInput(CurrentAsm, inputs) ;
+ PushT(0) ; (* reset count *)
+ PushT(CurrentAsm) ;
+ PushT(NulSym) (* the InterfaceSym *)
%
- [ ':' AsmTrashList % IF Pass3
+ [ ':' AsmTrashList % PopT(trash) ;
+ PopT(CurrentAsm) ;
+ Assert(IsGnuAsm(CurrentAsm) OR IsGnuAsmVolatile(CurrentAsm)) ;
+ PopT(count) ;
+ IF DebugAsm
THEN
- PopT(trash) ;
- PopT(CurrentAsm) ;
- Assert(IsGnuAsm(CurrentAsm) OR IsGnuAsmVolatile(CurrentAsm)) ;
- PopT(count) ;
- IF DebugAsm
- THEN
- printf1('4: trash count of asm operands: %d\n', count)
- END ;
- PutGnuAsmTrash(CurrentAsm, trash) ;
- PushT(0) ; (* reset count *)
- PushT(CurrentAsm) ;
- PushT(NulSym) (* the InterfaceSym *)
- END
+ printf1('4: trash count of asm operands: %d\n', count)
+ END ;
+ PutGnuAsmTrash(CurrentAsm, trash) ;
+ PushT(0) ; (* reset count *)
+ PushT(CurrentAsm) ;
+ PushT(NulSym) (* the InterfaceSym *)
%
] ]
=:
AsmOperandName := ( NamedOperand
| % IF IsAutoPushOn()
THEN
- PushTF(NulName, identtok)
+ PushTF (NulName, identtok)
END
%
)
=:
AsmInputElement := AsmOperandName
- ConstExpression '(' Expression % IF Pass3
- THEN
- BuildAsmElement (TRUE, FALSE)
- END
+ ConstExpression '(' Expression % BuildAsmElement (TRUE, FALSE)
%
')'
=:
AsmOutputElement := AsmOperandName
- ConstExpression '(' Expression % IF Pass3
- THEN
- BuildAsmElement (FALSE, TRUE)
- END
+ ConstExpression '(' Expression % BuildAsmElement (FALSE, TRUE)
%
')'
=:
-AsmTrashList := % VAR expr, tokpos: CARDINAL ; %
- [ ConstExpression % IF Pass3
- THEN
- BuildAsmTrash
- END
-
+AsmTrashList := [ ConstExpression % BuildAsmTrash
%
- ] { ',' ConstExpression % IF Pass3
- THEN
- BuildAsmTrash
- END
+ ] { ',' ConstExpression % BuildAsmTrash
%
} =: