// This traversal relies on having the attribute declared // before the attribute in the definition of TypeDecl. // This ordering ensures that the primary type () is visited // before the template types (). Thus the value of // 'needHeader' calculated for the primary type can be passed on to // the template types. Registry { void fixupTypeUse() bypassing ParentEntity to TypeUse { (@ boolean needHeader; // Value of 'needHeader' for next TypeUse // visited. boolean declNeedHeader; // Stores 'needHeader' during traversal // of a Constant. Registry registry; @) before Registry (@ registry = host; @) before ReturnDecl (@ needHeader = false; @) before ArgumentDecl (@ needHeader = ! host.get_isRef(); @) before SymbolicConstant (@ declNeedHeader = needHeader; needHeader = true; @) after SymbolicConstant (@ needHeader = declNeedHeader; @) before TypeUse (@ host.set_needHeader(needHeader); try { host.set_type(registry.get_type(host.get_typeName())); } // I would really like to let this exception pass on through // but I have no way to declare that the generated visitor method // throws a ParseException. catch(ParseException e){ Main.die(e); } @) } }