Esempio n. 1
0
 public Model.CSSDocument ParseStream(Stream stream)
 {
     StringBuilder sb = new StringBuilder();
     TextWriter errorCatch = new StringWriter(sb);
     Scanner scanner = new Scanner(stream);
     Parser parser = new Parser(scanner);
     parser.errors.errorStream = errorCatch;
     parser.Parse();
     doc = parser.CSSDoc;
     SpitErrors(sb);
     return doc;
 }
Esempio n. 2
0
        public List<Token> GetTokens(string file)
        {
            StringBuilder sb = new StringBuilder();
            TextWriter errorCatch = new StringWriter(sb);
            Scanner scanner = new Scanner(file);

            List<Token> ts = new List<Token>();
            Token t = scanner.Scan();
            if (t.val != "\0") { ts.Add(t); }
            while (t.val != "\0") {
                t = scanner.Scan();
                ts.Add(t);
            }
            return ts;
        }
Esempio n. 3
0
 /*------------------------------------------------------------------------*
  *----- SCANNER DESCRIPTION ----------------------------------------------*
  *------------------------------------------------------------------------*/
 public Parser(Scanner scanner)
 {
     this.scanner = scanner;
     errors = new Errors();
 }