1 // Copyright (c) 1996 James Clark
2 // See the file copying.txt for copying permission.
3 
4 #ifndef Interpreter_INCLUDED
5 #define Interpreter_INCLUDED 1
6 
7 #include "ELObj.h"
8 #include "Expression.h"
9 #include "Message.h"
10 #include "PointerTable.h"
11 #include "NamedTable.h"
12 #include "Collector.h"
13 #include "InputSource.h"
14 #include "XcharMap.h"
15 #include "Owner.h"
16 #include "Style.h"
17 #include "SosofoObj.h"
18 #include "ProcessingMode.h"
19 #include "NumberCache.h"
20 #include "HashTable.h"
21 #include "FOTBuilder.h"
22 #include "Owner.h"
23 #include "Boolean.h"
24 #include "Node.h"
25 #include "GroveManager.h"
26 #include "Pattern.h"
27 
28 #ifdef DSSSL_NAMESPACE
29 namespace DSSSL_NAMESPACE {
30 #endif
31 
32 class Interpreter;
33 
34 class Identifier : public Named {
35 public:
36   enum SyntacticKey {
37     notKey,
38     keyQuote,
39     keyLambda,
40     keyIf,
41     keyCond,
42     keyAnd,
43     keyOr,
44     keyCase,
45     keyLet,
46     keyLetStar,
47     keyLetrec,
48     keyQuasiquote,
49     keyUnquote,
50     keyUnquoteSplicing,
51     keyDefine,
52     keyElse,
53     keyArrow,
54     keySet,
55     keyBegin,
56     keyMake,
57     keyStyle,
58     keyWithMode,
59     keyDefineUnit,
60     keyElement,
61     keyDefault,
62     keyRoot,
63     keyId,
64     keyMode,
65     keyDeclareInitialValue,
66     keyDeclareCharacteristic,
67     keyDeclareFlowObjectClass,
68     keyDeclareCharCharacteristicAndProperty,
69     keyDeclareReferenceValueType,
70     keyDeclareDefaultLanguage,
71     keyDeclareCharProperty,
72     keyDefinePageModel,
73     keyDefineColumnSetModel,
74     keyDefineLanguage,
75     keyAddCharProperties,
76     keyUse,
77     keyLabel,
78     keyContentMap,
79     keyIsKeepWithPrevious,
80     keyIsKeepWithNext,
81     keySpaceBefore,
82     keySpaceAfter,
83     keyLeftHeader,
84     keyCenterHeader,
85     keyRightHeader,
86     keyLeftFooter,
87     keyCenterFooter,
88     keyRightFooter,
89     keyDestination,
90     keyType,
91     keyCoalesceId,
92     keyIsDisplay,
93     keyScale,
94     keyMaxWidth,
95     keyMaxHeight,
96     keyEntitySystemId,
97     keyNotationSystemId,
98     keyPositionPointX,
99     keyPositionPointY,
100     keyEscapementDirection,
101     keyBreakBeforePriority,
102     keyBreakAfterPriority,
103     keyOrientation,
104     keyLength,
105     keyChar,
106     keyGlyphId,
107     keyIsSpace,
108     keyIsRecordEnd,
109     keyIsInputTab,
110     keyIsInputWhitespace,
111     keyIsPunct,
112     keyIsDropAfterLineBreak,
113     keyIsDropUnlessBeforeLineBreak,
114     keyMathClass,
115     keyMathFontPosture,
116     keyScript,
117     keyStretchFactor,
118     keyKeep,
119     keyBreakBefore,
120     keyBreakAfter,
121     keyIsMayViolateKeepBefore,
122     keyIsMayViolateKeepAfter,
123     keyBeforeRowBorder,
124     keyAfterRowBorder,
125     keyBeforeColumnBorder,
126     keyAfterColumnBorder,
127     keyColumnNumber,
128     keyRowNumber,
129     keyNColumnsSpanned,
130     keyNRowsSpanned,
131     keyWidth,
132     keyIsStartsRow,
133     keyIsEndsRow,
134     keyTableWidth,
135     keyMultiModes,
136     keyData,
137     keyMin,
138     keyMax,
139     keyIsConditional,
140     keyPriority,
141     keyGridNRows,
142     keyGridNColumns,
143     keyRadical,
144     keyNull,
145     keyIsRcs,
146     keyParent,
147     keyActive,
148     keyAttributes,
149     keyChildren,
150     keyRepeat,
151     keyPosition,
152     keyOnly,
153     keyClass,
154     keyImportance,
155     keyDeclareClassAttribute,
156     keyDeclareIdAttribute,
157     keyDeclareFlowObjectMacro,
158     keyOrElement,
159     keyPositionPreference,
160     keyArchitecture
161   };
162   enum { lastSyntacticKey = keyWithMode };
163   Identifier(const StringC &name);
164   // Return 0 is value can't yet be computed.
165   ELObj *computeValue(bool force, Interpreter &) const;
166   bool syntacticKey(SyntacticKey &) const;
167   void setSyntacticKey(SyntacticKey);
168   bool defined(unsigned &, Location &) const;
169   void setDefinition(Owner<Expression> &, unsigned part,
170                      const Location &);
171   void setValue(ELObj *, unsigned defPart = unsigned(-1));
172   bool evaluated() const;
173   const ConstPtr<InheritedC> &inheritedC() const;
174   bool inheritedCDefined(unsigned &, Location &) const;
175   void setInheritedC(const ConstPtr<InheritedC> &);
176   void setInheritedC(const ConstPtr<InheritedC> &, unsigned part,
177 		     const Location &);
178   FlowObj *flowObj() const;
179   bool flowObjDefined(unsigned &, Location &) const;
180   void setFlowObj(FlowObj *);
181   void setFlowObj(FlowObj *, unsigned part, const Location &);
182 private:
183   unsigned defPart_;
184   Owner<Expression> def_;
185   InsnPtr insn_;
186   // Value in top-level environment.
187   ELObj *value_;		// must be permanent
188   FlowObj *flowObj_;    // prototype FlowObj with this name
189   unsigned flowObjPart_;
190   Location flowObjLoc_;
191   Location defLoc_;
192   SyntacticKey syntacticKey_;
193   bool beingComputed_;
194   ConstPtr<InheritedC> inheritedC_;
195   unsigned inheritedCPart_;
196   Location inheritedCLoc_;
197 };
198 
199 class Unit : public Named {
200 public:
201   Unit(const StringC &);
202   void setValue(long);
203   void setValue(double);
204   bool defined(unsigned &, Location &) const;
205   // return 0 if it can't be done
206   ELObj *resolveQuantity(bool force, Interpreter &, double val, int unitExp);
207   ELObj *resolveQuantity(bool force, Interpreter &, long val, int valExp);
208   void setDefinition(Owner<Expression> &, unsigned part, const Location &);
209 private:
210   void tryCompute(bool force, Interpreter &);
211   static bool scale(long val, int valExp, long num, long &result);
212 
213   unsigned defPart_;
214   Location defLoc_;
215   Owner<Expression> def_;
216   InsnPtr insn_;
217   enum {
218     notComputed,
219     beingComputed,
220     computedExact,
221     computedInexact,
222     computedError
223     } computed_;
224   union {
225     long exact_;
226     double inexact_;
227   };
228   int dim_;
229 };
230 
231 class ELObjDynamicRoot : public Collector::DynamicRoot {
232 public:
233   ELObjDynamicRoot(Collector &c, ELObj *obj = 0)
DynamicRoot(c)234     : Collector::DynamicRoot(c), obj_(obj) { }
235   void operator=(ELObj *obj) { obj_ = obj; }
236   operator ELObj *() const { return obj_; }
237 private:
238   void trace(Collector &) const;
239   ELObj *obj_;
240 };
241 
242 class Interpreter :
243   public Collector,
244   public Pattern::MatchContext,
245   public NumberCache,
246   public Messenger {
247 public:
248   enum PortName {
249     portNumerator,
250     portDenominator,
251     portPreSup,
252     portPreSub,
253     portPostSup,
254     portPostSub,
255     portMidSup,
256     portMidSub,
257     portOverMark,
258     portUnderMark,
259     portOpen,
260     portClose,
261     portDegree,
262     portOperator,
263     portLowerLimit,
264     portUpperLimit,
265     portHeader,
266     portFooter
267   };
268   enum { nPortNames = portFooter + 1 };
269   Interpreter(GroveManager *, Messenger *, int unitsPerInch, bool debugMode,
270 	      bool dsssl2, const FOTBuilder::Extension *);
271   void defineVariable(const StringC &);
272   void endPart();
273   FalseObj *makeFalse();
274   TrueObj *makeTrue();
275   NilObj *makeNil();
276   SymbolObj *makeSymbol(const StringC &);
277   KeywordObj *makeKeyword(const StringC &);
278   IntegerObj *makeInteger(long n);
279   ErrorObj *makeError();
280   UnspecifiedObj *makeUnspecified();
281   PairObj *makePair(ELObj *, ELObj *);
282   ELObj *convertGlyphId(const Char *, size_t, const Location &);
283   bool isError(const ELObj *) const;
284   bool isUnspecified(const ELObj *) const;
285   CharObj *makeChar(Char);
286   ELObj *makeLengthSpec(const FOTBuilder::LengthSpec &);
287   AddressObj *makeAddressNone();
288   NodeListObj *makeEmptyNodeList();
289   void dispatchMessage(Message &);
290   void dispatchMessage(const Message &);
291   Identifier *lookup(const StringC &);
292   Unit *lookupUnit(const StringC &);
293   FunctionObj *lookupExternalProc(const StringC &);
294   int unitsPerInch() const;
295   unsigned currentPartIndex() const;
296   void compile();
297   static StringC makeStringC(const char *);
298   SymbolObj *portName(PortName);
299   ELObj *cValueSymbol(FOTBuilder::Symbol);
300   // Map of LexCategory
301   XcharMap<char> lexCategory_;
302   static void normalizeGeneralName(const NodePtr &, StringC &);
303   GroveManager *groveManager() const;
304   StyleObj *initialStyle() const;
305   StyleObj *borderTrueStyle() const;
306   StyleObj *borderFalseStyle() const;
307   bool convertBooleanC(ELObj *, const Identifier *, const Location &, bool &);
308   bool convertPublicIdC(ELObj *, const Identifier *, const Location &,
309 			FOTBuilder::PublicId &);
310   bool convertStringC(ELObj *, const Identifier *, const Location &, StringC &);
311   bool convertLengthC(ELObj *, const Identifier *, const Location &, FOTBuilder::Length &);
312   bool convertLengthSpecC(ELObj *, const Identifier *, const Location &, FOTBuilder::LengthSpec &);
313   bool convertLetter2C(ELObj *, const Identifier *, const Location &, FOTBuilder::Letter2 &);
314   bool convertOptLengthSpecC(ELObj *, const Identifier *, const Location &, FOTBuilder::OptLengthSpec &);
315   bool convertCharC(ELObj *, const Identifier *, const Location &, Char &);
316   bool convertColorC(ELObj *, const Identifier *, const Location &, ColorObj *&);
317   bool convertOptColorC(ELObj *, const Identifier *, const Location &, ColorObj *&);
318   // FIXME allow inexact value
319   bool convertIntegerC(ELObj *, const Identifier *, const Location &, long &);
320   bool convertOptPositiveIntegerC(ELObj *, const Identifier *, const Location &, long &);
321   bool convertRealC(ELObj *, const Identifier *, const Location &, double &);
322   bool convertEnumC(const FOTBuilder::Symbol *, size_t,
323                     ELObj *, const Identifier *, const Location &, FOTBuilder::Symbol &);
324   bool convertEnumC(ELObj *, const Identifier *, const Location &, FOTBuilder::Symbol &);
325   void invalidCharacteristicValue(const Identifier *ident, const Location &loc);
326   bool convertLengthSpec(ELObj *, FOTBuilder::LengthSpec &);
327   bool convertToPattern(ELObj *, const Location &, Pattern &);
328   const ConstPtr<InheritedC> &tableBorderC() const;
329   const ConstPtr<InheritedC> &cellBeforeRowBorderC() const;
330   const ConstPtr<InheritedC> &cellAfterRowBorderC() const;
331   const ConstPtr<InheritedC> &cellBeforeColumnBorderC() const;
332   const ConstPtr<InheritedC> &cellAfterColumnBorderC() const;
333   const ConstPtr<InheritedC> &fractionBarC() const;
334   const char *storePublicId(const Char *, size_t, const Location &);
335   unsigned allocGlyphSubstTableUniqueId();
336   bool lookupNodeProperty(const StringC &, ComponentName::Id &);
337   bool debugMode() const;
338   bool dsssl2() const;
339   void setNodeLocation(const NodePtr &);
340   void makeReadOnly(ELObj *);
341   ProcessingMode *lookupProcessingMode(const StringC &);
342   ProcessingMode *initialProcessingMode();
343   void addClassAttributeName(const StringC &name);
344   void addIdAttributeName(const StringC &name);
345   void installInitialValue(Identifier *, Owner<Expression> &);
346   void installExtensionInheritedC(Identifier *, const StringC &, const Location &);
347   void installExtensionFlowObjectClass(Identifier *, const StringC &, const Location &);
348   // Return 0 if an invalid number.
349   ELObj *convertNumber(const StringC &, int radix = 10);
350   bool convertCharName(const StringC &str, Char &c) const;
351   enum LexCategory {
352     lexLetter,			// a - z A - Z
353     lexOtherNameStart,		//
354     lexDigit,			// 0-9
355     lexOtherNumberStart,	// -+.
356     lexDelimiter,		// ;()"
357     lexWhiteSpace,
358     lexOther
359   };
360   LexCategory lexCategory(Xchar);
361 private:
362   Interpreter(const Interpreter &); // undefined
363   void operator=(const Interpreter &); // undefined
364   void installSyntacticKeys();
365   void installPortNames();
366   void installCValueSymbols();
367   void installPrimitives();
368   void installPrimitive(const char *s, PrimitiveObj *value);
369   void installXPrimitive(const char *s, PrimitiveObj *value);
370   void installUnits();
371   void installCharNames();
372   void installInheritedCs();
373   void installInheritedC(const char *, InheritedC *);
374   void installInheritedCProc(const Identifier *);
375   void installFlowObjs();
376   void installSdata();
377   void installNodeProperties();
378   void compileInitialValues();
379   bool sdataMap(GroveString, GroveString, GroveChar &) const;
380   static bool convertUnicodeCharName(const StringC &str, Char &c);
381   bool convertToPattern(ELObj *obj, const Location &loc,
382 			bool isChild, IList<Pattern::Element> &list);
383   bool patternAddAttributeQualifiers(ELObj *obj,
384 				     const Location &loc,
385 				     Pattern::Element &elem);
386   enum {
387     convertAllowBoolean = 01,
388     convertAllowSymbol = 02,
389     convertAllowNumber = 04
390   };
391   ELObj *convertFromString(ELObj *, unsigned hints, const Location &);
392   ELObj *convertNumberFloat(const StringC &);
393   bool scanSignDigits(const StringC &str, size_t &i, int &n);
394   Unit *scanUnit(const StringC &str, size_t i, int &unitExp);
395 
396   NilObj *theNilObj_;
397   TrueObj *theTrueObj_;
398   FalseObj *theFalseObj_;
399   ErrorObj *theErrorObj_;
400   UnspecifiedObj *theUnspecifiedObj_;
401   typedef PointerTable<SymbolObj *, StringC, Hash, SymbolObj>
402     SymbolTable;
403   SymbolTable symbolTable_;
404   NamedTable<Identifier> identTable_;
405   NamedTable<Unit> unitTable_;
406   HashTable<StringC,FunctionObj *> externalProcTable_;
407   Messenger *messenger_;
408   const FOTBuilder::Extension *extensionTable_;
409   unsigned partIndex_;
410   int unitsPerInch_;
411   unsigned nInheritedC_;
412   GroveManager *groveManager_;
413   ProcessingMode initialProcessingMode_;
414   NamedTable<ProcessingMode> processingModeTable_;
415   SymbolObj *portNames_[nPortNames];
416   ELObj *cValueSymbols_[FOTBuilder::nSymbols];
417   HashTable<StringC,Char> namedCharTable_;
418   Vector<const Identifier *> initialValueNames_;
419   NCVector<Owner<Expression> > initialValueValues_;
420   size_t currentPartFirstInitialValue_;
421   StyleObj *initialStyle_;
422   StyleObj *borderTrueStyle_;
423   StyleObj *borderFalseStyle_;
424   ConstPtr<InheritedC> tableBorderC_;
425   ConstPtr<InheritedC> cellBeforeRowBorderC_;
426   ConstPtr<InheritedC> cellAfterRowBorderC_;
427   ConstPtr<InheritedC> cellBeforeColumnBorderC_;
428   ConstPtr<InheritedC> cellAfterColumnBorderC_;
429   ConstPtr<InheritedC> fractionBarC_;
430   class StringSet {
431   public:
432     StringSet();
433     const char *store(String<char> &);
434     static unsigned long hash(const String<char> &);
key(const String<char> & str)435     static inline const String<char> &key(const String<char> &str) { return str; }
436   private:
437     OwnerTable<String<char>, String<char>, StringSet, StringSet> table_;
438   };
439   StringSet publicIds_;
440   HashTable<StringC,Char> sdataEntityNameTable_;
441   unsigned nextGlyphSubstTableUniqueId_;
442   AddressObj *addressNoneObj_;
443   NodeListObj *emptyNodeListObj_;
444   HashTable<StringC,int> nodePropertyTable_;
445   bool debugMode_;
446   bool dsssl2_;
447   friend class Identifier;
448 };
449 
450 inline
makeError()451 ErrorObj *Interpreter::makeError()
452 {
453   return theErrorObj_;
454 }
455 
456 inline
isError(const ELObj * obj)457 bool Interpreter::isError(const ELObj *obj) const
458 {
459   return obj == theErrorObj_;
460 }
461 
462 inline
isUnspecified(const ELObj * obj)463 bool Interpreter::isUnspecified(const ELObj *obj) const
464 {
465   return obj == theUnspecifiedObj_;
466 }
467 
468 inline
makeFalse()469 FalseObj *Interpreter::makeFalse()
470 {
471   return theFalseObj_;
472 }
473 
474 inline
makeTrue()475 TrueObj *Interpreter::makeTrue()
476 {
477   return theTrueObj_;
478 }
479 
480 inline
makeNil()481 NilObj *Interpreter::makeNil()
482 {
483   return theNilObj_;
484 }
485 
486 inline
makeUnspecified()487 UnspecifiedObj *Interpreter::makeUnspecified()
488 {
489   return theUnspecifiedObj_;
490 }
491 
492 inline
makeInteger(long n)493 IntegerObj *Interpreter::makeInteger(long n)
494 {
495   return new (*this) IntegerObj(n);
496 }
497 
498 inline
makePair(ELObj * car,ELObj * cdr)499 PairObj *Interpreter::makePair(ELObj *car, ELObj *cdr)
500 {
501   return new (*this) PairObj(car, cdr);
502 }
503 
504 inline
makeChar(Char c)505 CharObj *Interpreter::makeChar(Char c)
506 {
507   return new (*this) CharObj(c);
508 }
509 
510 inline
makeAddressNone()511 AddressObj *Interpreter::makeAddressNone()
512 {
513   return addressNoneObj_;
514 }
515 
516 inline
makeEmptyNodeList()517 NodeListObj *Interpreter::makeEmptyNodeList()
518 {
519   return emptyNodeListObj_;
520 }
521 
522 inline
cValueSymbol(FOTBuilder::Symbol sym)523 ELObj *Interpreter::cValueSymbol(FOTBuilder::Symbol sym)
524 {
525   return cValueSymbols_[sym];
526 }
527 
528 inline
portName(PortName i)529 SymbolObj *Interpreter::portName(PortName i)
530 {
531   return portNames_[i];
532 }
533 
534 inline
initialProcessingMode()535 ProcessingMode *Interpreter::initialProcessingMode()
536 {
537   return &initialProcessingMode_;
538 }
539 
540 inline
unitsPerInch()541 int Interpreter::unitsPerInch() const
542 {
543   return unitsPerInch_;
544 }
545 
546 inline
currentPartIndex()547 unsigned Interpreter::currentPartIndex() const
548 {
549   return partIndex_;
550 }
551 
552 inline
makeKeyword(const StringC & str)553 KeywordObj *Interpreter::makeKeyword(const StringC &str)
554 {
555   return new (*this) KeywordObj(lookup(str));
556 }
557 
558 inline
initialStyle()559 StyleObj *Interpreter::initialStyle() const
560 {
561   return initialStyle_;
562 }
563 
564 inline
borderTrueStyle()565 StyleObj *Interpreter::borderTrueStyle() const
566 {
567   return borderTrueStyle_;
568 }
569 
570 inline
borderFalseStyle()571 StyleObj *Interpreter::borderFalseStyle() const
572 {
573   return borderFalseStyle_;
574 }
575 
576 inline
groveManager()577 GroveManager *Interpreter::groveManager() const
578 {
579   return groveManager_;
580 }
581 
582 inline
tableBorderC()583 const ConstPtr<InheritedC> &Interpreter::tableBorderC() const
584 {
585   return tableBorderC_;
586 }
587 
588 inline
cellBeforeRowBorderC()589 const ConstPtr<InheritedC> &Interpreter::cellBeforeRowBorderC() const
590 {
591   return cellBeforeRowBorderC_;
592 }
593 
594 inline
cellAfterRowBorderC()595 const ConstPtr<InheritedC> &Interpreter::cellAfterRowBorderC() const
596 {
597   return cellAfterRowBorderC_;
598 }
599 
600 inline
cellBeforeColumnBorderC()601 const ConstPtr<InheritedC> &Interpreter::cellBeforeColumnBorderC() const
602 {
603   return cellBeforeColumnBorderC_;
604 }
605 
606 inline
cellAfterColumnBorderC()607 const ConstPtr<InheritedC> &Interpreter::cellAfterColumnBorderC() const
608 {
609   return cellAfterColumnBorderC_;
610 }
611 
612 inline
fractionBarC()613 const ConstPtr<InheritedC> &Interpreter::fractionBarC() const
614 {
615   return fractionBarC_;
616 }
617 
618 inline
lookupExternalProc(const StringC & pubid)619 FunctionObj *Interpreter::lookupExternalProc(const StringC &pubid)
620 {
621   FunctionObj *const *func = externalProcTable_.lookup(pubid);
622   return func ? *func : 0;
623 }
624 
625 inline
allocGlyphSubstTableUniqueId()626 unsigned Interpreter::allocGlyphSubstTableUniqueId()
627 {
628   return nextGlyphSubstTableUniqueId_++;
629 }
630 
631 inline
debugMode()632 bool Interpreter::debugMode() const
633 {
634   return debugMode_;
635 }
636 
637 inline
dsssl2()638 bool Interpreter::dsssl2() const
639 {
640   return dsssl2_;
641 }
642 
643 inline
makeReadOnly(ELObj * obj)644 void Interpreter::makeReadOnly(ELObj *obj)
645 {
646   if (dsssl2())
647     Collector::makeReadOnly(obj);
648 }
649 
650 inline
addClassAttributeName(const StringC & name)651 void Interpreter::addClassAttributeName(const StringC &name)
652 {
653   classAttributeNames_.push_back(name);
654 }
655 
656 inline
addIdAttributeName(const StringC & name)657 void Interpreter::addIdAttributeName(const StringC &name)
658 {
659   idAttributeNames_.push_back(name);
660 }
661 
662 inline
lexCategory(Xchar c)663 Interpreter::LexCategory Interpreter::lexCategory(Xchar c)
664 {
665   return LexCategory(lexCategory_[c]);
666 }
667 
668 inline
syntacticKey(SyntacticKey & key)669 bool Identifier::syntacticKey(SyntacticKey &key) const
670 {
671   if (syntacticKey_ == notKey)
672     return 0;
673   key = syntacticKey_;
674   return 1;
675 }
676 
677 inline
setSyntacticKey(SyntacticKey key)678 void Identifier::setSyntacticKey(SyntacticKey key)
679 {
680   syntacticKey_ = key;
681 }
682 
683 inline
evaluated()684 bool Identifier::evaluated() const
685 {
686   return value_ != 0;
687 }
688 
689 inline
inheritedC()690 const ConstPtr<InheritedC> &Identifier::inheritedC() const
691 {
692   return inheritedC_;
693 }
694 
695 inline
inheritedCDefined(unsigned & part,Location & loc)696 bool Identifier::inheritedCDefined(unsigned &part, Location &loc) const
697 {
698   if (inheritedC_.isNull())
699     return 0;
700   part = inheritedCPart_;
701   loc = inheritedCLoc_;
702   return 1;
703 }
704 
705 inline
setInheritedC(const ConstPtr<InheritedC> & ic)706 void Identifier::setInheritedC(const ConstPtr<InheritedC> &ic)
707 {
708   inheritedC_ = ic;
709   inheritedCPart_ = unsigned(-1);
710 }
711 
712 inline
setInheritedC(const ConstPtr<InheritedC> & ic,unsigned part,const Location & loc)713 void Identifier::setInheritedC(const ConstPtr<InheritedC> &ic, unsigned part,
714 			       const Location &loc)
715 {
716   inheritedC_ = ic;
717   inheritedCPart_ = part;
718   inheritedCLoc_ = loc;
719 }
720 
721 inline
flowObj()722 FlowObj *Identifier::flowObj() const
723 {
724   return flowObj_;
725 }
726 
727 inline
flowObjDefined(unsigned & part,Location & loc)728 bool Identifier::flowObjDefined(unsigned &part, Location &loc) const
729 {
730   if (!flowObj_)
731     return 0;
732   part = flowObjPart_;
733   loc = flowObjLoc_;
734   return 1;
735 }
736 
737 inline
setFlowObj(FlowObj * fo)738 void Identifier::setFlowObj(FlowObj *fo)
739 {
740   flowObj_ = fo;
741   flowObjPart_ = unsigned(-1);
742 }
743 
744 inline
setFlowObj(FlowObj * fo,unsigned part,const Location & loc)745 void Identifier::setFlowObj(FlowObj *fo, unsigned part, const Location &loc)
746 {
747   flowObj_ = fo;
748   flowObjPart_ = part;
749   flowObjLoc_ = loc;
750 }
751 
752 #ifdef DSSSL_NAMESPACE
753 }
754 #endif
755 
756 #endif /* not Interpreter_INCLUDED */
757