Google

星期日, 五月 04, 2008

Flex

Overview of Flex

Flex is a tool for generating scanners. A scanner, sometimes called a tokenizer, is a program which recognizes lexical patterns in text. The flex program reads user-specified input files, or its standard input if no file names are given, for a description of a scanner to generate. The description is in the form of pairs of regular expressions and C code, called rules. Flex generates a C source file named, "lex.yy.c", which defines the function yylex(). The file "lex.yy.c" can be compiled and linked to produce an executable. When the executable is run, it analyzes its input for occurrences of text matching the regular expressions for each rule. Whenever it finds a match, it executes the corresponding C code.

http://flex.sourceforge.net/

标签: , ,

Bison

安装指导参见: the 节 called 安装 Bison-1.875 在 第 6 章.

Bison的内容

Bison 是替代yacc的语法解析器. Bison能生成可以分析文本文件结构的程序.

安装下列程序: bison 和 yacc

安装下列库文件: liby.a

简短说明

bison 是替代yacc的语法分析程序生成器. yacc是 Yet Another Compiler Compiler(又一个编译器的编译器)的缩写.

yacc是bison的包装脚本,实际上是以-y的参数调用bison. 这个是为了和那些用yacc而不是bison的程序兼容.

liby.a 是 Yacc 库,包含了与Yacc兼容的 yyerror 和主要函数。通常这个库没什么用,但 POSIX 要求有它.

Bison 安装依赖关系

Bison 依赖于: Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, Grep, M4, Make, Sed.

http://man.chinaunix.net/linux/lfs/htmlbook/appendixa/bison.html

标签: ,

辽ICP备05003652号
流风洄雪听天籁,轻云蔽日看落花

Powered by Blogger