-extern void pic14initpCodePeepCommands(void);
-
-void peepRules2pCode(peepRule *rules)
-{
- peepRule *pr;
-
- pCodePeep *currentRule;
- pCodePeepSnippets *pcps;
-
- pic14initpCodePeepCommands();
-
- /* The rules are in a linked-list. Each rule has two portions */
- /* There's the `target' and there's the `replace'. The target */
- /* is compared against the SDCC generated code and if it */
- /* matches, it gets replaced by the `replace' block of code. */
- /* */
- /* Here we loop through each rule and convert the target's and*/
- /* replace's into pCode target and replace blocks */
-
- for (pr = rules; pr; pr = pr->next) {
-
- //DFPRINTF((stderr,"\nRule:\n\n"));
-
- pcps = Safe_calloc(1,sizeof(pCodePeepSnippets));
- peepSnippets = DLL_append((_DLL*)peepSnippets,(_DLL*)pcps);
-
- currentRule = pcps->peep = Safe_calloc(1,sizeof(pCodePeep));
- initpCodePeep(currentRule);
-
- /* Convert the target block */
- peepRuleBlock2pCodeBlock(pr->match, ¤tRule->target);
-
- //DFPRINTF((stderr,"finished target, here it is in pcode form:\n"));
- //printpBlock(stderr, currentRule->target.pb);
-
- //DFPRINTF((stderr,"target with labels merged:\n"));
- //pBlockMergeLabels(curBlock);
- pBlockMergeLabels(currentRule->target.pb);
- //printpBlock(stderr, currentRule->replace.pb);
-
- //#ifdef PCODE_DEBUG
- // printpBlock(stderr, curBlock);
- //#endif
- //DFPRINTF((stderr,"\nReplaced by:\n"));
-
-
- /* Convert the replace block */
- peepRuleBlock2pCodeBlock(pr->replace, ¤tRule->replace);
-
- //DFPRINTF((stderr,"finished replace block, here it is in pcode form:\n"));
- //printpBlock(stderr, curBlock);
-
- //DFPRINTF((stderr,"replace with labels merged:\n"));
-
- pBlockMergeLabels(currentRule->replace.pb);
- //printpBlock(stderr, currentRule->replace.pb);
-
- peepRuleCondition(pr->cond,currentRule);
-
- /* The rule has been converted to pCode. Now allocate
- * space for the wildcards */
-
- postinit_pCodeWildBlock(¤tRule->target);
- postinit_pCodeWildBlock(¤tRule->replace);
-
- //return; // debug ... don't want to go through all the rules yet
- }
-
- {
- pCodePeep *peepBlock;
- _DLL *peeprules;
-
- peeprules = (_DLL *)peepSnippets;
- //fprintf(stderr,"target rules\n");
- while(peeprules) {
- //fprintf(stderr," rule:\n");
- peepBlock = ((pCodePeepSnippets*)peeprules)->peep;
- //printpBlock(stderr, peepBlock->target.pb);
- peeprules = peeprules->next;
- }
- //fprintf(stderr," ... done\n");
- }
-
-}
-
-void printpCodeString(FILE *of, pCode *pc, int max)