9 Token * pTokenWhereMacroBecomesValid;
10 struct macroValidator *
15 mvl_init(MacroValidatorList
* out_pValidators
)
17 out_pValidators
->pFirst
= 0;
18 out_pValidators
->nextFreeIdentifier
= 1;
22 mvl_destruct(MacroValidatorList
* out_pValidators
)
24 MacroValidator
* pV
= out_pValidators
->pFirst
;
25 MacroValidator
* pDel
;
26 for ( pDel
= out_pValidators
->pFirst
;
32 pDel
->pMacro
->flag
&= (~ISACTIVE
);
38 #define INVALID_TILL_ENDOFROW 32000
40 /* If in_pTokenWhereMacroBecomesValid == 0, the macro is at row end
41 and therefore there does not exist any token, where the macro becomes
42 valid again. It is revalidated, when the row was processed complete.
45 mvl_add( MacroValidatorList
* inout_pValidators
,
47 Token
* in_pTokenWhereMacroBecomesValid
)
50 MacroValidator
* pNew
= new(MacroValidator
);
51 pNew
->pMacro
= in_pMacro
;
53 if (in_pTokenWhereMacroBecomesValid
== 0)
55 pNew
->nTokenWhereMacroBecomesValid
= INVALID_TILL_ENDOFROW
;
57 else if (in_pTokenWhereMacroBecomesValid
->identifier
> 0)
59 pNew
->nTokenWhereMacroBecomesValid
= in_pTokenWhereMacroBecomesValid
->identifier
;
63 pNew
->nTokenWhereMacroBecomesValid
= inout_pValidators
->nextFreeIdentifier
;
64 in_pTokenWhereMacroBecomesValid
->identifier
= inout_pValidators
->nextFreeIdentifier
;
65 inout_pValidators
->nextFreeIdentifier
++;
68 pNew
->pNext
= inout_pValidators
->pFirst
;
69 inout_pValidators
->pFirst
= pNew
;
74 mvl_move( MacroValidatorList * inout_pValidators,
78 for ( pV = inout_pValidators->pFirst;
82 pV->pTokenWhereMacroBecomesValid += in_nSpace;
88 mvl_check( MacroValidatorList
* inout_pValidators
,
89 Token
* inout_pTokenToCheck
)
91 MacroValidator
* pV
; /* Running pointer */
92 MacroValidator
* pCheckedOnes
; /* Here new list is built. */
95 for ( pV
= inout_pValidators
->pFirst
;
97 pV
= inout_pValidators
->pFirst
)
99 inout_pValidators
->pFirst
= pV
->pNext
;
101 if (pV
->nTokenWhereMacroBecomesValid
== inout_pTokenToCheck
->identifier
)
103 pV
->pMacro
->flag
&= (~ISACTIVE
);
108 pV
->pNext
= pCheckedOnes
;
113 /* Assign new built list (too old ones were removed) to
116 inout_pValidators
->pFirst
= pCheckedOnes
;
121 tokenrow_zeroTokenIdentifiers(Tokenrow
* trp
)
124 for (tp
= trp
->bp
; tp
< trp
->lp
; tp
++)