Beispiel #1
0
 protected void finish(UnitsValue_PrecipitationJSON result)
 {
     if (fieldGeneratorFormat.have_value)
     {
         result.setFormat(fieldGeneratorFormat.value);
         fieldGeneratorFormat.have_value = false;
     }
     else if ((!(result.hasFormat())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Format\" field was missing.");
     }
     if (fieldGeneratorUnits.have_value)
     {
         result.setUnits(fieldGeneratorUnits.value);
         fieldGeneratorUnits.have_value = false;
     }
     else if ((!(result.hasUnits())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Units\" field was missing.");
     }
     if (fieldGeneratorWrittenUnits.have_value)
     {
         result.setWrittenUnits(fieldGeneratorWrittenUnits.value);
         fieldGeneratorWrittenUnits.have_value = false;
     }
     else if ((!(result.hasWrittenUnits())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"WrittenUnits\" field was missing.");
     }
     if (fieldGeneratorSpokenUnits.have_value)
     {
         result.setSpokenUnits(fieldGeneratorSpokenUnits.value);
         fieldGeneratorSpokenUnits.have_value = false;
     }
     else if ((!(result.hasSpokenUnits())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"SpokenUnits\" field was missing.");
     }
     if (fieldGeneratorValue.have_value)
     {
         result.setValueText(fieldGeneratorValue.value);
         fieldGeneratorValue.have_value = false;
     }
     else if ((!(result.hasValue())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Value\" field was missing.");
     }
 }
Beispiel #2
0
        protected override void finish()
        {
            UnitsValue_PrecipitationJSON result = new UnitsValue_PrecipitationJSON();

            Debug.Assert(result != null);
            finish(result);
            int extra_count = unknownFieldGenerator.field_names.Count;

            Debug.Assert(extra_count == unknownFieldGenerator.field_values.Count);
            for (int extra_num = 0; extra_num < extra_count; ++extra_num)
            {
                result.extraUnitsValue_PrecipitationAppendPair(unknownFieldGenerator.field_names[extra_num], unknownFieldGenerator.field_values[extra_num]);
            }
            unknownFieldGenerator.field_names.Clear();
            unknownFieldGenerator.field_values.Clear();
            unknownFieldGenerator.index = new Dictionary <string, JSONValue>();
            handle_result(result);
        }
Beispiel #3
0
 protected override void handle_result(UnitsValue_PrecipitationJSON result)
 {
     top.value.Add(result);
 }
Beispiel #4
0
        protected override void handle_result(UnitsValue_PrecipitationJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
Beispiel #5
0
 protected abstract void handle_result(UnitsValue_PrecipitationJSON new_result);