Lex和Yacc介紹

Lex:html

詞法分析器。linux

Wiki:windows

http://zh.wikipedia.org/wiki/Lex工具

http://en.wikipedia.org/wiki/Lex_programming_tool 學習

已經成爲POSIX的標準了,因此通常的linux系統應該都自帶了lex命令了。flex是lex的開源版本,項目主頁:http://sourceforge.net/projects/flex/ (http://flex.sourceforge.net/flex

Flex for windows:http://gnuwin32.sourceforge.net/packages/flex.htmspa

總之,如今也有不少相似於lex的開源軟件。.net

 

Yacc:語法分析器htm

百度百科:http://baike.baidu.com/view/553546.htmblog

是Unix/Linux上一個用來生成編譯器的編譯器(編譯器代碼生成器)。yacc生成的編譯器主要是用C語言寫成的語法解析器(Parser),須要與詞法解析器Lex一塊兒使用,再把兩部份產生出來的C程序一併編譯。yacc原本只在Unix系統上纔有,但現時已廣泛移植往Windows及其餘平臺。yacc的輸入是巴科斯範式(BNF)表達的語法規則以及語法規約的處理代碼,Yacc輸出的是基於表驅動的編譯器,包含輸入的語法規約的處理代碼部分。yacc是開發編譯器的一個有用的工具,採用LALR(1)語法分析方法。

wiki:http://en.wikipedia.org/wiki/Yacc

開源的,Bison是GNU版本的Yacc。

 

學習資源:

The Lex&Yacc page:http://dinosaur.compilertools.net/

Parser Generator(相似於lex和yacc的工具,windows):http://www.bumblebeesoftware.com/index.htm

compilers(編譯器的幾個工具的資料):http://tinf2.vub.ac.be/~dvermeir/courses/compilers/

Lex和Yacc快速入門:http://www.ibm.com/developerworks/cn/linux/sdk/lex/#resources

博文:http://archive.cnblogs.com/a/2206599/

compiler-construction-using-flex-and-bison.pdf: http://wenku.baidu.com/view/c9b18a18a8114431b90dd8c5.html

 article,Lex和Yacc應用方法:http://www.cppblog.com/woaidongmao/archive/2008/09/20/62322.html

相關文章
相關標籤/搜索