Exemple #1
0
        private Skin(string skinFileName)
        {
            IParser parser = ParserFactory.CreateParser();

            using (StreamReader sr = new StreamReader(skinFileName, WebAppConfig.TemplateFileEncoding))
            {
                string text = sr.ReadToEnd();
                compilationUnit = parser.Parse(text);
            }
        }
Exemple #2
0
        public CompilationUnit Parse(TokenCollection tokens)
        {
            _tokens = tokens;
            _index  = 0;

            CompilationUnit compilationUnit = new CompilationUnit();

            try
            {
                Advance();

                while (_curtok != _eof)
                {
                    compilationUnit.Statements.Add(ParseStatement());
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(compilationUnit);
        }
Exemple #3
0
        public CompilationUnit Parse(TokenCollection tokens)
        {
            _tokens = tokens;
            _index = 0;

            CompilationUnit compilationUnit = new CompilationUnit();

            try
            {
                Advance();

                while (_curtok != _eof)
                {
                    compilationUnit.Statements.Add(ParseStatement());
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return compilationUnit;
        }