File: MacroFlowObj.h

package info (click to toggle)
jade 1.2.1-43
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,808 kB
  • ctags: 16,989
  • sloc: cpp: 120,657; sh: 10,452; ansic: 8,228; perl: 378; makefile: 296; sed: 5
file content (86 lines) | stat: -rw-r--r-- 2,135 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Copyright (c) 1997 James Clark
// See the file copying.txt for copying permission.

#ifndef MacroFlowObj_INCLUDED
#define MacroFlowObj_INCLUDED 1

#include "SosofoObj.h"
#include "Insn.h"
#include "Resource.h"
#include "Ptr.h"
#include "Vector.h"
#include "NCVector.h"
#include "Owner.h"
#include "Expression.h"

#ifdef DSSSL_NAMESPACE
namespace DSSSL_NAMESPACE {
#endif

class ProcessContext;
class Identifier;
class Interpreter;

class MacroFlowObj : public CompoundFlowObj {
public:
  void *operator new(size_t, Collector &c) {
    return c.allocateObject(1);
  }
  class Definition : public Resource {
  public:
    Definition(Vector<const Identifier *> &,
	       NCVector<Owner<Expression> > &,
	       const Identifier *contentsId,
	       Owner<Expression> &);

    void process(ProcessContext &, MacroFlowObj *);
    bool isCompound() const;
    const Vector<const Identifier *> &nics() const;
  private:
    Definition(const Definition &); // undefined
    void operator=(const Definition &); // undefined
    void compile(Interpreter &);

    Vector<const Identifier *> charics_;
    NCVector<Owner<Expression> > charicInits_;
    const Identifier *contentsId_;
    Owner<Expression> body_;
    InsnPtr code_;
  };

  MacroFlowObj(Vector<const Identifier *> &,
	       NCVector<Owner<Expression> > &,
	       const Identifier *contentsId,
	       Owner<Expression> &);
  MacroFlowObj(const MacroFlowObj &);
  ~MacroFlowObj();
  FlowObj *copy(Collector &) const;
  CompoundFlowObj *asCompoundFlowObj();
  bool hasNonInheritedC(const Identifier *) const;
  void setNonInheritedC(const Identifier *, ELObj *, const Location &, Interpreter &);
  void traceSubObjects(Collector &) const;
  void processInner(ProcessContext &);
  void unpack(VM &);
private:
  void operator=(const MacroFlowObj &); // undefined
  Ptr<Definition> def_;
  ELObj **charicVals_;
};

inline
bool MacroFlowObj::Definition::isCompound() const
{
  return contentsId_ != 0;
}

inline
const Vector<const Identifier *> &MacroFlowObj::Definition::nics() const
{
  return charics_;
}

#ifdef DSSSL_NAMESPACE
}
#endif

#endif /* not MacroFlowObj_INCLUDED */