# (C) Copyright International Business Machines Corporation 23 January \
# 1990.  All Rights Reserved. \
#  \
# See the file USERAGREEMENT distributed with this software for full \
# terms and conditions of use. \
# SCCS Info: @(#)cherm2c.sed	1.4 3/14/90 \
# This sed script translates a special notation for object component \
# specification into an expression that will access the specificed \
# component.  For example, foo@bar is translated into dot(foo,bar), \
# which will access component named 'bar' of the object pointed to by \
# foo.  Multiple levels are possible, e.g. foo@bar@frotz@mumble \
# becomes dot(dot(dot(foo,bar),frotz),mumble). \
# \
# First translate the root name and component into the dot macro, e.g. \
# foo@bar@frotz... becomes dot(foo,bar)@frotz...  We need to \
# explicitly match the tail (@frotz...) so that no piece of it gets \
# translated in this step (e.g. foo@bar@frotz@mumble should not \
# become dot(foo,bar)@dot(frotz,mumble))
s/\([A-Za-z][A-Za-z_]*\)@\([A-Za-z][A-Za-z_]*\)\([@A-Za-z_]*\)/dot(\1,\2)\3/g
:fixp
s/dot(\(.*\))@\([A-Za-z][A-Za-z_]*\)/dot(dot(\1),\2)/
t fixp
