5 static string [] types
= {
9 "sbyte", "byte", "char"
13 static void w (string s
)
18 static void wl (string s
)
20 Console
.WriteLine (s
);
23 static void generate_receptors ()
25 foreach (string t
in types
){
26 w ("\tstatic void receive_" + t
+ " (" + t
+ " a)\n\t{\n");
27 w ("\t\tConsole.Write (\" \");\n");
28 w ("\t\tConsole.WriteLine (a);\n");
34 static void call (string type
, string name
)
36 w ("\t\treceive_" + type
+ " (checked ((" + type
+ ") var ));\n");
39 static void generate_emision ()
41 foreach (string type
in types
){
42 w ("\tstatic void probe_" + type
+ "()\n\t{\n");
44 w ("\t\t" + type
+ " var = (char) 0;");
46 w ("\t\t" + type
+ " var = 0;");
50 foreach (string t
in types
)
57 static void generate_main ()
59 wl ("\tpublic static void Main ()\n\t{");
61 foreach (string t
in types
){
62 w ("\t\tprobe_" + t
+ " ();\n");
67 public static void Main (string [] args
)
69 wl ("using System;\nclass Test {\n");
71 generate_receptors ();