//Default implementation of PrintHtml for all types public static void PrintHtml(Asn1Type pThis, PEREffectiveConstraint cns, StreamWriterLevel o, int lev, List<string> comment, TypeAssigment tas, List<IConstraint> additonalConstraints) { o.WriteLine("<a name=\"{0}\"></a>", "ICD_" + tas.m_name.Replace("-", "_")); o.WriteLine("<table border=\"0\" width=\"100%\" >"); o.WriteLine("<tbody>"); o.WriteLine("<tr bgcolor=\"{0}\">", (tas.m_createdThroughTabulization ? "#379CEE" : "#FF8f00")); o.WriteLine("<td height=\"35\" colspan=\"2\" >"); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"4\">{0}</font><font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">({1}) </font>", tas.m_name, pThis.Name); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\"><a href=\"#{0}\">ASN.1</a></font>", "ASN1_" + tas.m_name.Replace("-", "_")); o.WriteLine("</td>"); o.WriteLine("<td height=\"35\" align=\"center\">"); o.WriteLine(" <font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">min = {0} bytes</font>", (pThis.MinBytesInPER == -1 ? "∞" : pThis.MinBytesInPER.ToString())); o.WriteLine("</td>"); o.WriteLine("<td height=\"35\" align=\"center\">"); o.WriteLine(" <font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">max = {0} bytes{1}</font>", (pThis.MaxBytesInPER == -1 ? "∞" : pThis.MaxBytesInPER.ToString()), pThis.MaxBitsInPER_Explained); o.WriteLine("</td>"); o.WriteLine("</tr>"); IInternalContentsInHtml pICIH = pThis as IInternalContentsInHtml; string tmp = string.Empty; if (pICIH != null) tmp = pICIH.InternalContentsInHtml(additonalConstraints); if (comment.Count > 0 || tmp.Length > 0) { o.WriteLine("<tr class=\"CommentRow\">"); o.WriteLine("<td class=\"comment2\" colspan=\"4\">" + o.BR(comment) + tmp + "</td>"); o.WriteLine("</tr>"); } o.WriteLine("<tr class=\"headerRow\">"); o.WriteLine("<td class=\"hrconstraint2\" colspan=\"2\">Constraints</td>"); o.WriteLine("<td class=\"hrMin2\">Min Length (bits)</td>"); o.WriteLine("<td class=\"hrMax2\">Max Length (bits)</td>"); o.WriteLine("</tr>"); o.WriteLine("<tr class=\"OddRow\">"); o.WriteLine(" <td class=\"constraint\" colspan=\"2\">{0}</td>", o.Constraint(pThis.Constraints + BaseConstraint.AsString(additonalConstraints))); o.WriteLine(" <td class=\"min\" >{0}</td>", pThis.MinBitsInPER); o.WriteLine(" <td class=\"max\" >{0}{1}</td>", pThis.MaxBitsInPER, pThis.MaxBitsInPER_Explained); o.WriteLine("</tr>"); o.WriteLine("</tbody>"); o.WriteLine("</table>"); }
public void PrintHtml(PEREffectiveConstraint cns, StreamWriterLevel o, int lev, List<string> comment, TypeAssigment tas, List<IConstraint> additonalConstraints) { ICDBType.PrintHtml(this, cns, o, lev, comment, tas, additonalConstraints); }
public void PrintHtml(PEREffectiveConstraint cns, StreamWriterLevel o, int lev, List<string> comment, TypeAssigment tas, List<IConstraint> additonalConstraints) { ((ICDType)Type).PrintHtml(cns, o, lev, comment, tas, m_constraints); }
public static void PrintHtml(SizeableType pThis, PEREffectiveConstraint cns, StreamWriterLevel o, int lev, List<string> comment, TypeAssigment tas, List<IConstraint> additonalConstraints) { WithComponentConstraint withComp = null; if (additonalConstraints != null && additonalConstraints.Count > 0) withComp = additonalConstraints[0] as WithComponentConstraint; o.WriteLine("<a name=\"{0}\"></a>", "ICD_" + tas.m_name.Replace("-", "_")); o.WriteLine("<table border=\"0\" width=\"100%\" >"); o.WriteLine("<tbody>"); o.WriteLine("<tr bgcolor=\"{0}\">", (tas.m_createdThroughTabulization ? "#379CEE" : "#FF8f00")); o.WriteLine("<td height=\"35\" colspan=\"3\">"); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"4\">{0}</font><font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">({1}) </font>", tas.m_name, pThis.Name); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\"><a href=\"#{0}\">ASN.1</a></font>", "ASN1_" + tas.m_name.Replace("-", "_")); o.WriteLine("</td>"); o.WriteLine("<td height=\"35\" colspan=\"2\" align=\"center\">"); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">min = {0} bytes</font>", (pThis.MinBytesInPER == -1 ? "∞" : pThis.MinBytesInPER.ToString())); o.WriteLine("</td>"); o.WriteLine("<td height=\"35\" colspan=\"2\" align=\"center\">"); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">max = {0} bytes</font>", (pThis.MaxBytesInPER == -1 ? "∞" : pThis.MaxBytesInPER.ToString())); o.WriteLine("</td>"); o.WriteLine("</tr>"); IInternalContentsInHtml pICIH = pThis as IInternalContentsInHtml; if (pICIH != null) comment.Add(pICIH.InternalContentsInHtml(additonalConstraints)); if (comment.Count > 0) { o.WriteLine("<tr class=\"CommentRow\">"); o.WriteLine("<td class=\"comment\" colspan=\"7\">" + o.BR(comment) + "</td>"); o.WriteLine("</tr>"); } o.WriteLine("<tr class=\"headerRow\">"); o.WriteLine("<td class=\"hrNo\">No</td>"); o.WriteLine("<td class=\"hrField\">Field</td>"); o.WriteLine("<td class=\"hrComment\">Comment</td>"); o.WriteLine("<td class=\"hrType\">Type</td>"); o.WriteLine("<td class=\"hrconstraint\">Constraint</td>"); o.WriteLine("<td class=\"hrMin\">Min Length (bits)</td>"); o.WriteLine("<td class=\"hrMax\">Max Length (bits)</td>"); o.WriteLine("</tr>"); IConstraint innerTypeConstraint = null; if (withComp != null) innerTypeConstraint = withComp.m_innerTypeConstraint; PrintSizeLengthHtml(pThis, cns, o, lev + 1, BaseConstraint.AsString(additonalConstraints)); PrintItemHtml(pThis, cns, o, 1, innerTypeConstraint); long mxItems = pThis.maxItems(cns); if (mxItems > 2 || mxItems==-1) { o.WriteLine("<tr class=\"CommentRow\">"); o.WriteLine("<td class=\"threeDots\" colspan=\"7\"> <p>. . .</p> </td>"); o.WriteLine("</tr>"); } if (pThis.maxItems(cns) >= 2 || mxItems==-1) PrintItemHtml(pThis, cns, o, pThis.maxItems(cns), innerTypeConstraint); o.WriteLine("</tbody>"); o.WriteLine("</table>"); }
public static void PrintHtml(SequenceOrSetType pThis, PEREffectiveConstraint cns, StreamWriterLevel o, int lev, List<string> comment, TypeAssigment tas, List<IConstraint> additonalConstraints) { WithComponentsSeqConstraint withCom = null; if (additonalConstraints!=null && additonalConstraints.Count > 0) withCom = additonalConstraints[0] as WithComponentsSeqConstraint; o.WriteLine("<a name=\"{0}\"></a>", "ICD_" + tas.m_name.Replace("-", "_")); o.WriteLine("<table border=\"0\" width=\"100%\" >"); o.WriteLine("<tbody>"); o.WriteLine("<tr bgcolor=\"{0}\">", (tas.m_createdThroughTabulization ? "#379CEE" : "#FF8f00")); o.WriteLine("<td height=\"35\" colspan=\"4\">"); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"4\">{0}</font><font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">({1}) </font>", tas.m_name, pThis.Name); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\"><a href=\"#{0}\">ASN.1</a></font>", "ASN1_" + tas.m_name.Replace("-", "_")); o.WriteLine("</td>"); o.WriteLine("<td height=\"35\" colspan=\"2\" align=\"center\">"); long minBytesInPER = pThis.MinBytesInPER; o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">min = {0} bytes</font>", (minBytesInPER == -1 ? "∞" : minBytesInPER.ToString())); o.WriteLine("</td>"); o.WriteLine("<td height=\"35\" colspan=\"2\" align=\"center\">"); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">max = {0} bytes</font>", (pThis.MaxBytesInPER == -1 ? "∞" : pThis.MaxBytesInPER.ToString())); o.WriteLine("</td>"); o.WriteLine("</tr>"); if (comment.Count > 0) { o.WriteLine("<tr class=\"CommentRow\">"); o.WriteLine("<td class=\"comment\" colspan=\"8\">" + o.BR(comment) + "</td>"); o.WriteLine("</tr>"); } o.WriteLine("<tr class=\"headerRow\">"); o.WriteLine("<td class=\"hrNo\">No</td>"); o.WriteLine("<td class=\"hrField\">Field</td>"); o.WriteLine("<td class=\"hrComment\">Comment</td>"); o.WriteLine("<td class=\"hrOptional\">Optional</td>"); o.WriteLine("<td class=\"hrType\">Type</td>"); o.WriteLine("<td class=\"hrconstraint\">Constraint</td>"); o.WriteLine("<td class=\"hrMin\">Min Length (bits)</td>"); o.WriteLine("<td class=\"hrMax\">Max Length (bits)</td>"); o.WriteLine("</tr>"); int index = 0; if (pThis.PreambleLength > 0) { PrintPreambleHtml(pThis, o, lev + 1); index = 1; } foreach (ICDSequenceOrSetTypeChild ch in pThis.m_children.Values) { WithComponentsConstraint.Component component = null; if (withCom != null && withCom.m_components.ContainsKey(ch.m_childVarName)) component = withCom.m_components[ch.m_childVarName]; ch.PrintHtml(o, lev + 1, ++index, component); } o.WriteLine("</tbody>"); o.WriteLine("</table>"); }
public void PrintHtml(PEREffectiveConstraint cns, StreamWriterLevel o, int lev, List<string> comment, TypeAssigment tas, List<IConstraint> additonalConstraints) { WithComponentsChConstraint withCom = null; if (additonalConstraints != null && additonalConstraints.Count > 0) withCom = additonalConstraints[0] as WithComponentsChConstraint; o.WriteLine("<a name=\"{0}\"></a>", "ICD_" + tas.m_name.Replace("-", "_")); o.WriteLine("<table border=\"0\" width=\"100%\" >"); o.WriteLine("<tbody>"); o.WriteLine("<tr bgcolor=\"{0}\">", (tas.m_createdThroughTabulization ? "#379CEE" : "#FF8f00")); o.WriteLine("<td height=\"35\" colspan=\"3\">"); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"4\">{0}</font><font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">({1}) </font>", tas.m_name, Name); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\"><a href=\"#{0}\">ASN.1</a></font>", "ASN1_" + tas.m_name.Replace("-", "_")); o.WriteLine("</td>"); o.WriteLine("<td height=\"35\" colspan=\"2\" align=\"center\">"); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">min = {0} bytes</font>", (MinBytesInPER == -1 ? "∞" : MinBytesInPER.ToString())); o.WriteLine("</td>"); o.WriteLine("<td height=\"35\" colspan=\"2\" align=\"center\">"); o.WriteLine("<font face=\"Verdana\" color=\"#FFFFFF\" size=\"2\">max = {0} bytes</font>", (MaxBytesInPER == -1 ? "∞" : MaxBytesInPER.ToString())); o.WriteLine("</td>"); o.WriteLine("</tr>"); if (comment.Count > 0) { o.WriteLine("<tr class=\"CommentRow\">"); o.WriteLine("<td class=\"comment\" colspan=\"7\">" + o.BR(comment) + "</td>"); o.WriteLine("</tr>"); } o.WriteLine("<tr class=\"headerRow\">"); o.WriteLine("<td class=\"hrNo\">No</td>"); o.WriteLine("<td class=\"hrField\">Field</td>"); o.WriteLine("<td class=\"hrComment\">Comment</td>"); o.WriteLine("<td class=\"hrType\">Type</td>"); o.WriteLine("<td class=\"hrconstraint\">Constraint</td>"); o.WriteLine("<td class=\"hrMin\">Min Length (bits)</td>"); o.WriteLine("<td class=\"hrMax\">Max Length (bits)</td>"); o.WriteLine("</tr>"); int index = 1; int chFldNo = 1; if (IsPERExtensible()) { PrintChoiceExtBitHtml(o, index, chFldNo); chFldNo++; index++; } if (m_children.Count > 1) { PrintChoiceIndexHtml(o, lev + 1, index, chFldNo); chFldNo++; index++; } foreach (ICDChoiceChild ch in m_children.Values) { WithComponentsConstraint.Component component = null; if (withCom != null && withCom.m_components.ContainsKey(ch.m_childVarName)) component = withCom.m_components[ch.m_childVarName]; ch.PrintHtml(o, lev + 1, index, chFldNo, component); index++; } o.WriteLine("</tbody>"); o.WriteLine("</table>"); }
public static ReferenceType CreateByName(TypeAssigment newTas) { ReferenceType ret = DefaultBackend.Instance.Factory.CreateReferenceType(); ret.m_referencedTypeName = newTas.m_name; ret.m_module = newTas.m_type.m_module; ret.antlrNode = newTas.m_type.antlrNode; return ret; }