当前位置: 首页 > news >正文

做一个公司网站一般多少钱网站后台模板论坛

做一个公司网站一般多少钱,网站后台模板论坛,怎么看一个网站做没做竞价,网络营销方式的优点Lex Flex 简介Lex是lexical compiler的缩写#xff0c;是Unix环境下非常著名的工具#xff0c; Lex (最早是埃里克施密特和 Mike Lesk 制作)是许多 UNIX 系统的标准词法分析器(lexical analyzer)产生程式#xff0c;而且这个工具所作的行为被详列为 POSIX 标准的一部分…Lex Flex 简介Lex是lexical compiler的缩写是Unix环境下非常著名的工具 Lex (最早是埃里克·施密特和 Mike Lesk 制作)是许多 UNIX 系统的标准词法分析器(lexical analyzer)产生程式而且这个工具所作的行为被详列为 POSIX 标准的一部分。Lex的基本工作原理为由正则表达式生成NFA将NFA变换成DFADFA经化简后模拟生成词法分析器。Lex 主要功能是生成一个词法分析器(scanner)的 C 源码,描述规则采用正则表达式(regular expression)。描述词法分析器的文件 *.l 经过lex编译后生成一个lex.yy.c 的文件然后由 C 编译器编译生成一个词法分析器。词法分析器简言之就是将输入的各种符号转化成相应的标识符(token)转化后的标识符很容易被后续阶段处理如Yacc 或 Bison过程如图 在linux系统上我们最常用的是FlexFlex (fast lexical analyser generator) 是 Lex 的另一个替代品。它经常和自由软件 Bison 语法分析器生成器 一起使用。Flex 最初由 Vern Paxson 于 1987 年用C语言写成。Flex手册里对 Flex 描述如下:FLEX (fast lexical analyzer generator) is a tool/computer program for generating lexical analyzers (scanners or lexers) written by Vern Paxson in C around 1987. It is used together with Berkeley Yacc parser generator or GNU Bison parser generator. Flex and Bison both are more flexible than Lex and Yacc and produces faster code.Bison produces parser from the input file provided by the user. The function yylex() is automatically generated by the flex when it is provided with a .l file and this yylex() function is expected by parser to call to retrieve tokens from current/this token stream.Lex Flex 输入文件格式Flex 的输入文件包含了三部分分别是定义区(definitions)、规则区(rules)和用户代码区(user code)并且由单独占一行的两个连续的百分号(%%)分隔开definitions%%rules%%user code下面对 Flex 输入文件的三个部分做出解释1 定义部分定义部分包含变量的声明正则定义清单常量。在定义部分文本放在“{}”括号中。用花括号括起来的所有内容都会直接复制到lex.yy.c文件中。语法%{// Definitions%}2 规则部分rules部分包含一系列规则格式为pattern action并且模式 pattern 位于行首不能缩进action 也应该起始于同一行规则部分包含在“%% %%”中。语法%%pattern action%%下表显示了一些模式匹配。PatternIt can match with[0-9]all the digits between 0 and 9[09]either 0, or 9[0, 9]either 0, ‘, ‘ or 9[0 9]either 0, ‘ ‘ or 9[-09]either -, 0 or 9[-0-9]either – or all digit between 0 and 9[0-9]one or more digit between 0 and 9[^a]all the other characters except a[^A-Z]all the other characters except the upper case lettersa{2, 4}either aa, aaa or aaaaa{2, }two or more occurrences of aa{4}exactly 4 a’s i.e, aaaa.any character except newlinea*0 or more occurrences of aa1 or more occurrences of a[a-z]all lower case letters[a-zA-Z]any alphabetic letterw(x \y)zwxz or wyz3 用户代码部分这部分包含C语句和其他功能。我们还可以分别编译这些函数并使用词法分析器加载。如何运行程序要运行该程序首先应将其保存为扩展名.l或.lex。在终端上运行以下命令以运行程序文件。步骤1lex filename.l或lex filename.lex取决于扩展文件步骤2gcc lex.yy.c步骤3./ a.out步骤4在需要时将输入提供给程序注意按Ctrl D或使用某些规则停止接受用户输入。请查看以下程序的输出图像以清除是否有疑问以运行程序。简单例子计算字符串中的字符数/*** Definition Section has one variablewhich can be accessed inside yylex()and main() ***/%{int count 0;%}/*** Rule Section has three rules, first rulematches with capital letters, second rulematches with any character except newline andthird rule does not take input after the enter***/%%[A-Z] {printf(%s capital letter\n, yytext);count;}. {printf(%s not a capital letter\n, yytext);}\n {return 0;}%%/*** Code Section prints the number ofcapital letter present in the given input***/int yywrap(){}int main(){// Explanation:// yywrap() - wraps the above rule section/* yyin - takes the file pointerwhich contains the input*//* yylex() - this is the main flex functionwhich runs the Rule Section*/// yytext is the text in the buffer// Uncomment the lines below// to take input from file// FILE *fp;// char filename[50];// printf(Enter the filename: \n);// scanf(%s,filename);// fp fopen(filename,r);// yyin fp;yylex();printf(\nNumber of Captial letters in the given input - %d\n, count);return 0;}运行查找读取文本所有整数%{/*用flex写一个查找读取文本所有整数的程序*/int count 0;%}%%[-]?[0-9] { count; printf(%s\n, yytext); } /* Print integers */\n {} /* newline */. {} /* For others, do nothing */%%void main() {yylex();printf(Number count is %d\n, count);}int yywrap() {return 1;}运行参考文章
http://www.zqtcl.cn/news/958660/

相关文章:

  • wordpress百度站内搜索wordpress 修改用户名
  • 网络企业网站建设方案做网站大概需要多少费用
  • 网站301是什么意思自动友链网
  • 淘宝客怎么建设自己网站wordpress links插件
  • 深圳设计网站公司网站芜湖网站建设工作室
  • 礼品类网站建设策划方案郑州手机网站制作
  • 江桥做网站wordpress代码高亮插件
  • 合肥网站制作哪家好建设网站培训班
  • 优化站诊断山东大型网站建设
  • 网页设计与制作个人网站网络开发工程师
  • 沈阳网站关键词优化哪家好外贸营销网站制作公司
  • 连云港做网站的临沂网站建设有哪些
  • 做毕设的网站万wordpress图片怎么居中
  • 首页网站模板网站外链分析怎么做
  • so域名的网站有哪些结合公众号小店做网站
  • 阜宁专业做网站做信息网站能挣钱吗
  • wordpress 怎么手动更新宝安网站 建设seo信科
  • 腾讯的网站建设用了多少钱找人合伙做网站平台
  • 企业网站功能模块介绍服务器免费体验
  • 小程序制作收款网站结构优化的优化包括
  • 北京市建设工程质监站网站poi player wordpress
  • php网站开发工程师招聘网自己做小程序要钱吗
  • 两学一做考试网站空间网
  • 齐诺网站建设东莞网站建设做网站集团网站群
  • 网站运营策略如何做软件网站开发培训
  • 数据库型网站wordpress上传工具
  • 太原建站公司模板宁波seo公司哪家好
  • 电商网站都是用什么做的承接电商网站建设
  • c2c网站代表有哪些怎样制作个人网站
  • wordpress linux 建站安丘市建设局官方网站