1[/ 2 / Copyright (c) 2008 Eric Niebler 3 / 4 / Distributed under the Boost Software License, Version 1.0. (See accompanying 5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 /] 7 8[/===============] 9[section Glossary] 10[/===============] 11 12[def _T_ [~T]] 13 14[template anchor[x] '''<anchor id="boost_proto.users_guide.glossary.'''[x]'''" />'''] 15 16[variablelist 17 [ [ [anchor callable_transform] callable transform] 18 [A transform of the form `R(A0,A1,...)` (i.e., a function type) where 19 `proto::is_callable<R>::value` is `true`. `R` is treated as a polymorphic 20 function object and the arguments are treated as transforms that yield the 21 arguments to the function object.] ] 22 [ [ [anchor context] context] 23 [In Proto, the term /context/ refers to an object that can be passed, along 24 with an expression to evaluate, to the `proto::eval()` function. The context 25 determines how the expression is evaluated. All context structs define a 26 nested `eval<>` template that, when instantiated with a node tag type (e.g., 27 `proto::tag::plus`), is a binary polymorphic function object that accepts an 28 expression of that type and the context object. In this way, contexts 29 associate behaviors with expression nodes.] ] 30 [ [ [anchor domain] domain] 31 [In Proto, the term /domain/ refers to a type that associates expressions 32 within that domain with a /generator/ for that domain and optionally a 33 /grammar/ for the domain. Domains are used primarily to imbue expressions 34 within that domain with additional members and to restrict Proto's operator 35 overloads such that expressions not conforming to the domain's grammar are 36 never created. Domains are empty structs that inherit from 37 `proto::domain<>`.]] 38 [ [ [anchor dsl] domain-specific language] 39 [A programming language that targets a particular problem space by providing 40 programming idioms, abstractions and constructs that match the constructs 41 within that problem space.]] 42 [ [ [anchor edsl] embedded domain-specific language] 43 [A domain-specific language implemented as a library. The language in which 44 the library is written is called the "host" language, and the language 45 implemented by the library is called the "embedded" language.]] 46 [ [ [anchor expression] expression] 47 [In Proto, an /expression/ is a heterogeneous tree where each node is either 48 an instantiation of `boost::proto::expr<>`, `boost::proto::basic_expr<>` or 49 some type that is an extension (via `boost::proto::extends<>` or 50 `BOOST_PROTO_EXTENDS()`) of such an instantiation.]] 51 [ [ [anchor expression_template] expression template] 52 [A C++ technique using templates and operator overloading to cause 53 expressions to build trees that represent the expression for lazy evaluation 54 later, rather than evaluating the expression eagerly. Some C++ libraries use 55 expression templates to build embedded domain-specific languages.]] 56 [ [ [anchor generator] generator] 57 [In Proto, a /generator/ is a unary polymorphic function object that you 58 specify when defining a /domain/. After constructing a new expression, Proto 59 passes the expression to your domain's generator for further processing. 60 Often, the generator wraps the expression in an extension wrapper that adds 61 additional members to it.]] 62 [ [ [anchor grammar] grammar] 63 [In Proto, a /grammar/ is a type that describes a subset of Proto expression 64 types. Expressions in a domain must conform to that domain's grammar. The 65 `proto::matches<>` metafunction evaluates whether an expression type matches 66 a grammar. Grammars are either primitives such as `proto::_`, composites 67 such as `proto::plus<>`, control structures such as `proto::or_<>`, or some 68 type derived from a grammar.]] 69 [ [ [anchor object_transform] object transform] 70 [A transform of the form `R(A0,A1,...)` (i.e., a function type) where 71 `proto::is_callable<R>::value` is `false`. `R` is treated as the type of an 72 object to construct and the arguments are treated as transforms that yield 73 the parameters to the constructor.]] 74 [ [ [anchor polymorphic_function_object] polymorphic function object] 75 [An instance of a class type with an overloaded function call operator and a 76 nested `result_type` typedef or `result<>` template for calculating the 77 return type of the function call operator.]] 78 [ [ [anchor primitive_transform] primitive transform] 79 [A type that defines a kind of polymorphic function object that takes three 80 arguments: expression, state, and data. Primitive transforms can be used to 81 compose callable transforms and object transforms.]] 82 [ [ [anchor subdomain] sub-domain] 83 [A sub-domain is a domain that declares another domain as its super-domain. 84 Expressions in sub-domains can be combined with expressions in the 85 super-domain, and the resulting expression is in the super-domain.]] 86 [ [ [anchor transform] transform] 87 [Transforms are used to manipulate expression trees. They come in three 88 flavors: primitive transforms, callable transforms, or object transforms. A 89 transform `_T_` can be made into a ternary polymorphic function object with 90 `proto::when<>`, as in `proto::when<proto::_, _T_>`. Such a function object 91 accepts /expression/, /state/, and /data/ parameters, and computes a result 92 from them.]] 93] 94 95[endsect] 96