Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2008-03-24 17:22:30

On 03/24/08 15:16, Eric Niebler wrote:
> Larry Evans wrote:
>> sort of succinct formula. My last attempt was:
> I confess I don't understand your notation in that message.

The notation is supposed to be a language grammar similar to that
shown in compiler texts, except it doesn't surround the grammar
terminals with quotes. So, to make it closer to that, use:

   = 'terminal::type' //rule0
   | (expr_type+)'::type' //rule1

and where the postfix + means 1 or more of the preceding. So, one
possible instance of sentence satisfying this grammar is (tracing the
derivations and subscripting different instances of grammar symbols with
_i, where i is an positive integer, and showing the derivations steps
with -(ruleX->, where ruleX is one of the comments labelling
the grammar altenatives in the above equattion):


   -rule1-> (expr_type_1, expr_type_2, expr_type_3)'::type'
   -rule0-> ('terminal::type'_1 'terminal::type'_2

Now, the terminal symbol, 'terminal::type' is supposed to represent
any proto::terminal<> grammar and the appending '::type' is supposed
to represent the conversion of the proto::grammar to the corresponding
expression. The (expr_type+) is supposed to represent any other
proto "expression" grammar. The reason expr<Tag,expr_type+,Size> was
not used was because that's just the concrete syntax version of
expr_type+; hence, just detail. A concrete instance of this would be:


where the concrete symbols corresponding to the last step in the example
abstract derivation above are:

     == terminal<int>::type
     == terminal<char>::type
     == //none because shift_right is binary
   ('terminal::type'_1 'terminal::type'_2)'::type'
     == shift_right<terminal<int>,terminal<char>::type>::type

> I also don't
> understand what you're trying to get at with morphisms, a concept I
> don't grasp. Do you think you could try again to explain what you're
> trying to achieve?

Before I try that, I better make sure the above is clear enough.
Could you let me know if it's not clear.

Boost list run by bdawes at, gregod at, cpdaniel at, john at