BinaryParser

| Home | Libraries | People | FAQ | More

##### BinaryParser

###### Description

BinaryParser is a composite parser that has a two subjects, `left` and `right`. The BinaryParser allows its subjects to be treated in the same way as a single instance of a `Parser` following the Composite Design Pattern.

###### Refinement of

> `Parser`

Notation

`p`

  A BinaryParser.

`P`

  A BinaryParser type.

###### Valid Expressions

In addition to the requirements defined in `Parser`, for any BinaryParser the following must be met:

Expression | Semantics | Return type
--- | --- | ---
`p.left` | Left parser. | `Parser`
`p.right` | Right parser. | `Parser`

###### Type Expressions

Expression | Description
--- | ---
`P::left_type` | The left parser type.
`P::right_type` | The right parser type.
`traits::is_binary_parser<P>::type` | Metafunction that evaluates to `mpl::true_` if a certain type, `P` is a BinaryParser, `mpl::false_` otherwise (See MPL Boolean Constant).

###### Invariants

For any BinaryParser, `P`, the following invariants always hold:

- `traits::is_parser<P::left_type>::type` evaluates to `mpl::true_`
- `traits::is_parser<P::right_type>::type` evaluates to `mpl::true_`

###### Models

- Difference
- List