html5-img
1 / 13

Tool Command Language

Tool Command Language. -- 11 级 ACM 班 金 天行. TCL(Tool Command Language) : 由 John K.Ousterhout 创建的一种脚本语言。 用途: TCL 经常被 用于快速 原型 开发 , 脚本 编程, GUI 和测试等方面。 解释器:一个 C 函数库。 语言特点: 弱类型 , 万物皆 字符串 语法 ? 不 支持面向对象. 赋值语句 -set varName ? newValue ? 表达式 - expr arg ? arg ...?. 控制语句

amos
Download Presentation

Tool Command Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tool Command Language --11级ACM班 金天行

  2. TCL(Tool Command Language):由John K.Ousterhout创建的一种脚本语言。 • 用途:TCL经常被用于快速原型开发,脚本编程, GUI和测试等方面。 • 解释器:一个C函数库。 • 语言特点: • 弱类型,万物皆字符串 • 语法? • 不支持面向对象

  3. 赋值语句 -set varName ?newValue? • 表达式 -exprarg ?arg ...?

  4. 控制语句 • If 语句 -if test command • Switch 语句 -switch ?switches? string pattern body ... ?default body?

  5. 函数(过程)-procname args body

  6. Lambda 表达式 -args command

  7. 循环语句 • for start test next command • while test command • foreach list item command

  8. Eval语句-evalarg ?arg...?

  9. 列表 • 数组(映射表map)

  10. 字符串 • 支持字符串的各种基本操作 • 支持正则表达式进行模式匹配(替换) • 支持字符串Unicode的转换 • 保留字符 • 以\开头的各种不可见字符 • 数学逻辑运算符如+-=&等 • 括号()[]{}, 和替换符$

  11. 优点: • 语法规则相当简单,易于学习,易于实现 • 功能强大,使程序员的工作量大大减少。 • 任何事物都可以重新定义和重载。 • 跨平台,完全的unicode支持 • 很容易用C、C++或JAVA扩展。 • 缺点: • 没有数据类型,计算速度慢 • 结构不美,不好看,查错很难 • 扩展工具:面向对象的TCL,TK图形接口,TEA,Expect等

  12. Reference: • 《TCL/TK 入门经典》 John K.Ousterhout, Ken Jones 著, 清华大学出版社 • Wikipedia • 百度百科

  13. The End Thank You

More Related