glossary.qbk 5.5 KB

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