/* Get the overall condition based on all conditions on the stack. */
{
/* Since the last entry contains the overall condition of the parent, we
- * must check it in combination of the current condition. If there is no
- * last entry, the overall condition is true.
- */
+ ** must check it in combination of the current condition. If there is no
+ ** last entry, the overall condition is true.
+ */
return (IfCount == 0) ||
((IfStack[IfCount-1].Flags & (ifCond | ifParentCond)) == (ifCond | ifParentCond));
}
static void CalcOverallIfCond (void)
-/* Caclulate the overall condition based on all conditions on the stack. */
+/* Calculate the overall condition, based on all conditions on the stack. */
{
IfCond = GetOverallIfCond ();
}
NextTok ();
/* Ignore the new condition if we are inside a false .ELSE
- * branch. This way we won't get any errors about undefined
- * symbols or similar...
- */
+ ** branch. This way we won't get any errors about undefined
+ ** symbols or similar...
+ */
if (IfCond) {
SetIfCond (D, ConstExpression ());
ExpectSep ();
FreeIf ();
/* Be sure not to read the next token until the .IF stack
- * has been cleanup up, since we may be at end of file.
- */
+ ** has been cleanup up, since we may be at end of file.
+ */
NextTok ();
ExpectSep ();
CalcOverallIfCond ();
break;
+ case TOK_IFP4510:
+ D = AllocIf (".IFP4510", 1);
+ NextTok ();
+ if (IfCond) {
+ SetIfCond (D, GetCPU() == CPU_4510);
+ }
+ ExpectSep ();
+ CalcOverallIfCond ();
+ break;
+
case TOK_IFP816:
D = AllocIf (".IFP816", 1);
NextTok ();
int CheckConditionals (void)
/* Check if the current token is one that starts a conditional directive, and
- * call DoConditionals if so. Return true if a conditional directive was found,
- * return false otherwise.
- */
+** call DoConditionals if so. Return true if a conditional directive was found,
+** return false otherwise.
+*/
{
switch (CurTok.Tok) {
case TOK_ELSE:
case TOK_IFNDEF:
case TOK_IFNREF:
case TOK_IFP02:
+ case TOK_IFP4510:
case TOK_IFP816:
case TOK_IFPC02:
case TOK_IFPSC02:
void CheckOpenIfs (void)
/* Called from the scanner before closing an input file. Will check for any
- * open .ifs in this file.
- */
+** open .ifs in this file.
+*/
{
const LineInfo* LI;
while (1) {
/* Get the current file number and check if the topmost entry on the
- * .IF stack was inserted with this file number
- */
+ ** .IF stack was inserted with this file number
+ */
IfDesc* D = GetCurrentIf ();
if (D == 0) {
/* There are no open .IFs */