diff --git a/doc/change_error_message.qbk b/doc/change_error_message.qbk index ceeb0ed..c92b941 100644 --- a/doc/change_error_message.qbk +++ b/doc/change_error_message.qbk @@ -18,7 +18,7 @@ This is a [link parser_combinator parser combinator]. It applies `P` on the input. When `P` succeeds, `change_error_message` returns the result `P` returns, otherwise `change_error_message` rejects the input and -the reson will be `Msg`. +the reason will be `Msg`. [h1 Header] diff --git a/doc/design.qbk b/doc/design.qbk index 6885a63..a3135ca 100644 --- a/doc/design.qbk +++ b/doc/design.qbk @@ -31,8 +31,8 @@ The key components of the library: * [*Why template metaprogramming?] An alternative is using `constexpr` functions instead of template metaprograms. -There are ceratin things that are difficult (if possible) using `constexpr` -functions: building containers (at compile-time) the lenght of which depend on +There are certain things that are difficult (if possible) using `constexpr` +functions: building containers (at compile-time) the length of which depend on the parsed text (eg. parsing a JSON list), generating and validating types (eg. `printf`). diff --git a/doc/getting_started.qbk b/doc/getting_started.qbk index 4da9c45..a4b68fe 100644 --- a/doc/getting_started.qbk +++ b/doc/getting_started.qbk @@ -25,7 +25,7 @@ For example, you can start Metashell with the following arguments: $ metashell -I$BOOST_ROOT -I$BOOST_ROOT/libs/metaparse/example/getting_started -`$BOOST_ROOT` refers to the the ['boost root directory] (where you have checked +`$BOOST_ROOT` refers to the ['boost root directory] (where you have checked out the Boost source code). This tutorial is long and therefore you might want to make shorter or longer @@ -40,7 +40,7 @@ section. [note You have access to these headers in the online Metashell demo as well. For -example you can include the `` +example you can include the `` header to start from section 5.2.1. ] @@ -1541,7 +1541,7 @@ Our calculator language provides no direct support for negative numbers. To get a negative number, we need to do a subtraction. For example to get the number `-13` we need to evaluate the expression `0 - 13`. -We will implement `-` as an unary operator. Therefore the expression `-13` won't +We will implement `-` as a unary operator. Therefore the expression `-13` won't be a ['negative number]. It will be the unary `-` operator applied on the number `13`. @@ -1900,7 +1900,7 @@ before: [link getting_started_37 copy-paste friendly version] -We can can try to give our new parser an invalid input: +We can try to give our new parser an invalid input: > exp_parser20::apply::type << compilation error >> diff --git a/doc/manual.qbk b/doc/manual.qbk index 6fbc6d9..29de397 100644 --- a/doc/manual.qbk +++ b/doc/manual.qbk @@ -202,7 +202,7 @@ the parser [link repeated `repeated`]``) one by one. Note that [link transform `transform`] wraps another parser, [link repeated `repeated`]`` here. It parses the input with that parser, gets the result of that parsing and changes that result. - [link transform `transfrom`] itself will be a parser returning that updated + [link transform `transform`] itself will be a parser returning that updated result. ] @@ -210,7 +210,7 @@ the parser [link repeated `repeated`]``) one by one. [section Introducing foldl] It works, however, this is rather inefficient: it has a loop parsing the -integers one by one, building a typlist and then it loops over this typelist to +integers one by one, building a typelist and then it loops over this typelist to summarise the result. Using template metaprograms in your applications can have a serious impact on the compiler's memory usage and the speed of the compilation, therefore I recommend being careful with these things. @@ -241,7 +241,7 @@ input: As you can see, not only the implementation of the parser is more compact, but it achieves the same result by doing less as well. It parses the input by applying `int_token` repeatedly, just like the previous solution. But it -produces the final result without buliding a typelist as an internal step. Here +produces the final result without building a typelist as an internal step. Here is how it works internally: [$images/metaparse/foldl_diag2.png [width 70%]] @@ -416,7 +416,7 @@ following input for example: BOOST_METAPARSE_STRING("11 + 13 + 3 + 21 +") -This is an ivalid expression. However, if we parse it using the +This is an invalid expression. However, if we parse it using the [link foldl_start_with_parser `foldl_start_with_parser`]-based parser presented earlier (`sum_parser3`), it accepts the input and the result is `48`. This is because [link foldl_start_with_parser `foldl_start_with_parser`] parses the @@ -498,7 +498,7 @@ at compile-time. Here is a list of things that can be the "result" of parsing: `regex` example of Metaparse for an example. * A C++ ['function], which might be called at runtime. A C++ function can be generated that can be called at runtime. It is good for generating native - (and optimisied) code from EDSLs. See the `compile_to_native_code` example of + (and optimised) code from EDSLs. See the `compile_to_native_code` example of Metaparse as an example for this. * A [link metafunction_class ['template metafunction class]]. The result of parsing might be a type, which is a diff --git a/doc/metafunction.qbk b/doc/metafunction.qbk index b9690a1..66e2fd0 100644 --- a/doc/metafunction.qbk +++ b/doc/metafunction.qbk @@ -16,7 +16,7 @@ Template metafunction are expected to be called with Template metafunctions are expected to return template metaprogramming values. -For example this is the identitiy template metafunction: +For example this is the identity template metafunction: template struct identity diff --git a/doc/metafunction_class.qbk b/doc/metafunction_class.qbk index 9bded97..f82622b 100644 --- a/doc/metafunction_class.qbk +++ b/doc/metafunction_class.qbk @@ -9,7 +9,7 @@ their result. This makes it possible to implement template metafunctions as arguments or returning template metafunctions as their result. -For example this is the identitiy template metafunction class: +For example this is the identity template metafunction class: struct identity { diff --git a/doc/optional.qbk b/doc/optional.qbk index 6d48fe0..6885fae 100644 --- a/doc/optional.qbk +++ b/doc/optional.qbk @@ -16,7 +16,7 @@ This is a [link parser_combinator parser combinator]. [h1 Description] -It tries parsing the input with `P`. When `P` succeeds, the rsult of parsing is +It tries parsing the input with `P`. When `P` succeeds, the result of parsing is the result of `P`. Otherwise no characters are consumed and the result of parsing is `Default`. diff --git a/doc/performance.qbk b/doc/performance.qbk index 7d13adc..db7bf09 100644 --- a/doc/performance.qbk +++ b/doc/performance.qbk @@ -4,7 +4,7 @@ Parsers work at compile-time, thus their performance affects compilation speed. This section shows measurements of compilation time using Metaparse. The measurements were done on a Linux laptop with an 1.6 GHz Atom processor and 1 GB memory. The measurements were done using GCC 4.6.1 with `-std=c++0x` and no -optimalisation. Compilation speed was measured using the `time` utility. +optimisation. Compilation speed was measured using the `time` utility. To measure a non-trivial parser, the `printf` example program were used for measurements. Here is a list of the `printf` calls and their compilation speed diff --git a/doc/preface.qbk b/doc/preface.qbk index f72375e..473373e 100644 --- a/doc/preface.qbk +++ b/doc/preface.qbk @@ -60,11 +60,11 @@ This technique has the advantages over parsing the content of string literals * is faster in most cases * APIs using this technique can "emerge" as a process of advancing the API of a library step-by-step. Moving to a completely new DSL (with its own syntax) is - a realtively big step. + a relatively big step. Using expression templates for DSL embedding has the following disadvantages: -* the syntax of the embededd DSL is limited. It has to be a valid C++ +* the syntax of the embedded DSL is limited. It has to be a valid C++ expression. For most libraries, people familiar with the original DSL usually need to learn the library's syntax to understand the embedded code snippets. diff --git a/doc/reference.qbk b/doc/reference.qbk index ae9cdd9..73f3c56 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -70,7 +70,7 @@ [section Repetition] See the [link repetition Repetition] section of the -[link manual User Manual] for a detailed comparisan of the most common +[link manual User Manual] for a detailed comparison of the most common repetition combinators. [link finding-the-right-folding-parser-combinator Cheat-sheet] for diff --git a/doc/space.qbk b/doc/space.qbk index c790fd0..7849fb4 100644 --- a/doc/space.qbk +++ b/doc/space.qbk @@ -18,7 +18,7 @@ character. [h1 Expression semantics] -The followin are equivalent: +The following are equivalent: space diff --git a/doc/tag.qbk b/doc/tag.qbk index 822d610..80a6786 100644 --- a/doc/tag.qbk +++ b/doc/tag.qbk @@ -2,7 +2,7 @@ [section Tag] A ['tag] is a [link metaprogramming_value template metaprogramming value] used -to identifiy groups of values. +to identify groups of values. [endsect] diff --git a/doc/transform.qbk b/doc/transform.qbk index 3d90002..c0d36dd 100644 --- a/doc/transform.qbk +++ b/doc/transform.qbk @@ -17,7 +17,7 @@ This is a [link parser_combinator parser combinator]. [h1 Description] `transform` parses the input using `P` and transforms the result `P` returns -with `T`. The result of parsing is what `T` returns. When `P` fails, the faliure +with `T`. The result of parsing is what `T` returns. When `P` fails, the failure is returned unchanged. [h1 Header] diff --git a/doc/versioning.qbk b/doc/versioning.qbk index a7ed55f..16e7466 100644 --- a/doc/versioning.qbk +++ b/doc/versioning.qbk @@ -39,7 +39,7 @@ support them. Macros defined by the library are prefixed with `BOOST_METAPARSE_V1_`. For example `BOOST_METAPARSE_V1_STRING`. It is defined in the `` header file. The library provides the -`` header file as well, which includes the +`` header file as well, which includes the definition of this macro and provides the following definition: #define BOOST_METAPARSE_STRING BOOST_METAPARSE_V1_STRING