This repository has been archived by the owner on Apr 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
block_nested.C
77 lines (62 loc) · 1.8 KB
/
block_nested.C
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
// block_nested.h -- Support for blocks nested in other blocks.
//
// Copyright 2005, 2009 Per Abrahamsen and KVL.
//
// This file is part of Daisy.
//
// Daisy is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// Daisy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with Daisy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define BUILD_DLL
#include "block_nested.h"
#include "frame.h"
const Metalib&
BlockNested::metalib () const
{ return context.metalib (); }
Treelog&
BlockNested::msg () const
{ return context.msg (); }
void
BlockNested::set_error () const
{
Block::set_error ();
context.set_error ();
}
const Frame&
BlockNested::find_frame (const symbol key) const
{
if (frame ().check (key) || frame ().lookup (key) != Attribute::Error)
return frame ();
return context.find_frame (key);
}
Attribute::type
BlockNested::lookup (const symbol key) const
{
Attribute::type type = Block::lookup (key);
if (type != Attribute::Error)
return type;
return context.lookup (key);
}
void
BlockNested::entries (std::set<symbol>& all) const
{
Block::entries (all);
context.entries (all);
}
BlockNested::BlockNested (const Block& block, symbol scope_tag)
: context (block),
msg_nest (block.msg (), scope_tag)
{ }
BlockNested::~BlockNested ()
{ }
// block_nested.C ends here.