Debian Codegraph @

style/TransformationMode.h

raw
1 // Copyright (c) 1999 Matthias Clasen
2 // See the file copying.txt for copying permission.
3
4 #ifndef TransformationMode_INCLUDED
5 #define TransformationMode_INCLUDED 1
6
7 #include <OpenSP/Resource.h>
8 #include <OpenSP/Ptr.h>
9 #include <OpenSP/Vector.h>
10 #include <OpenSP/NCVector.h>
11 #include "Insn.h"
12 #include <OpenSP/Owner.h>
13 #include "ELObj.h"
14
15 #ifdef DSSSL_NAMESPACE
16 namespace DSSSL_NAMESPACE {
17 #endif
18
19 class Expression;
20
21 class TransformationMode {
22 public:
23
24 class Action : public Resource {
25 public:
26 Action(unsigned partIndex, Owner<Expression> &, const Location &);
27 void compile(Interpreter &);
28 void get(InsnPtr &, Vector<CreateSpecObj *>&) const;
29 const Location &location() const;
30 unsigned partIndex() const;
31 private:
32 Location defLoc_;
33 Owner<Expression> expr_;
34 // must be permanent
35 Vector<CreateSpecObj *> specs_;
36 InsnPtr insn_;
37 unsigned partIndex_;
38 };
39
40 class Association {
41 public:
42 Association();
43 Association(Owner<Expression> &,Owner<Expression> &,const Ptr<Action> &);
44 const Action &action() const;
45 Action &action();
46 long priority() const;
47 const Location &location() const;
48 void compile(Interpreter &, const NodePtr &);
49 void swap(Association &);
50 private:
51 Owner<Expression> qexpr_;
52 Owner<Expression> pexpr_;
53 long priority_;
54 NodeListObj *nl_;
55 InsnPtr insn_;
56 Ptr<Action> action_;
57 };
58
59
60 TransformationMode();
61 void addAssociation(Owner<Expression> &, Owner<Expression> &,
62 Owner<Expression>&, const Location &, Interpreter &);
63 void compile(Interpreter &, const NodePtr &);
64 private:
65 NCVector<Association> associations_;
66 friend class TransformContext;
67 };
68
69
70 #ifdef DSSSL_NAMESPACE
71 }
72 #endif
73
74 #endif /* not TransformationMode_INCLUDED */
75