{{sellerTotalView > 1 ? __("sellers", {number: sellerTotalView}) : __("seller", {number: sellerTotalView}) }}, {{numTotalView > 1 ? __("items", {number: numTotalView}) : __("item", {number: numTotalView}) }}
free FREE

Change Your Zip Code

Inventory information and delivery speeds may vary for different locations.

Location History

{{email ? __('Got it!') : __('Restock Alert')}}

We will notify you by email when the item back in stock.

Cancel
Yami

Jingdong book

两周自制脚本语言

{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}

两周自制脚本语言

{{__(":people-members", {'people': item.limit_people_count})}} {{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ item.invalid_price }} {{ itemDiscount }}
Ends in
{{ itemCurrency }}{{ item.valid_price }}
{{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }}
{{ itemDiscount }}
{{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }} {{ itemCurrency }}{{ item.invalid_price }} {{itemDiscount}}
{{ itemCurrency }}{{ item.valid_price }}
Sale ends in
Sale will starts after Sale ends in
{{ getSeckillDesc(item.seckill_data) }}
{{ __( "Pay with Gift Card to get sale price: :itemCurrency:price", { 'itemCurrency' : itemCurrency, 'price' : (item.giftcard_price ? priceFormat(item.giftcard_price) : '0.00') } ) }} ({{ itemCurrency }}{{ priceFormat(item.giftcard_price / item.bundle_specification) }}/{{ item.unit }}) Details
Best before

Currently unavailable.

We don't know when or if this item will be back in stock.

Unavailable in your area.
Sold Out

Details

Full product details
Editer Recommend

只需14天,从零开始设计和实现脚本语言

从解释器到编译器,支持函数、数组、对象等高级功能

东京大学&东京工业大学教授执笔

日本编译器专家中田育男作序推荐

Content Description

《两周自制脚本语言》是一本优秀的编译原理入门读物。全书穿插了大量轻松风趣的对话,读者可以随书中的人物一起从最简单的语言解释器开始,逐步添加新功能,最终完成一个支持函数、数组、对象等高级功能的语言编译器。《两周自制脚本语言》与众不同的实现方式不仅大幅简化了语言处理器的复杂度,还有助于拓展读者的视野。
《两周自制脚本语言》适合对编译原理及语言处理器设计有兴趣的读者以及正在学习相关课程的大中专院校学生。同时,已经学习过相关知识,有一定经验的开发者,也一定能从本书新颖的实现方式中受益良多。
Author Description

千叶滋

东京工业大学研究生院信息技术理工系研究科教授,兼任东京大学研究生院信息技术理工系研究科教授。著有《面向切面入门——从Java语言・面向对象步入AspectJ语言程序设计》《简明Java程序设计——Great Ideas for Java Programming》《GUI库机制——软件设计案例研习》等。

Comments

这是一本优秀的编译原理入门读物,它尝试以一种现代的方式设计一种现代的语言,即使读者对编译器已有一定程度的了解,也一定能从中学到很多。——日本编译器权威专家 中田育男

Catalogue

目录

第1部分基础篇

第1天来,我们一起做些什么吧1
1.1机器语言与汇编语言2
1.2解释器与编译器3
1.3开发语言处理器5
1.4语言处理器的结构与本书的框架6

第2天设计程序设计语言10
2.1麻雀虽小、五脏俱全的程序设计语言11
2.2句尾的分号12
2.3含糊不得的语言14

第3天分割单词17
3.1Token对象18
3.2通过正则表达式定义单词19
3.3借助java.util.regex设计词法分析器22
3.4词法分析器试运行27

第4天用于表示程序的对象30
4.1抽象语法树的定义31
4.2设计节点类34
4.3BNF38
4.4语法分析与抽象语法树42

第5天设计语法分析器44
5.1Stone语言的语法45
5.2使用解析器与组合子46
5.3由语法分析器生成的抽象语法树53
5.4测试语法分析器59

第6天通过解释器执行程序62
6.1eval方法与环境对象63
6.2各种类型的eval方法65
6.3关于GluonJ69
6.4执行程序72

第7天添加函数功能75
7.1扩充语法规则76
7.2作用域与生存周期81
7.3执行函数83
7.4计算斐波那契数89
7.5为闭包提供支持90
7.6实现闭包92

第8天关联Java语言95
8.1原生函数96
8.2编写使用原生函数的程序98

第9天设计面向对象语言101
9.1设计用于操作类与对象的语法102
9.2实现类所需的语法规则103
9.3实现eval方法104
9.4通过闭包表示对象110
9.5运行包含类的程序114

第10天无法割舍的数组115
10.1扩展语法分析器116
10.2仅通过修改器来实现数组119

第2部分性能优化篇

第11天优化变量读写性能123
11.1通过简单数组来实现环境124
11.2用于记录全局变量的环境127
11.3事先确定变量值的存放位置130
11.4修正eval方法并最终完成性能优化134

第12天优化对象操作性能137
12.1减少内存占用138
12.2能否通过事先查找变量的保存位置来优化性能141
12.3定义lookup方法144
12.4整合所有修改并执行147
12.5内联缓存152

第13天设计中间代码解释器156
13.1中间代码与机器语言157
13.2Stone虚拟机158
13.3通过栈实现环境167
13.4寄存器的使用170
13.5引用变量的值173
13.6if语句与while语句173
13.7函数的定义与调用175
13.8转换为虚拟机器语言177
13.9通过虚拟机执行184

第14天为Stone语言添加静态类型支持以优化性能187
14.1指定变量类型188
14.2通过数据类型检查发现错误193
14.3运行程序时执行类型检查204
14.4对类型省略的变量进行类型推论208
14.5Java二进制代码转换214
14.6综合所有修改再次运行程序226

第3部分解说篇(自习时间)

第15天手工设计词法分析器229
15.1修改自动机230
15.2自动机程序233
15.3正则表达式的极限235

第16天语法分析方式236
16.1正则表达式与BNF237
16.2语法分析算法238
16.3LL语法分析239
16.4算符优先分析法与自底向上语法分析244

第17天Parser库的内部结构251
17.1组合子分析252
17.2解析器组合子的内部252

第18天GluonJ的使用方法263
18.1设定类路径264
18.2启动设定265
18.3GluonJ语言267
18.4功能总结268

第19天抽象语法树与设计模式271
19.1理想的设计272
19.2Interpreter模式273
19.3Visitor模式276
19.4使用反射282
19.5面向切面语言284
Introduction

本书是一本编译原理的入门读物。过去,大家普遍认为编译器与解释器之间存在很大的差异,因此会分别编写针对编译器与解释器的图书。不过,最近编译器与解释器之间的界限越来越模糊,我们只要稍微了解一下常见的程序设计语言,就会发现两者已不再是对立的概念。




因此,与其说本书是编译原理的入门书,不如说是语言处理器的入门读物更为恰当。语言处理器是用于执行程序设计语言的软件,它同时包含了编译器与解释器。本书看似用了大量篇幅讲解解释器的原理,其实是在讲解编译器与解释器通用的理论。第1 章将详细介绍各章节的具体内容。




本书采用了Java 语言来实现语言处理器。在设计语言处理器时,C 语言或C++ 语言更为常见,加之本书没有借助yacc 等常用的工具来生成语言处理器,因此读者也许会认为本书的实用性不足。


本书在介绍语言处理器的设计方式时,尽可能采用了较新颖的手段。C 语言或C++ 语言结合yacc 的方式性能较差,且是上世纪80 年代的实现方式。在那之后,程序设计语言飞速发展,已不可同日而语,其运行性能也大幅提升。入门读物也应该与时俱进,讲解与过去不同的设计方式,展现它们的实践价值。




时至今日,软件领域的发展依然日新月异,并逐渐渗透至生活的方方面面,这一势头无疑将持续下去。在此期间,各类技术必将不断发展,为了跟上技术更新的步伐,软件应当以略微领先于时代的设计思路开发。




很久以前,笔者曾使用C++ 语言开发过适用于工作站的语言处理器,当时,时钟频率仅有100 兆赫,内存也不过几百兆字节。那套软件幸运地在各种环境下运行了十年以上。有一天,我收到了一封邮件。我记得好像是一个德国的年轻人,他洋洋洒洒写了很多,批评那套软件的设计有不少问题。还说开发者应当合理使用模板,并灵活运用各种库,要学习使用设计模式,还要用XML 来表示抽象语法树,等等。




他指出我太节省内存,只顾着提升性能,结果程序难以阅读。从当时的主流软硬件标准来看,这些批评确实合情合理,但那套系统毕竟是十年前的产物。在当时软硬件性能孱弱的情况下,如果遵循他的建议,最终完成的语言处理器恐怕会被打上缺乏使用价值的标签(顺便一提,提出批评的那位年轻人虽然说了很多,却没有写一行代码)。




然而,从这件事中我深刻体会到,软件有着惊人的生命力,即使在开发时采用了最佳设计,最终还是会随着时代的进步而被迅速淘汰。因此,前文说软件应当以略微领先于时代的设计思路开发有其合理性。当然,我们也可以不关心他人的批评,尽可能缩短软件的生命周期,并积极抛弃过时的内容。具体采用哪种策略因人而异。


希望读者能够在阅读本书时始终记住这些理念。读过本书之后,如果大家觉得收获良多,我将深感荣幸与喜悦。




2012 年 新春


千叶滋

Specifications

Brand Jingdong book
Brand Origin China

Disclaimer

Product packaging, specifications and price are subject to change without notice. All information about the products on our website is provided for information purposes only. Please always read labels, warnings and directions provided with the product before use.

View Full Terms of Use
Add to favorites
{{ $isZh ? coupon.coupon_name_sub : coupon.coupon_ename_sub | formatCurrency }}
{{__("Buy Directly")}} {{ itemCurrency }}{{ item.directly_price }}
Quantity
{{ quantity }}
{{ instockMsg }}
{{ limitText }}
{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}
Sold by JD@CHINA
Ship to
{{ __("Ship to United States only") }}
Free shipping over 69
Genuine guarantee

Added to Cart

Keep Shopping

More to Consider

{{ item.brand_name }}

{{ item.item_name }}

{{ item.currency }}{{ item.market_price }}

{{ item.currency }}{{ item.unit_price }}

{{ item.currency }}{{ item.unit_price }}

Coupons

{{ coupon.coupon_name_new | formatCurrency }}
Clip Clipped Over
{{ getCouponDescStr(coupon) }}
{{ coupon.use_time_desc }}
Expires soon {{ formatTime(coupon.use_end_time) }}

Share this item with friends

Cancel

Yami Gift Card

Get this exclusive deal when paying with gift card

Terms and Conditions

Gift card deals are special offers for selected products;

The gift card deals will automatically be activated if a customer uses gift card balance at check out and the balance is sufficient to pay for the total price of the shopping cart products with gift card deals;

You will not be able to activate the gift card deals if you choose other payment methods besides gift card. The products will be purchased at their normal prices;

If your account balance is not enough to pay for the products with gift card deals, you can choose to reload your gift card balance by clicking on the Reload button at either shopping cart page or check out page;

Products that have gift card deals can be recognized by a special symbol showing 'GC Deal';

For any additional questions or concerns, please contact our customer service;

Yamibuy reserves the right of final interpretation.

Sold by Yami

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

Yami is committed to provide our customers with a peace of mind when purchasing from us. Most items shipped from Yamibuy.com can be returned within 30 days of receipt of shipment (For Food, Beverages, Snacks, Dry Goods, Health supplements, Fresh Grocery and Perishables Goods, within 7 days of receipt of shipment due to damages or quality issues; To ensure that every customer receives safe and high-quality products, we do not provide refunds or returns for beauty products once they have been opened or used, except in the case of quality issues; Some products may have different policies or requirements associated with them, please see below for products under special categories, or contact Yami Customer Service for further assistance).
Thank you for your understanding and support.

Learn More

Sold by Yami

Terms and Conditions of Yami E-Gift Card

If you choose “Redeem automatically” as your delivery method, your gift card balance will be reload automatically after your order has been processed successfully;

If you choose “Send to Email”as your delivery method, the card number and CVV will be sent to the email address automatically;

Any user can use the card number and CVV to redeem the gift card, please keep your gift card information safely. If you have any trouble receiving email, please contact Yami customer service;

Yami gift card can be used to purchase both Yami owned or Marketplace products;

Yami gift card will never expire;

Yami gift card balance does not have to be used up at once;

All rights reserved by Yami.

Return Policy

Gift card that has already been consumed is non-refundable.

Sold by JD@CHINA

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Sold by JD@CHINA

Service Guarantee

Yami Cross-store Free Shipping over $69
Yami 30-days Return

Yami-China FC

Yami has a consolidation warehouse in China which collects multiple sellers’ packages and combines to one order. Our Yami consolidation warehouse will directly ship the packages to your door. Cross-store free shipping over $69.

Return Policy

You may return products within 30 days upon receiving the products. Sellers take responsibilities for any wrong shipment or missing items. Packing needs to be unopened for any other than quality issues return. We promise to pack carefully, but because goods are taking long journey to destinations, simple damages to packaging may occur. Any damages not causing internal goods quality problems are not allowed to return. If you open the package and any quality problem is found, please contact customer service within three days after receipt of goods.

Shipping Information

Yami Consolidation Service Shipping Fee $9.99(Free shipping over $69)

Sellers in China will ship their orders within 1-2 business days once the order is placed. Packages are sent to our consolidation warehouse in China and combined there. Our Yami consolidation warehouse will directly ship the packages to you via UPS. The average time for UPS to ship from China to the United States is about 10 working days and it can be traced using the tracking number. Due to the pandemic, the delivery time may be delayed by about 5 days. The package needs to be signed by the guest. If the receipt is not signed, the customer shall bear the risk of loss of the package.

Sold by JD@CHINA

Service Guarantee

Free shipping over 69
Genuine guarantee

Shipping

Yami Consolidated Shipping $9.99(Free shipping over $69)


Seller will ship the orders within 1-2 business days. The logistics time limit is expected to be 7-15 working days. In case of customs clearance, the delivery time will be extended by 3-7 days. The final receipt date is subject to the information of the postal company.

Yami Points information

All items are excluding from any promotion or points events on Yamibuy.com

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Yami

Download the Yami App

Back Top

Recommended for You

About the brand

Jingdong book

为您推荐

Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折

Reviews{{'('+ commentList.posts_count + ')'}}

Have your say. Be the first to help other guests.

Write a review
{{ totalRating }} Write a review
  • {{i}} star

    {{i}} stars

    {{ parseInt(commentRatingList[i]) }}%

Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}
Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}

No related comment~

Review

Yami Yami

{{ showTranslate(commentDetails) }}Show Less

{{ strLimit(commentDetails,800) }}Show more

Show Original

{{ commentDetails.content }}

Yami
Show All

{{ formatTime(commentDetails.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ commentDetails.likes_count }} {{ commentDetails.likes_count }} {{ commentDetails.reply_count }} {{commentDetails.in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Comments{{'(' + replyList.length + ')'}}

Yami Yami

{{ showTranslate(reply) }}Show Less

{{ strLimit(reply,800) }}Show more

Show Original

{{ reply.reply_content }}

{{ formatTime(reply.reply_in_dtm) }}

{{ reply.reply_likes_count }} {{ reply.reply_likes_count }} {{ reply.reply_reply_count }} {{reply.reply_in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Cancel

That’s all the comments so far!

Write a review
How would you rate this item?

Please add your comment.

  • A nice nickname will make your comments more popular!
  • The nickname in your account will be changed to the same as here.
Thanks for your review
Our community rely on great reviews like yours to find the best of Asia.

Report

If you find this content inappropriate and think it should be removed from the Yami.com site, let us know please.

Cancel

Are you sure to delete your review?

Cancel

You’ve Recently Viewed

About the brand

Jingdong book