~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to ddd/LetNode.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-07-22 03:49:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040722034937-cysl08t1jvba4jrx
Tags: 1:3.3.9-3
USERINFO has been renamed to USERINFO.txt; adjust debian/rules code
to match, to get correct information on the About DDD dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: LetNode.h,v 1.16 2000/12/11 12:21:47 zeller Exp $
 
1
// $Id$
2
2
// LET..IN construct in VSL
3
3
 
4
4
// Copyright (C) 1995 Technische Universitaet Braunschweig, Germany.
29
29
#ifndef _DDD_LetNode_h
30
30
#define _DDD_LetNode_h
31
31
 
32
 
#ifdef __GNUG__
33
 
#pragma interface
34
 
#endif
35
 
 
36
 
 
37
32
// A LetNode implements a LET..IN construct.
38
33
 
39
34
// A LetNode contains a list of length 2.
42
37
 
43
38
 
44
39
#include "assert.h"
45
 
#include <iostream.h>
 
40
#include <iostream>
46
41
 
 
42
#include "mutable.h"
47
43
#include "VSLNode.h"
48
44
#include "ListNode.h"
49
45
#include "CallNode.h"
59
55
 
60
56
private:
61
57
    VSLNode *_node_pattern;     // Pattern
62
 
    Box *_box_pattern;          // Compiled pattern
 
58
    mutable Box *_box_pattern;          // Compiled pattern
63
59
 
64
60
    unsigned _nargs;            // Number of args
65
61
    bool _straight;             // Flag: use argument list `as is'?
66
62
 
67
 
    bool being_compiled;        // Protect against recursive patterns
 
63
    mutable bool being_compiled;        // Protect against recursive patterns
68
64
 
69
65
    ListNode *_args() const      { return (ListNode *)arg(); }
70
66
    ListNode *_body() const      { return (ListNode *)(_args()->tail()); }
76
72
    bool domatch(const VSLNode *arg) const;    // Match against Ausdruck
77
73
 
78
74
protected:
79
 
    void dump(ostream& s) const;
80
 
    void _dumpTree(ostream& s) const;
 
75
    void dump(std::ostream& s) const;
 
76
    void _dumpTree(std::ostream& s) const;
81
77
 
82
78
    LetNode(const LetNode& node):
83
79
        CallNode(node),
96
92
    const Box *call(Box *) const  { assert(0); return 0; }
97
93
 
98
94
private:
99
 
    LetNode& operator = (const LetNode&) { assert(0); return *this; }
 
95
    LetNode& operator = (const LetNode&);
100
96
 
101
97
public:
102
98
    // Constructor
137
133
    {
138
134
        CallNode::uncompilePatterns(cdef);
139
135
 
140
 
        if (_box_pattern) 
141
 
            ((LetNode *)this)->_box_pattern->unlink();
142
 
        ((LetNode *)this)->_box_pattern = 0;
 
136
        if (_box_pattern)
 
137
            MUTABLE_THIS(LetNode *)->_box_pattern->unlink();
 
138
        MUTABLE_THIS(LetNode *)->_box_pattern = 0;
143
139
    }
144
140
 
145
141
    // Resolve all names
169
165
    DECLARE_TYPE_INFO
170
166
 
171
167
protected:
172
 
    void dump(ostream& s) const;
 
168
    void dump(std::ostream& s) const;
173
169
 
174
170
    // Copy
175
 
    WhereNode(WhereNode& node):
 
171
    WhereNode(const WhereNode& node):
176
172
        LetNode(node)
177
173
    {}
178
174