Ejemplo n.º 1
0
    public void appendTags(TypeTagsKnownValues new_value)
    {
        TypeTags new_full_value = new TypeTags();

        Debug.Assert(new_value != TypeTagsKnownValues.Tags__none);
        new_full_value.in_known_list = true;
        new_full_value.list_value    = new_value;
        appendTags(new_full_value);
    }
Ejemplo n.º 2
0
 public void appendTags(TypeTags to_append)
 {
     if (!flagHasTags)
     {
         flagHasTags = true;
         storeTags.Clear();
     }
     Debug.Assert(flagHasTags);
     storeTags.Add(to_append);
 }
Ejemplo n.º 3
0
            protected override void handle_result(string result)
            {
                TypeTagsKnownValues known     = stringToTags(result);
                TypeTags            new_value = new TypeTags();

                if (known == TypeTagsKnownValues.Tags__none)
                {
                    new_value.in_known_list = false;
                    new_value.string_value  = result;
                }
                else
                {
                    new_value.in_known_list = true;
                    new_value.list_value    = known;
                }
                handle_result(new_value);
            }
Ejemplo n.º 4
0
    public void appendTags(string chars)
    {
        TypeTagsKnownValues known     = stringToTags(chars);
        TypeTags            new_value = new TypeTags();

        if (known == TypeTagsKnownValues.Tags__none)
        {
            new_value.in_known_list = false;
            new_value.string_value  = chars;
        }
        else
        {
            new_value.in_known_list = true;
            new_value.list_value    = known;
        }
        appendTags(new_value);
    }
Ejemplo n.º 5
0
 public MarkdownFile(string text, TypeTags type)
 {
     Text = text;
     TypeTags = type;
     СhildrenFiles = new List<MarkdownFile>();
 }
Ejemplo n.º 6
0
 public HtmlFile(string text, TypeTags type)
 {
     this.text = text;
     TypeTag = type;
     childrenFiles = new List<HtmlFile>();
 }
Ejemplo n.º 7
0
 protected override void handle_result(TypeTags result)
 {
     top.value.Add(result);
 }
Ejemplo n.º 8
0
            protected override void handle_result(TypeTags result)
            {
//@@@        Debug.Assert(!have_value);
                have_value = true;
                value      = result;
            }
Ejemplo n.º 9
0
 protected abstract void handle_result(TypeTags result);
Ejemplo n.º 10
0
    private void  fromJSONTags(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        JSONArrayValue json_array1 = json_value.array_value();

        if (json_array1 == null)
        {
            throw new Exception("The value for field Tags of DrinkRecipeJSON is not an array.");
        }
        int             count1       = json_array1.componentCount();
        List <TypeTags> vector_Tags1 = new List <TypeTags>(count1);

        for (int num1 = 0; num1 < count1; ++num1)
        {
            JSONStringValue json_string = json_array1.component(num1).string_value();
            if (json_string == null)
            {
                throw new Exception("The value for an element of field Tags of DrinkRecipeJSON is not a string.");
            }
            TypeTags the_open_enum = new TypeTags();
            switch (json_string.getData()[0])
            {
            case 'b':
                switch (json_string.getData()[1])
                {
                case 'i':
                    if ((String.Compare(json_string.getData(), 2, "tter", 0, 4, false) == 0) && (json_string.getData().Length == 6))
                    {
                        the_open_enum.in_known_list = true;
                        the_open_enum.list_value    = TypeTagsKnownValues.Tags_bitter;
                        goto open_enum_is_done;
                    }
                    break;

                case 'l':
                    if ((String.Compare(json_string.getData(), 2, "ue", 0, 2, false) == 0) && (json_string.getData().Length == 4))
                    {
                        the_open_enum.in_known_list = true;
                        the_open_enum.list_value    = TypeTagsKnownValues.Tags_blue;
                        goto open_enum_is_done;
                    }
                    break;

                default:
                    break;
                }
                break;

            case 'e':
                if ((String.Compare(json_string.getData(), 1, "asy", 0, 3, false) == 0) && (json_string.getData().Length == 4))
                {
                    the_open_enum.in_known_list = true;
                    the_open_enum.list_value    = TypeTagsKnownValues.Tags_easy;
                    goto open_enum_is_done;
                }
                break;

            case 'f':
                if ((String.Compare(json_string.getData(), 1, "ruity", 0, 5, false) == 0) && (json_string.getData().Length == 6))
                {
                    the_open_enum.in_known_list = true;
                    the_open_enum.list_value    = TypeTagsKnownValues.Tags_fruity;
                    goto open_enum_is_done;
                }
                break;

            case 'g':
                if ((String.Compare(json_string.getData(), 1, "reen", 0, 4, false) == 0) && (json_string.getData().Length == 5))
                {
                    the_open_enum.in_known_list = true;
                    the_open_enum.list_value    = TypeTagsKnownValues.Tags_green;
                    goto open_enum_is_done;
                }
                break;

            case 'r':
                if ((String.Compare(json_string.getData(), 1, "ed", 0, 2, false) == 0) && (json_string.getData().Length == 3))
                {
                    the_open_enum.in_known_list = true;
                    the_open_enum.list_value    = TypeTagsKnownValues.Tags_red;
                    goto open_enum_is_done;
                }
                break;

            case 's':
                switch (json_string.getData()[1])
                {
                case 't':
                    if ((String.Compare(json_string.getData(), 2, "rong", 0, 4, false) == 0) && (json_string.getData().Length == 6))
                    {
                        the_open_enum.in_known_list = true;
                        the_open_enum.list_value    = TypeTagsKnownValues.Tags_strong;
                        goto open_enum_is_done;
                    }
                    break;

                case 'w':
                    if ((String.Compare(json_string.getData(), 2, "eet", 0, 3, false) == 0) && (json_string.getData().Length == 5))
                    {
                        the_open_enum.in_known_list = true;
                        the_open_enum.list_value    = TypeTagsKnownValues.Tags_sweet;
                        goto open_enum_is_done;
                    }
                    break;

                default:
                    break;
                }
                break;

            case 'w':
                if ((String.Compare(json_string.getData(), 1, "eak", 0, 3, false) == 0) && (json_string.getData().Length == 4))
                {
                    the_open_enum.in_known_list = true;
                    the_open_enum.list_value    = TypeTagsKnownValues.Tags_weak;
                    goto open_enum_is_done;
                }
                break;

            default:
                break;
            }
            the_open_enum.in_known_list = false;
            the_open_enum.string_value  = json_string.getData();
            open_enum_is_done :;
            vector_Tags1.Add(the_open_enum);
        }
        initTags();
        for (int num1 = 0; num1 < vector_Tags1.Count; ++num1)
        {
            appendTags(vector_Tags1[num1]);
        }
        for (int num1 = 0; num1 < vector_Tags1.Count; ++num1)
        {
        }
    }