/* deallocate */ void LexCleanup(Picoc *pc) { int Count; LexInteractiveClear(pc, NULL); for (Count = 0; Count < sizeof(ReservedWords) / sizeof(struct ReservedWord); Count++) TableDelete(pc, &pc->ReservedWordTable, TableStrRegister(pc, ReservedWords[Count].Word)); }
/* parse interactively */ void PicocParseInteractiveNoStartPrompt(Picoc *pc, int EnableDebugger) { struct ParseState Parser; enum ParseResult Ok; LexInitParser(&Parser, pc, NULL, NULL, pc->StrEmpty, TRUE, EnableDebugger); LexInteractiveClear(pc, &Parser); do { LexInteractiveStatementPrompt(pc); Ok = ParseStatement(&Parser, TRUE); LexInteractiveCompleted(pc, &Parser); } while (Ok == ParseResultOk); if (Ok == ParseResultError) ProgramFail(&Parser, "parse error"); PlatformPrintf(pc, "\n"); }
/* parse interactively */ void PicocParseInteractive() { struct ParseState Parser; enum ParseResult Ok; PlatformPrintf(INTERACTIVE_PROMPT_START); LexInitParser(&Parser, NULL, NULL, StrEmpty, TRUE); // PicocPlatformSetExitPoint(); LexInteractiveClear(&Parser); do { LexInteractiveStatementPrompt(); Ok = ParseStatement(&Parser, TRUE); LexInteractiveCompleted(&Parser); } while (Ok == ParseResultOk); if (Ok == ParseResultError) ProgramFail(&Parser, "parse error"); PlatformPrintf("\n"); }
/* deallocate */ void LexCleanup() { LexInteractiveClear(NULL); }