* FormalParameterList.cs: Added FormalParam class. Change Add method to receive the...
authorCésar Natarén <cesar@mono-cvs.ximian.com>
Mon, 3 Nov 2003 16:54:59 +0000 (16:54 -0000)
committerCésar Natarén <cesar@mono-cvs.ximian.com>
Mon, 3 Nov 2003 16:54:59 +0000 (16:54 -0000)
svn path=/trunk/mcs/; revision=19581

mcs/class/Microsoft.JScript/Microsoft.JScript/FormalParameterList.cs

index 9a0fe90247bc3c46a7c7fb2a9716f2d30433c9d6..f851dfc8572a8d9e7690997152475e1f03e9d90e 100644 (file)
@@ -9,9 +9,33 @@
 
 using System.Collections;
 using System.Text;
+using System;
 
 namespace Microsoft.JScript {
 
+       internal class FormalParam {
+               internal string id;
+               internal string type_annot;
+
+               //
+               // FIXME: 
+               //      Must perform semantic analysis on type_annot,
+               //      and assign that type value to 'type' if valid.
+               //
+               internal Type type = typeof (Object);
+
+               internal FormalParam (string id, string type_annot)
+               {
+                       this.id = id;
+                       this.type_annot = type_annot;
+               }
+
+               public override string ToString ()
+               {
+                       return id + " " + type_annot;
+               }
+       }
+                       
        public class FormalParameterList {
 
                internal ArrayList ids;
@@ -21,19 +45,20 @@ namespace Microsoft.JScript {
                        ids = new ArrayList ();
                }
 
-               internal void Add (string id)
-               {       
-                       ids.Add (id);   
+               internal void Add (string id, string type_annot)
+               {
+                       FormalParam p = new FormalParam (id, type_annot);       
+                       ids.Add (p);    
                }
 
                public override string ToString ()
                {
                        StringBuilder sb = new StringBuilder ();
                
-                       foreach (string s in ids)
-                               sb.Append (s + " ");
+                       foreach (FormalParam f in ids)
+                               sb.Append (f.ToString () + " ");
                
                        return sb.ToString ();
                }
        }
-}
\ No newline at end of file
+}