1 //creado : Cristian Tornador
2 //22-10-2002 - Universidad Politecnica Catalunya (Barcelona)
3 
4 #include "EmphasizingMark.h"
5 
6 #ifdef DSSSL_NAMESPACE
7 namespace DSSSL_NAMESPACE {
8 #endif
9 
traceSubObjects(Collector & c) const10 void EmphasizingMarkFlowObj::traceSubObjects(Collector &c) const
11 {
12  c.trace(emphmark_);
13  CompoundFlowObj::traceSubObjects(c);
14 }
15 
processInner(ProcessContext & context)16 void EmphasizingMarkFlowObj::processInner(ProcessContext &context)
17 {
18 
19   FOTBuilder &fotb = context.currentFOTBuilder();
20   FOTBuilder* markfotb[1];
21   fotb.startEmphasizingMark(*nic_, markfotb);
22 
23    if (emphmark_) {
24       context.pushPrincipalPort(markfotb[0]);
25       emphmark_->process(context);
26       context.popPrincipalPort();
27   }
28   fotb.endEmphasizingMarkEM();
29   CompoundFlowObj::processInner(context);
30   fotb.endEmphasizingMark();
31 }
32 
copy(Collector & c) const33 FlowObj *EmphasizingMarkFlowObj::copy(Collector &c) const
34 {
35   return new (c) EmphasizingMarkFlowObj(*this);
36 }
37 
hasNonInheritedC(const Identifier * ident) const38 bool EmphasizingMarkFlowObj::hasNonInheritedC(const Identifier *ident) const
39 {
40   Identifier::SyntacticKey key;
41   if (ident->syntacticKey(key)) {
42     switch (key) {
43     case Identifier::keyBreakBeforePriority:
44     case Identifier::keyBreakAfterPriority:
45     case Identifier::keyMark:
46      return 1;
47     default:
48       break;
49     }
50   }
51   return 0;
52 }
53 
setNonInheritedC(const Identifier * ident,ELObj * obj,const Location & loc,Interpreter & interp)54 void EmphasizingMarkFlowObj::setNonInheritedC(const Identifier *ident,
55                                                  ELObj *obj,
56                                                  const Location &loc,
57                                                  Interpreter &interp)
58 {
59  SosofoObj *sosofo = obj->asSosofo();
60  Identifier::SyntacticKey key;
61  if (ident->syntacticKey(key)) {
62   switch (key) {
63    case Identifier::keyBreakBeforePriority:
64       interp.convertIntegerC(obj, ident, loc, nic_->breakBeforePriority);
65       return;
66    case Identifier::keyBreakAfterPriority:
67       interp.convertIntegerC(obj, ident, loc, nic_->breakAfterPriority);
68       return;
69    case Identifier::keyMark:
70       if (!sosofo) {
71          interp.setNextLocation(loc);
72          interp.message(InterpreterMessages::invalidCharacteristicValue,
73                         StringMessageArg(ident->name()));
74          return;
75       }
76       emphmark_ = sosofo;
77       return;
78    default:
79     break;
80   }
81  }
82  CANNOT_HAPPEN();
83 }
84 
85 #ifdef DSSSL_NAMESPACE
86 }
87 #endif
88