preface.qbk
来自「Boost provides free peer-reviewed portab」· QBK 代码 · 共 75 行
QBK
75 行
[/ / Copyright (c) 2008 Eric Niebler / / Distributed under the Boost Software License, Version 1.0. (See accompanying / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) /][section Preface][:["There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy.]][:[*['-- William Shakespeare]]][heading Description]Proto is a framework for building Domain Specific Embedded Languagesin C++. It provides tools for constructing, type-checking, transforming andexecuting ['expression templates][footnote See[@http://www.osl.iu.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html Expression Templates]].More specifically, Proto provides:* An expression tree data structure.* Operator overloads for building the tree from an expression.* Utilities for defining the grammar to which an expression must conform.* An extensible mechanism for immediately executing an expression template.* An extensible set of tree transformations to apply to expression trees.* A mechanism for giving expressions additional behaviors and members.[heading Motivation]Expression Templates are an advanced technique that C++ library developers useto define embedded mini-languages that target specific problem domains. Thetechnique has been used to create hyper-efficient and easy-to-use librariesfor linear algebra as well as to define C++ parser generators with a readablesyntax. But developing such a library involves writing an inordinate amount ofunreadable and unmaintainable template mumbo-jumbo. Boost.Proto eases thedevelopment of domain-specific embedded languages (DSELs). Use Proto to definethe primitives of your mini-language and let Proto handle the operatoroverloading and the construction of the expression parse tree. Immediatelyevaluate the expression tree by passing it a function object. Or transform theexpression tree by defining the grammar of your mini-language, decoratedwith an assortment of tree transforms provided by Proto or defined by you.Then use the grammar to give your users short and readable syntax errorsfor invalid expressions! No more mumbo-jumbo -- an expression template librarydeveloped with Proto is declarative and readable.In short, Proto is a DSEL for defining DSELs.[heading Influences and Related Work]Proto was initially developed as part of _xpressive_ to simplify the job oftransforming an expression template into an executable finite state machinecapable of matching a regular expression. Since then, Proto has foundapplication in the redesigned and improved Spirit-2 and the related Karmalibrary, currently under development. As a result of these efforts, Protoevolved into a generic and abstract grammar and tree transformationframework applicable in a wide variety of DSEL scenarios.The grammar and tree transformation framework is modelled on Spirit'sgrammar and semantic action framework. The expression tree data structureis similar to Fusion data structures in many respects, and is interoperablewith Fusion's iterators and algorithms.The syntax for the grammar-matching features of `proto::matches<>` is inspiredby MPL's lambda expressions, and by Aleksey Gurtovoy's [@http://lists.boost.org/Archives/boost/2002/11/39718.php "round" lambda] notation.[heading Further Reading]A technical paper about an earlier version of Proto was accepted into the [@http://lcsd.cs.tamu.edu/2007/ ACM SIGPLAN Symposium on Library-Centric Software Design LCSD'07],and can be found at [@http://lcsd.cs.tamu.edu/2007/final/1/1_Paper.pdf]. Thetree transforms described in that paper differ from what exists today.[endsect]
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?