问题描述
我理解标记部分。我有lex读取文件,拆分标记,相应地标记它们,并在控制台中显示它。这之后的过程是什么?
1)此时我是否尝试从预处理器和lex中再次提取定义?哪个会出现在lex.h文件中,或者出现在像Dr.Dobbs这样的def文件中?
2)我此时是否制作符号表?
3 )如何将lexed输入传递给解析器,获取treenode,并开始匹配,或者链接部分?
必须要有一些善良的灵魂来帮助我连接点。哈哈。
我的尝试:
我试过了很少有编译器书籍,但他们的结构方式,他们遗漏了链接部分,以及许多在线网站。
I understand the tokenizing part. I have the lex reading the file, splitting the tokens, labeling them accordingly, and displaying it in the console. What is the process after this?
1)At this point do I try to pull the defines from preprocessor and lex again? Which would be in the lex.h file, or in a def file like Dr.Dobbs?
2)Do I make the symbol table at this point?
3)How do I pass the lexed input to the parser, get the treenode, and start matching, or the linking part of this?
There has to be some kind soul that will help me connect the dots. Lol.
What I have tried:
I have tried a few compiler books but the way they structure it, they leave out the linking part, as well as many of the sites online.
这篇关于使用lex和解析C处理文件的程序方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!