Пример #1
0
        public override string OutputXML(int level)
        {
            string output = "";

            FileFormatter.AddIndentation(ref output, level);
            output += "<" + XMLTags.ClassDefinitionNodeTag + " Name=\"" + m_name + "\"";
            if (ImplementsWorld)
            {
                output += " " + XMLTags.worldAttribute + "=\"" + m_world + "\"";
            }
            output += ">\n";

            foreach (string baseClass in m_baseClasses)
            {
                ParameterizedObject baseClassObject = CppSourceParser.GetNamedParamObject(baseClass);
                if (baseClassObject != null)
                {
                    foreach (IParameter param in baseClassObject.Parameters)
                    {
                        base.addParameter(param);//output += baseClassObject.outputChildrenXML(level + 1);
                    }
                }
                else
                {
                    Console.WriteLine("Warning." + m_name + " class extends base class " + baseClass
                                      + " but definition has not been found. Ignore if the base class is a template class without any parameters.");
                }
            }
            output += OutputChildrenXML(level + 1);
            FileFormatter.AddIndentation(ref output, level);
            output += "</" + XMLTags.ClassDefinitionNodeTag + ">\n";
            return(output);
        }
Пример #2
0
        public string AsXML(int level)
        {
            string output = "";

            FileFormatter.AddIndentation(ref output, level);
            string typeTag;

            switch (m_type)
            {
            case WorldParser.WorldParameterType.StateVariable: typeTag = XMLTags.stateVarTag; break;

            case WorldParser.WorldParameterType.ActionVariable: typeTag = XMLTags.actionVarTag; break;

            default: typeTag = XMLTags.constantTag; break;
            }
            output += "<" + typeTag + " " + XMLTags.nameAttribute + "=\"" + m_name + "\"";
            if (m_type != WorldParser.WorldParameterType.Constant)
            {
                output += " " + XMLTags.minValueAttribute
                          + "=\"" + m_min + "\" " + XMLTags.maxValueAttribute + "=\"" + m_max + "\" "
                          + XMLTags.unitAttribute + "=\"" + m_unit + "\"/>\n";
            }
            else
            {
                output += "/>\n";
            }
            return(output);
        }
Пример #3
0
        public string AsXML(int level)
        {
            string output = "";

            FileFormatter.AddIndentation(ref output, level);
            output += "<" + m_xmlTag + " Name=\"" + m_name + "\" Comment=\"" + m_comment + "\" Default=\""
                      + m_default + "\"/>\n";
            return(output);
        }
Пример #4
0
        public string AsXML(int level)
        {
            string output = "";

            FileFormatter.AddIndentation(ref output, level);
            output += "<" + XMLTags.multiValuedNodeTag + " " + XMLTags.nameAttribute + "=\"" + m_name
                      + "\" " + XMLTags.classAttribute + "=\"" + m_className + "\" " + XMLTags.commentAttribute
                      + "=\"" + m_comment + "\" " + XMLTags.defaultAttribute + "=\"" + m_default + "\"/>\n";
            return(output);
        }
Пример #5
0
        public override string OutputXML(int level)
        {
            string output = "";

            FileFormatter.AddIndentation(ref output, level);
            output += "<" + XMLTags.ClassDefinitionNodeTag + " Name=\"" + m_name + "\">\n";
            output += OutputChildrenXML(level + 1);
            FileFormatter.AddIndentation(ref output, level);
            output += "</" + XMLTags.ClassDefinitionNodeTag + ">\n";
            return(output);
        }
Пример #6
0
        public string AsXML(int level)
        {
            string output = "";

            FileFormatter.AddIndentation(ref output, level);
            output += "<" + XMLTags.multiValuedNodeTag + " " + XMLTags.nameAttribute + "=\"" + m_name
                      + "\" " + XMLTags.classAttribute + "=\"" + m_className + "-Factory\" " + XMLTags.commentAttribute
                      + "=\"" + m_comment + "\"";
            if (m_bOptional)
            {
                output += " " + XMLTags.optionalAttribute + "=\"True\"";
            }
            output += "/>\n";
            return(output);
        }
Пример #7
0
        public string AsXML(int level)
        {
            string output = "";

            FileFormatter.AddIndentation(ref output, level);
            output += "<" + XMLTags.choiceNodeTag + " " + XMLTags.nameAttribute + "=\"" + m_name
                      + "\" " + XMLTags.classAttribute + "=\"" + m_className + "\" " + XMLTags.commentAttribute
                      + "=\"" + m_comment + "\">\n";
            foreach (IParameter parameter in m_parameters)
            {
                output += parameter.AsXML(level + 1);
            }
            FileFormatter.AddIndentation(ref output, level);
            output += "</" + XMLTags.choiceNodeTag + ">\n";
            return(output);
        }
Пример #8
0
        public override string OutputXML(int level)
        {
            string output = "";

            FileFormatter.AddIndentation(ref output, level);
            output += "<" + XMLTags.EnumDefinitionNodeTag + " " + XMLTags.nameAttribute + "=\"" + m_name + "\">\n";
            output += OutputChildrenXML(level + 1);
            foreach (string value in m_enumerationValues)
            {
                FileFormatter.AddIndentation(ref output, level + 1);
                output += "<" + XMLTags.enumNodeTag + ">" + value + "</" + XMLTags.enumNodeTag + ">\n";
            }
            FileFormatter.AddIndentation(ref output, level);
            output += "</" + XMLTags.EnumDefinitionNodeTag + ">\n";
            return(output);
        }
Пример #9
0
        public string AsXML(int level)
        {
            string output = "";

            FileFormatter.AddIndentation(ref output, level);
            output += "<" + XMLTags.branchNodeTag + " " + XMLTags.nameAttribute + "=\"" + m_name
                      + "\" " + XMLTags.classAttribute + "=\"" + m_className + "\" " + XMLTags.commentAttribute
                      + "=\"" + m_comment + "\"";
            if (m_bOptional)
            {
                output += " " + XMLTags.optionalAttribute + "=\"True\"";
            }
            if (m_badgerMetadata != "")
            {
                output += " " + XMLTags.badgerMetadataAttribute + "=\"" + m_badgerMetadata + "\"";
            }
            output += "/>\n";
            return(output);
        }
Пример #10
0
        public string AsXML(int level)
        {
            string output = "";

            FileFormatter.AddIndentation(ref output, level);
            string className = m_className;

            if (m_type == Type.Factory)
            {
                className += "-Factory";
            }
            output += "<" + XMLTags.choiceElementNodeTag + " " + XMLTags.nameAttribute + "=\"" + m_name
                      + "\" " + XMLTags.classAttribute + "=\"" + className + "\"";
            if (m_badgerMetadata != null)
            {
                output += " " + XMLTags.badgerMetadataAttribute + "=\"" + m_badgerMetadata + "\"";
            }
            output += "/>\n";

            return(output);
        }
Пример #11
0
        public string AsXML(int level)
        {
            string output = "";

            FileFormatter.AddIndentation(ref output, level);
            if (m_type == VarType.StateVariable)
            {
                output += "<" + XMLTags.stateVarRefTag;
            }
            else if (m_type == VarType.ActionVariable)
            {
                output += "<" + XMLTags.actionVarRefTag;
            }
            else
            {
                output += "<" + XMLTags.WireTag;
            }
            output += " " + XMLTags.nameAttribute + "=\"" + m_name + "\" " + XMLTags.commentAttribute + "=\""
                      + m_comment + "\"/>\n";
            return(output);
        }