Exemple #1
0
 private string ReadSparClass(ref System.IO.StreamReader file)
 {
     string line = string.Empty;
     if ((line = file.ReadLine()) != null)
     {
         file.BaseStream.Position = 0;
         file.DiscardBufferedData();
         return line;
     }
     return line;
 }
Exemple #2
0
 private List<string> ReadColumns(ref System.IO.StreamReader file, string FirstLine)
 {
     List<string> col = new List<string>();
     string line = string.Empty;
     string[] elements;
     int Index = 0;
     while ((line = file.ReadLine()) != null)
     {
         if((line.Equals(FirstLine)))
             continue;
         if ((line.Equals(Environment.NewLine)) || (line.Equals(string.Empty)))
             break;
         elements = line.Split('=');
         col.Add(elements[0].Trim());
         Index++;
     }
     file.BaseStream.Position = 0;
     file.DiscardBufferedData();
     return col;
 }
Exemple #3
0
        private List<List<string>> ReadRows(ref System.IO.StreamReader  file, string FirstLine)
        {
            List<List<string>> Rows = new List<List<string>>();
            List<string> RowData = new List<string>();
            string line = string.Empty;
            while ((line = file.ReadLine()) != null)
            {
                string[] elements;
                if ((line.Equals(FirstLine)))
                    continue;
                if ((line.Equals(Environment.NewLine)) || (line.Equals(string.Empty)))
                {
                    Rows.Add(RowData);
                    RowData = new List<string>();
                }
                else if (line.Contains('='))
                {
                    elements = line.Split('=');
                    RowData.Add(elements[1].Trim());
                }
                else
                {
                    // Do nothing
                }

            }
            if (file.EndOfStream)
            {
                Rows.Add(RowData);
            }
            file.BaseStream.Position = 0;
            file.DiscardBufferedData();
            return Rows;
        }
Exemple #4
0
        static void mostrarTokens(TinyLexer lexer, System.IO.StreamReader input)
        {
            Console.WriteLine("####### Inicio del análisis léxico #######");
            Symbol symbol;
            while ((symbol = lexer.next_token()).sym != TokenDef.EOF)
            {
                Utilidades.dumpToken(System.Console.Out, symbol);
            }

            input.BaseStream.Position = 0;
            input.DiscardBufferedData();
            Console.WriteLine("####### Fin del análisis léxico #######");
        }