示例#1
0
        /// <summary>
        /// Er moet wel iets meegegeven zijn. Als het meezit zelfs een bestandsnaam die we kunnen vinden?
        /// Er mag ook niks op de stack staan. Include moet op hoogste niveau.
        /// </summary>
        /// <param name="l"></param>
        public void Visit(Include l)
        {
            // Bestaand Bestand gevonden? Expressie gevonden?
            if (_tomatch.Count > 0)
            {
                _errors.Add(new IncludeFileShouldBeTopLevelException(l.SourceCodeContext));
                return;
            }
            string includefilename = l.Param;

            if (includefilename == String.Empty)
            {
                _errors.Add(new IncludeFileNotFoundException(l.SourceCodeContext, ""));
                return;
            }
            String includefilepath = TemplateUtil.Instance().CombineAndCompact(Path.GetDirectoryName(l.SourceCodeContext.Filename), includefilename);

            if (!File.Exists(includefilepath))
            {
                _errors.Add(new IncludeFileNotFoundException(l.SourceCodeContext, includefilepath));
            }
        }