资 源 简 介
前些天写了个小语言的词法分析程序,因为前些天在VC知识库看到一个pascal词法分析的程序,觉得写得挺复杂的。其实词法分析程序的原理都是一样的,所以我想只要搞明白了简单的词法分析程序,再写复杂的就不难了,无非是多加几个关键字,多写几个条件判断语句而已。词法分析是编译程序的基础,也是最简单的。好,现在让我们看程序吧。 先让我们看看这个小语言的文法吧-few days ago wrote a small language lexical analysis procedures, because the other day in the knowledge base to see a VC pascal lexical analysis procedures, find that quite complex. In fact, lexical analysis procedure is the same principle, I think if you understood a simple lexical analysis procedure to write complex it is not difficult, is nothing but add a few keywords and writing several conditions judgment statement it. Lexical analysis is the basis of compilers, as well as the most simple. Well, now let us look at the procedures it. Let us look at this small language grammar it