自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

GodLike

世界上最遥远的距离不是牛 A 和 牛 C 之间的狭小空隙而是我们当中有人在通往牛 B 的路上一路狂奔而有人中途就放弃了

  • 博客(14)
  • 资源 (8)
  • 收藏
  • 关注

原创 编译器DIY——词法分析

在上一篇文章中已经介绍了读文件的操作,那么这一篇文章中将会仔细解释词法分析。在源文件中解析出的单词流必须识别为保留字,标识符,常量,操作符和界符五大类1.显然我们需要列举出所有的保留字,而这里与保留字相似的那么就是标识符,在C语言中,保留字都是以小写字母开头,而且其中的字母只能是小写字母,而标识符的第一个字母则必须为字符(小写大写皆可)后面可以接大小写字母和字符 ‘_’, 在我写的这个编译

2014-06-14 16:01:05 1920

原创 编译器DIY——读文件

编译器的前端词法分析:将源文件解析成一个个的单词流,为语法分析做准备。在词法分析阶段,我们要做的就是将词分出来,并且确定单词的类型,一般的程序设计语言的单词符号可以份为以下5种:1.关键字,如int,long等2.标识符,用来表示各种名字,如常量名,变量名等3.常数,各种类型的常数,如12,1.2等4.运算符:如+,-,*,/等5.界符,如“,”“;”等那么在实际的过程

2014-06-12 09:44:10 1271

原创 编译器DIY之———统计英文文本中的单词数,字符数和行数

咳咳,这一章节应该是连载编译器的DIY的,可是在做DIY之前先用flex 来练练手,对于后面的理解有帮助作用。在word 中我经常看到有一个单词统计的功能,那么是怎么来实现的了,当然第一个念头就是遍历整个文本依据换行和空格对字符串进行分析,那么这是可行的。可是能不能简单点了,其实对文本做单词分析,大家都知道怎么做,难得地方可能就是代码的实现了,那么现在如果使用正则表达式来实现的话,那么一切问题

2014-06-10 09:31:34 4196

原创 projecteuler---->problem=25----1000-digit Fibonacci number

问题描述:The Fibonacci sequence is defined by the recurrence relation:Fn = Fn1 + Fn2, where F1 = 1 and F2 = 1.Hence the first 12 terms will be:F1 = 1F2 = 1F3 = 2F4 = 3F5 = 5F6 = 8

2014-06-09 17:07:54 1093

原创 projecteuler---->problem=24----Lexicographic permutations

问题描述:A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabeti

2014-06-09 16:50:01 1149

原创 projecteuler---->problem=23----Non-abundant sums

A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means th

2014-06-07 11:19:34 1223

原创 projecteuler---->problem=22----Names scores

sing names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical v

2014-06-05 10:19:32 1301

原创 projecteuler---->problem=21----Amicable numbers

Let d(n) be defined as the sum of proper divisors of n (numbers less thann which divide evenly into n).If d(a) = b and d(b) = a, where a b, then a and b are an amicable pair and each of a andb

2014-06-05 08:50:31 1117

原创 projecteuler---->problem=20----Factorial digit sum

n! means n (n 1) ... 3 2 1For example, 10! = 10 9 ... 3 2 1 = 3628800,and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.Find the sum of the digits

2014-06-05 08:26:43 1301

原创 projecteuler---->problem=19----Counting Sundays

You are given the following information, but you may prefer to do some research for yourself.1 Jan 1900 was a Monday.Thirty days has September,April, June and November.All the rest have thirty

2014-06-05 07:55:42 1107

原创 projecteuler---->problem=18----Maximum path sum I

By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.37 42 4 68 5 9 3That is, 3 + 7 + 4 + 9 = 23.Find th

2014-06-04 22:48:16 1185

原创 projecteuler---->problem=15----Lattice paths

Starting in the top left corner of a 22 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.How many such routes are there through a 20

2014-06-03 16:43:24 1213 1

原创 projecteuler---->problem=16----Power digit sum

215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.What is the sum of the digits of the number 21000?翻译:215 = 32768的各位数之和为3 + 2 + 7 + 6 + 8 = 26。那么21000的各位数之和为……?import

2014-06-03 15:47:31 1122

原创 projecteuler---->problem=14----Longest Collatz sequence

title:The following iterative sequence is defined for the set of positive integers:n n/2 (n is even)n 3n + 1 (n is odd)Using the rule above and starting with 13, we generate the followi

2014-06-03 10:16:43 1274

用JAVA语言处理AutoCAD图形数据的研究

用JAVA语言处理AutoCAD图形数据的研究

2013-12-24

java俄罗斯方块初级版

java俄罗斯方块初级版 多多交流,希望大家多多发现bug

2013-05-08

深入解析SQL Server 2008

深入解析SQL Server 2008 的第二部分

2013-04-19

深入解析SQL Server 2008.part1

深入解析SQL Server 2008 数据库中的巨作,你懂的! 这个文件要两个压缩文件

2013-04-19

数据库系统实现

里面描写的是数据库底层的操作和实现,对于想深入了解数据库的人来说,这本书会是一个很大的帮助!

2013-04-01

java api 中文版 chm 格式

java api 中文版 chm 格式 javase 的api 查询文档,.chm格式,使用与window 操作系统

2012-12-20

java 关键字查询文档

java 的关键字查询文档以网页的形式来模仿API力图实现方便,快捷,详细于一体!

2012-10-07

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除