📄 zyy.txt
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -