目前正在try 使用Flex创建词法分析器.当运行命令flex pl0_lexer.l
时,我的pl0_lexper.h中的Include语句与我的pl0_lexper.c不匹配.
pl0_lexer.l Snippet个
%option header-file = "pl0_lexer.h"
%option outfile = "pl0_lexer.c"
%option yylineno
%option bison-bridge
%{
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <limits.h>
#include "ast.h"
#include "parser_types.h"
#include "utilities.h"
#include "lexer.h"
/* Tokens generated by Bison */
#include "pl0.tab.h"
%}
My problem是所有用户定义的标头(如"ast.h"
)都出现在.c
代码中,但pl0_lexer.h
只包括标准C标头.