Example #1
0
        public void Input_Past_Prompt()
        {
            stream.WriteLine(" << endl;");
            Indent();
            stream.Write("cin >> ");
            switch (kind_of_input)
            {
            case input_kind.array:
                stream.Write(input_name + "(");
                input_reference.emit_code(this, 0);
                stream.Write(")");
                break;

            case input_kind.array2d:
                stream.Write(input_name + "(");
                input_reference.emit_code(this, 0);
                stream.Write(",");
                input_reference2.emit_code(this, 0);
                stream.Write(")");
                break;

            case input_kind.variable:
                stream.Write(input_name);
                break;
            }
            stream.WriteLine(";");
        }
Example #2
0
        public void Input_Past_Prompt()
        {
            stream.WriteLine(");");
            Indent();
            switch (kind_of_input)
            {
            case input_kind.array:
                stream.Write(input_name + "(");
                input_reference.emit_code(this, 0);
                stream.Write(")");
                break;

            case input_kind.array2d:
                stream.Write(input_name + "(");
                input_reference.emit_code(this, 0);
                stream.Write(",");
                input_reference2.emit_code(this, 0);
                stream.Write(")");
                break;

            case input_kind.variable:
                stream.Write(input_name);
                break;
            }
            stream.WriteLine("= Double.Parse(Console.ReadLine());");
        }
Example #3
0
 public void Input_Start_Array_1D(string name, parse_tree.expression reference)
 {
     dest_is_array = true;
     this.Array_1D_Assignment_Start(name);
     reference.emit_code(this, 0);
     this.Array_1D_Assignment_After_Index();
     kind_of_input = input_kind.array;
 }
Example #4
0
 public void Input_Start_Array_2D(string name, parse_tree.expression reference,
                                  parse_tree.expression reference2)
 {
     dest_is_array = true;
     this.Array_2D_Assignment_Start(name);
     reference.emit_code(this, 0);
     this.Array_2D_Assignment_Between_Indices();
     reference2.emit_code(this, 0);
     this.Array_2D_Assignment_After_Indices();
     kind_of_input = input_kind.array2d;
 }
Example #5
0
 public void Input_Start_Array_1D(string name, parse_tree.expression reference)
 {
     input_name = name;
     kind_of_input = input_kind.array;
     input_reference = reference;
     Indent();
     stream.Write(input_name + "[");
     input_reference.emit_code(this, 0);
     if (readFile)
         stream.Write("] = read???();");
     else
         stream.Write("] = get???(");
 }
Example #6
0
 public void Input_Start_Array_2D(string name, parse_tree.expression reference,
                                  parse_tree.expression reference2)
 {
     input_name       = name;
     kind_of_input    = input_kind.array2d;
     input_reference  = reference;
     input_reference2 = reference2;
     stream.Write(input_name + "[");
     input_reference.emit_code(this, 0);
     stream.Write("][");
     input_reference2.emit_code(this, 0);
     if (readFile)
     {
         stream.Write("] = read???();");
     }
     else
     {
         stream.Write("] = get???(");
     }
 }