⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scanner.h

📁 c语言开发方面的经典问题,包括源代码.c语言开发所要注意的问题,以及在嵌入式等各方面的应用
💻 H
字号:
/* * File: scanner.h * --------------- * This file is the interface to a package that divides * a line into individual "tokens".  A token is defined * to be either * * 1. a string of consecutive letters and digits representing *    a word, or * * 2. a one-character string representing a separator *    character, such as a space or a punctuation mark. * * To use this package, you must first call * *        InitScanner(line); * * where line is the string (typically a line returned by * GetLine) that is to be divided into tokens.  To retrieve * each token in turn, you call * *        token = GetNextToken(); * * When the last token has been read, the predicate function * AtEndOfLine returns TRUE, so that the loop structure * *        while (!AtEndOfLine()) { *            token = GetNextToken(); *            . . . process the token . . . *        } * * serves as an idiom for processing each token on the line. * * Further details for each function are given in the * individual descriptions below. */#ifndef _scanner_h#define _scanner_h#include "genlib.h"/* * Function: InitScanner * Usage: InitScanner(line); * ------------------------- * This function initializes the scanner and sets it up so that * it reads tokens from line.  After InitScanner has been called, * the first call to GetNextToken will return the first token * on the line, the next call will return the second token, * and so on. */void InitScanner(string line);/* * Function: GetNextToken * Usage: word = GetNextToken(); * ----------------------------- * This function returns the next token on the line. */string GetNextToken(void);/* * Function: AtEndOfLine * Usage: if (AtEndOfLine()) . . . * ------------------------------- * This function returns TRUE when the scanner has reached * the end of the line. */bool AtEndOfLine(void);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -