2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / Microsoft.JScript / Microsoft.JScript / Enum.cs
1 //
2 // Enum.cs: AST representation of a enum_statement.
3 //
4 // Author:
5 //      Cesar Lopez Nataren (cesar@ciencias.unam.mx)
6 //
7 // (C) 2003, Cesar Lopez Nataren
8 //
9
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System;
32 using System.Text;
33 using System.Collections;
34
35 namespace Microsoft.JScript {
36
37         public class Enum : AST {
38
39                 private ArrayList modifiers;
40                 private string name;
41                 private string type;            
42                 private ArrayList pairs;
43
44                 internal Enum ()
45                 {
46                         Modifiers = new ArrayList ();
47                         Pairs = new ArrayList ();
48                 }
49
50
51                 internal ArrayList Modifiers {
52                         get { return modifiers; }
53                         set { modifiers = value; }
54                 }
55
56                 internal string Name {
57                         get { return name; }
58                         set { name = value; }
59                 }
60
61
62                 internal string Type {
63                         get { return type; }
64                         set { type = value; }
65                 }
66
67
68                 internal ArrayList Pairs {
69                         get { return pairs; }
70                         set { pairs = value; }
71                 }
72
73
74                 public override string ToString ()
75                 {
76                         StringBuilder sb = new StringBuilder ();
77
78                         foreach (string modifier in Modifiers)
79                                 sb.Append (modifier + "\n");
80
81                         sb.Append (name + "\n");
82                         sb.Append (type + "\n");
83                         
84                         foreach (BinaryOp bop in Pairs)
85                                 sb.Append (bop.ToString () + "\n");
86
87                         return sb.ToString ();
88                 }
89
90                 internal override bool Resolve (IdentificationTable context)
91                 {
92                         throw new NotImplementedException ();
93                 }                                       
94
95                 internal override void Emit (EmitContext ec)
96                 {
97                         throw new NotImplementedException ();
98                 }
99         }
100 }