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;
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
+}