Пример #1
0
 protected void finish(UnitsValue_VisibilityJSON 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.");
     }
 }
Пример #2
0
        protected override void finish()
        {
            UnitsValue_VisibilityJSON result = new UnitsValue_VisibilityJSON();

            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_VisibilityAppendPair(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);
        }
Пример #3
0
 protected override void handle_result(UnitsValue_VisibilityJSON result)
 {
     top.value.Add(result);
 }
Пример #4
0
        protected override void handle_result(UnitsValue_VisibilityJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
Пример #5
0
 protected abstract void handle_result(UnitsValue_VisibilityJSON new_result);