File: TransformationMode.h

package info (click to toggle)
openjade 1.4devel1-20.1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 6,636 kB
  • sloc: cpp: 90,082; sh: 10,847; ansic: 2,365; lisp: 894; perl: 604; makefile: 443; sed: 93
file content (75 lines) | stat: -rw-r--r-- 1,775 bytes parent folder | download | duplicates (9)
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
// Copyright (c) 1999 Matthias Clasen
// See the file copying.txt for copying permission.

#ifndef TransformationMode_INCLUDED
#define TransformationMode_INCLUDED 1

#include <OpenSP/Resource.h>
#include <OpenSP/Ptr.h>
#include <OpenSP/Vector.h>
#include <OpenSP/NCVector.h>
#include "Insn.h"
#include <OpenSP/Owner.h>
#include "ELObj.h"

#ifdef DSSSL_NAMESPACE
namespace DSSSL_NAMESPACE {
#endif

class Expression;

class TransformationMode {
public:

 class Action : public Resource {
  public:
    Action(unsigned partIndex, Owner<Expression> &, const Location &);
    void compile(Interpreter &);
    void get(InsnPtr &, Vector<CreateSpecObj *>&) const;
    const Location &location() const;
    unsigned partIndex() const;
  private:
    Location defLoc_;
    Owner<Expression> expr_;
    // must be permanent
    Vector<CreateSpecObj *> specs_; 
    InsnPtr insn_;
    unsigned partIndex_;
  };

  class Association {
  public:
    Association();
    Association(Owner<Expression> &,Owner<Expression> &,const Ptr<Action> &);
    const Action &action() const;
    Action &action();
    long priority() const;
    const Location &location() const;
    void compile(Interpreter &, const NodePtr &);
    void swap(Association &);
  private:
    Owner<Expression> qexpr_;
    Owner<Expression> pexpr_;
    long priority_;
    NodeListObj *nl_; 
    InsnPtr insn_;
    Ptr<Action> action_;
  };


  TransformationMode();
  void addAssociation(Owner<Expression> &, Owner<Expression> &, 
                      Owner<Expression>&, const Location &, Interpreter &);
  void compile(Interpreter &, const NodePtr &);
private:
  NCVector<Association> associations_;
  friend class TransformContext;
};


#ifdef DSSSL_NAMESPACE
}
#endif

#endif /* not TransformationMode_INCLUDED */