예제 #1
0
        private void xmlLex()
        {
            string xml = "";

            xml += "<ListaLexemas>\n";
            for (int i = 0; i < Lexemas.Count; i++)
            {
                Lexema at = (Lexema)Lexemas[i];
                xml += "  <Error>\n";
                xml += "      <Identificador>" + at.getID() + "</Identificador>\n";
                xml += "      <Lexema>" + at.getCadena() + "</Lexema>\n";
                xml += "      <Evaluacion>" + at.getEstado() + "</Evaluacion>\n";

                xml += "  </Error>\n";


                xml += "</ListaLexemas>\n";
            }
            StreamWriter File = new StreamWriter("RLexemas.xml");

            File.Write(xml);
            File.Close();
        }
예제 #2
0
        private void htmlLex()
        {
            string html = "";

            html += "<!DOCTYPE html>  \n";
            html += "<html>  \n";
            html += "<head><title>Reporte de tokens</title></head>  \n";
            html += "<body> \n";
            html += "<h1>Listado de cursos</h1>  \n";
            html += "<table border=\"1px\" solid #0000 border-collapse: collapse>   \n";
            html += "<tr>  \n";
            html += "<th border=\"1px\" solid #0000 border-collapse: collapse> Identificador</th>  \n";
            html += "<th border=\"1px\" solid #0000 border-collapse: collapse> Lexema</th>  \n";
            html += "<th border=\"1px\" solid #0000 border-collapse: collapse> Aceptacion</th>  \n";

            html += "</tr>  \n";
            for (int i = 0; i < Lexemas.Count; i++)
            {
                Lexema at = (Lexema)Lexemas[i];
                html += "<tr> \n";
                html += "<td border=\"1px\" solid #0000 border-collapse: collapse> " + at.getID() + "</td>  \n";
                html += "<td border=\"1px\" solid #0000 border-collapse: collapse> " + at.getCadena() + "</td>  \n";
                html += "<td border=\"1px\" solid #0000 border-collapse: collapse> " + at.getEstado() + "</td>  \n";


                html += "</tr> \n";
            }


            html += "</table> \n";
            html += "</body>  \n";
            html += "</html>  \n";
            StreamWriter FilaEThtml = new StreamWriter("RLexemas.html");

            FilaEThtml.Write(html);
            FilaEThtml.Close();
        }