zyy.txt

来自「这是一个c++环境下的模拟文件系统的部分源代码」· 文本 代码 · 共 48 行

TXT
48
字号
#define EOF 256
#define IDENTIFIER 257
#define INTEGER 258
#define ERRONEOUS 259
typedef struct{
   char *file_name;
   int line_number;
   int char_number;
}Position_in_File;
typedef struct{
   int class;
   char *repr;
   Position_in_File pos;
}Token_Type;
extern Token_Type Token;
extern void start_lex(void);
extern void get_next_token(void);
 
#include "input.h"
#include "lex.h"
static char *input;
static int dot;
static int input_char;
#define next_char()
Token_Type Token;
void start_lex(void){
   input=get_input();
   dot=0;input_char=input[dot];
}
void get_next_token(void){
   int start_dot;
   skip_layout_and_comment();
   note_token_position();
   start_dot=dot;
   if(is_end_of_input(input_char)){
    Token.class=EOF;Token.rept="<EOF>";return;
}
   if (is_letter(input_char)){recognize_identifier();}
 else
   if(is_digit(input_char)){recognize_integer();}
 else
   if(is_operator(input_char)||is_separator(input_char)){
     Token.class=input_char;next_char();
}
 else{Token.class=ERRONEOUS;next_char();}
Token.repr=input_to_zstring(start_dot,dot_start_dot);
}

⌨️ 快捷键说明

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