上下文无关文法(Context-Free Grammar, CFG)是一个4元组G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一组有限的产生式规则集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素称为非终结符,T的元素称为终结符,S是一个特殊的非终结符,称为文法开始符。 设G=(V, T, S, P)是一个CFG,则G产生的语言是所有可由G产生的字符串组成的集合,即L(G)={x∈T* | Sx}。一个语言L是上下文无关语言(Context-Free Language, CFL),当且仅当存在一个CFG G,使得L=L(G)。 *⇒ 例如,设文法G:S→AB A→aA|a B→bB|b 则L(G)={a^nb^m | n,m>=1} 其中非终结符都是大写字母,开始符都是S,终结符都是小写字母。
标签: Context-Free Grammar CFG
上传时间: 2013-12-10
上传用户:gaojiao1999
第一章涵盖了内建的数据型别,语言预先定义好的运算符、标准程序库中那个的vector和string类、条件语句和循环语句、输入和输出用的iostream库。第二章解释函数的设计和使用;第三章涵盖所谓的Standard Template Library;第四章讲述classes机制的设计和使用过程。第五章说明如何扩展classes;第六章的重头戏是class templates 第七章讲述如何使用c++提供的异常处理机制。
标签: 数据
上传时间: 2014-02-20
上传用户:zyt
This book is the most accurate and up-to-date source of information the STL currently available. ... It has an approach and appeal of its own: it explains techniques for building data structures and algorithms on top of the STL, and in this way appreciates the STL for what it is - a framework. Angelika Langer, Independent Consultant and C++ Report Columnist "A superbly authored treatment of the STL......an excellent book which belongs in any serious C++ developer s library." Jim Armstrong, President 2112 F/X, Texas. \n The C++ Standard Template Library (STL) represents a breakthrough in C++ programming techniques. With it, software developers can achieve vast improvements in the reliability of their software, and increase their own productivity.
标签: information up-to-date available currently
上传时间: 2015-10-31
上传用户:CHINA526
本书由知名的C++专家Matthew H.Austern执笔,引导你进入泛型编程思维模型,并将你带往此一模型的最重要成品:C++ Standard Template Library(STL)。本书揭示STL的奥秘,告诉你STL不仅仅是一组方便运用的容器类(container classes)。对于泛型组件和可交互作用的组件而言,STL是一个具备扩充能力的框架(framework)、 《泛型编程与STL》阐述了泛型编程的中心思想:concepts、modeling、refinement,并为你展示这些思想如何导出STL的基础概念:iterators、containers、function objects。循此路线,你可以把STL想像为一个由concepts(而非明确之functions或classes)组成的程序库:、你将学习其正式结构并因此获得其潜在威力所带来的完整优势。本书使你能够: ●以你自己的“可移植组件”及“可交互作用之泛型组件”扩充STL; ●产生一些算法,让它们和它们所处理之型别(types)及数据结构彻底划清界线; ●撰写更精致、更高效、更有效力的代码,可跨平台重复使用。
上传时间: 2014-01-06
上传用户:Avoid98
一:需求分析 1. 问题描述 魔王总是使用自己的一种非常精练而抽象的语言讲话,没人能听懂,但他的语言是可逐步解释成人能听懂的语言,因为他的语言是由以下两种形式的规则由人的语言逐步抽象上去的: ----------------------------------------------------------- (1) a---> (B1)(B2)....(Bm) (2)[(op1)(p2)...(pn)]---->[o(pn)][o(p(n-1))].....[o(p1)o] ----------------------------------------------------------- 在这两种形式中,从左到右均表示解释.试写一个魔王语言的解释系统,把 他的话解释成人能听得懂的话. 2. 基本要求: 用下述两条具体规则和上述规则形式(2)实现.设大写字母表示魔王语言的词汇 小写字母表示人的语言的词汇 希腊字母表示可以用大写字母或小写字母代换的变量.魔王语言可含人的词汇. (1) B --> tAdA (2) A --> sae 3. 测试数据: B(ehnxgz)B 解释成 tsaedsaeezegexenehetsaedsae若将小写字母与汉字建立下表所示的对应关系,则魔王说的话是:"天上一只鹅地上一只鹅鹅追鹅赶鹅下鹅蛋鹅恨鹅天上一只鹅地上一只鹅". | t | d | s | a | e | z | g | x | n | h | | 天 | 地 | 上 | 一只| 鹅 | 追 | 赶 | 下 | 蛋 | 恨 |
上传时间: 2014-12-02
上传用户:jkhjkh1982
We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
标签: represented integers group items
上传时间: 2016-01-17
上传用户:jeffery
《C++标准程序库》本书不仅对每一个程序库组件提供范围广泛的说明,也对繁复的观念提供清楚明亮的解释,并描述高效运用这些组件时需要的实际编程细节,提出一个又一个的范例程序。本书是一本包含最新资料的完整书籍。反映出被ANSI/ISO C++语言标准规格书纳入C++标准程序库的最新组成。更明确地说,本书将焦点放在标准模板库(Standard Template Library)身上,检验其中的容器(containers)
上传时间: 2016-02-27
上传用户:qiaoyue
JavaServer Pages, Third Edition is completely revised and updated to cover the substantial changes in the 2.0 version of the JSP specification. It also includes detailed coverage of the major revisions to the JSP Standard Tag Library (JSTL) specification. Combining plenty of practical advice with detailed coverage of JSP syntax and features and clear, useful examples, JavaServer Pages, Third Edition demonstrates how to embed server-side Java into Web pages, while also covering important topics such as JavaBeans, Enterprise JavaBeans (EJB), and JDBC database access.
标签: substantial JavaServer completely Edition
上传时间: 2014-01-04
上传用户:mpquest
CppReference 对于c/c++的详尽说明 C/C++ Reference General C/C++ Pre-processor commands Operator Precedence Escape Sequences ASCII Chart Data Types Keywords Standard C Library Standard C I/O Standard C String & Character Standard C Math Standard C Time & Date Standard C Memory Other standard C functions All C Functions C++ C++ I/O C++ Strings C++ String Streams Miscellaneous C++ C++ Standard Template Library C++ Algorithms C++ Vectors C++ Double-Ended Queues C++ Lists C++ Priority Queues C++ Queues C++ Stacks C++ Sets C++ Multisets C++ Maps C++ Multimaps C++ Bitsets Iterators All C++ Functions
标签: Pre-processor CppReference Reference Operator
上传时间: 2016-10-26
上传用户:aeiouetla
C++ 标准程序库提供一组通用类别(classes)和接口(interfaces),可大幅扩充 C++ 核心语言。由于程序库本身并不容易,为了完整运用其组件并从其强大的威力中获得帮助,你需要一份完善的资源,而非一份仅仅陈列类和函数的普通文档。《The C++ Standard Library》不仅对每一个程序库组件提供范围广泛的说明,也对繁杂的感念提供清楚明亮的解释,并描述高效运用这些组件时需要的实际编程细节,提出一个又一个的范例程序。这本包含最新资料的完整书籍,反映出被 ANSI/ISO C++ 语言标准规格书纳入的 C++ 标准程序库的结构。更明确地说,本书将焦点放在标准模板库(Standard Template Library)身上,检验其中的容器(containers)、迭代器(iterators)、仿函数(functors)和算法(algorithms)。你还可以找到特殊容器、字符串(strings)、数值类别、国际化议题、IOStream。每一个组件都有深刻的呈现,包括其介绍、设计、运用实例、细部解说、陷阱、意想不到的危险,以及相关类别和函数的确切标记(signature)和定义。一份见解深刻的基础概念介绍和一个程序库综合鸟瞰,会对新手带来快速的提升。
标签: interfaces classes 标准 接口
上传时间: 2017-02-10
上传用户:天涯