Exemplo n.º 1
0
        protected override void EmitEntryPoint(MethodBuilder /*!*/ methodBuilder)
        {
            ScriptBuilder script_builder = GetEntryScriptBuilder();

            Debug.Assert(script_builder.CompilationUnit is ScriptCompilationUnit);

            if (script_builder == null)
            {
                throw new InvalidOperationException(CoreResources.GetString("entrypoint_not_specified"));
            }

            PhpSourceFile entry_file = ((ScriptCompilationUnit)script_builder.CompilationUnit).SourceUnit.SourceFile;

            ILEmitter il = new ILEmitter(methodBuilder);

            // LOAD new PhpScript.MainHelperDelegate(Default.Main);
            il.Emit(OpCodes.Ldnull);
            il.Emit(OpCodes.Ldftn, script_builder.MainHelper);
            il.Emit(OpCodes.Newobj, Constructors.MainHelperDelegate);

            // LOAD <source name>
            il.Emit(OpCodes.Ldstr, entry_file.RelativePath.ToString());

            // LOAD Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location)
            il.Emit(OpCodes.Call, Methods.Assembly.GetEntryAssembly);
            il.Emit(OpCodes.Callvirt, Properties.Assembly_Location.GetGetMethod());
            il.Emit(OpCodes.Call, Methods.Path.GetDirectoryName);

            // ScriptContext.RunApplication(<main helper delegate>, <source name>, <entry assembly directory> );
            il.Emit(OpCodes.Call, Methods.ScriptContext.RunApplication);

            // RETURN;
            il.Emit(OpCodes.Ret);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SyntaxParser" /> class.
        /// </summary>
        /// <param name="sourceFile">PHP source file representation</param>
        /// <param name="code">Source code of PHP script</param>
        public SyntaxParser(PhpSourceFile /*!*/ sourceFile, string /*!*/ code)
        {
            sourceUnit = new VirtualSourceFileUnit(compilationUnit, code, sourceFile, Encoding.Default);
            compilationUnit.SourceUnit = sourceUnit;

            // Assembly of the application is used instead of non-existing PHP script assembly.
            // To compile PHP, follow the basic technique of Phalanger PHP compilation.
            // <seealso cref="ScriptContext.CurrentContext" />
            // <seealso cref="ApplicationContext.Default" />
            // <seealso cref="ApplicationContext.AssemblyLoader" />
            var assembly       = System.Reflection.Assembly.GetExecutingAssembly();
            var assemblyName   = assembly.GetName();
            var scriptAssembly = new BasicScriptAssembly(assembly, assemblyName, compilationUnit);

            // TODO: It simulates command compilationUnit.module = scriptAssembly.Module;
            // It affects compilationUnit.ScriptModule and compilationUnit.ScriptBuilder too
            var type  = compilationUnit.GetType();
            var field = type.GetField("module", BindingFlags.NonPublic | BindingFlags.Instance);

            field.SetValue(compilationUnit, scriptAssembly.GetModule());

            IsParsed = false;
            output   = new StringWriter(assemblyName.CultureInfo);
            Errors   = new ErrorSinkThrowingException();
        }
Exemplo n.º 3
0
 public TransientCompilationUnit(string /*!*/ sourceCode, PhpSourceFile /*!*/ sourceFile, Encoding /*!*/ encoding, NamingContext namingContext, int line, int column, bool client)
 {
     Debug.Assert(sourceCode != null && sourceFile != null && encoding != null);
     Debug.Assert(!client);
     this.sourceUnit        = new SourceCodeUnit(this, sourceCode, sourceFile, encoding, line, column);
     this.sourceUnit.Naming = namingContext ?? new NamingContext(null, null);    // cant be null
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates an instance of of multi-script assembly builder.
 /// </summary>
 /// <param name="applicationContext">Application context.</param>
 /// <param name="assemblyName">Name of the assembly.</param>
 /// <param name="directory">Directory where assembly will be stored.</param>
 /// <param name="fileName">Name of the assembly file including an extension.</param>
 /// <param name="kind">Assembly file kind.</param>
 /// <param name="debug">Whether to include debug information.</param>
 /// <param name="force32bit">Whether to force 32bit execution of generated assembly.</param>
 /// <param name="entryPoint">Entry point.</param>
 /// <param name="icon">Icon.</param>
 /// <param name="resources">Resources to embed</param>
 public MultiScriptAssemblyBuilder(ApplicationContext /*!*/ applicationContext, AssemblyName assemblyName,
                                   string directory, string fileName, AssemblyKinds kind, ICollection <ResourceFileReference> resources,
                                   bool debug, bool force32bit, Win32IconResource icon, PhpSourceFile entryPoint)
     : base(new MultiScriptAssembly(applicationContext), assemblyName, directory, fileName, kind, resources, debug, force32bit, false, icon)
 {
     this.entryPoint = entryPoint;
 }
Exemplo n.º 5
0
 public TransientCompilationUnit(string /*!*/ sourceCode, PhpSourceFile /*!*/ sourceFile, Encoding /*!*/ encoding, NamingContext namingContext, int line, int column, bool client)
 {
     Debug.Assert(sourceCode != null && sourceFile != null && encoding != null);
     Debug.Assert(!client);
     this.sourceUnit = new SourceCodeUnit(this, sourceCode, sourceFile, encoding, line, column);
     this.sourceUnit.AddImportedNamespaces(namingContext);
 }
Exemplo n.º 6
0
        /// <summary>
        /// Gets the node of the graph associated with the specified source file.
        /// First, look up the table of processed nodes.
        /// If not there, check compiled units maintained by the manager.
        /// If it is not found in the manager's cache the source file is locked so that other compilers will
        /// wait until we finish compilation of the node. The new node is created if the compilation unit doesn't exist for it.
        /// </summary>
        internal CompilationUnit GetNode(PhpSourceFile /*!*/ sourceFile)
        {
            CompilationUnit result;

            if (!nodes.TryGetValue(sourceFile, out result))
            {
                ScriptModule module;

                module = (ScriptModule)context.Manager.LockForCompiling(sourceFile, context);

                if (module != null)
                {
                    result = module.CompilationUnit;
                }
                else
                {
                    ScriptCompilationUnit scriptResult = new ScriptCompilationUnit();
                    scriptResult.SourceUnit = new SourceFileUnit(scriptResult, sourceFile, context.Config.Globalization.PageEncoding);
                    result = scriptResult;
                }
                nodes.Add(sourceFile, result);
                NodeAdded(result);
            }

            return(result);
        }
Exemplo n.º 7
0
        /// <summary>
        /// The argument <paramref name="completeSource" /> determines whether the source code
        /// is complete PHP script file, which is a case in dynamic includ in Silverlight
        /// </summary>
        public TransientCompilationUnit Build(string /*!*/ sourceCode, SourceCodeDescriptor descriptor,
                                              EvalKinds kind, CompilationContext /*!*/ context, ScriptContext /*!*/ scriptContext,
                                              DTypeDesc referringType, NamingContext namingContext, bool completeSource)
        {
            PhpSourceFile source_file = new PhpSourceFile(context.Config.Compiler.SourceRoot,
                                                          RelativePath.ParseCanonical(descriptor.ContainingSourcePath));

            Encoding encoding = context.Config.Globalization.PageEncoding;

            TransientCompilationUnit result = new TransientCompilationUnit
                                                  (sourceCode, source_file, encoding, namingContext, descriptor.Line, descriptor.Column, completeSource);

            if (!result.PreCompile(context, scriptContext, descriptor, kind, referringType))
            {
                return(null);
            }

            DefineGlobalType(((TransientModuleBuilder)result.ModuleBuilder).AssemblyBuilder.RealModuleBuilder);
            if (!result.Compile(context, kind))
            {
                return(null);
            }

            BakeGlobals();
            result.PostCompile(descriptor);
            return(result);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Gets a script module associated with a specified source file.
        /// </summary>
        public override ScriptModule GetScriptModule(PhpSourceFile /*!*/ sourceFile)
        {
            ScriptModule result;

            scripts.TryGetValue(sourceFile, out result);
            return(result);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Determine if script specified by <paramref name="fullPath"/> is loaded in script library.
        /// </summary>
        /// <param name="fullPath">The script path.</param>
        /// <returns>True if given script is loaded.</returns>
        internal bool ScriptExists(FullPath fullPath)
        {
            EnsureLibraryReflected();

            PhpSourceFile source_file = new PhpSourceFile(Configuration.Application.Compiler.SourceRoot, fullPath);

            return(modules.ContainsKey(source_file));
        }
Exemplo n.º 10
0
        public CompilationSourceUnit(CompilationUnitBase /*!*/ compilationUnit, PhpSourceFile /*!*/ sourceFile, Encoding /*!*/ encoding, ILineBreaks /*!*/ lineBreaks)
            : base(sourceFile, encoding, lineBreaks)
        {
            Debug.Assert(compilationUnit != null);

            this.compilationUnit           = compilationUnit;
            this.namingContextFieldBuilder = null;        // to be filled during compilation just before the unit gets emitted
            this.symbolDocumentWriter      = null;        // to be filled during compilation just before the unit gets emitted
        }
Exemplo n.º 11
0
        /// <summary>
        /// Parse PHP code and return its AST.
        /// </summary>
        /// <param name="code">The PHP code to be parsed.</param>
        /// <param name="encoding">Encoding of the source code.</param>
        /// <param name="lang">Language features that may change parser behavior.</param>
        /// <param name="file">PHP Source file with the file name &amp; location</param>
        /// <returns>Returns the parsed AST node.</returns>
        public AST.GlobalCode ParseString(string code, Encoding encoding, PhpSourceFile file, LanguageFeatures lang)
        {
            PhpScriptSourceUnit srcUnit = new PhpScriptSourceUnit(this, code, file, encoding, 0, 0);

            using (StringReader reader = new StringReader(code))
            {
                Parser parser = new Parser();
                return(parser.Parse(srcUnit, reader, new ParserErrorSink(), this, Lexer.LexicalStates.INITIAL, lang));
            }
        }
Exemplo n.º 12
0
        public SourceUnit(CompilationUnitBase /*!*/ compilationUnit, PhpSourceFile /*!*/ sourceFile, Encoding /*!*/ encoding)
        {
            Debug.Assert(compilationUnit != null && sourceFile != null && encoding != null);

            this.compilationUnit           = compilationUnit;
            this.sourceFile                = sourceFile;
            this.encoding                  = encoding;
            this.namingContextFieldBuilder = null;        // to be filled during compilation just before the unit gets emitted
            this.symbolDocumentWriter      = null;        // to be filled during compilation just before the unit gets emitted
        }
Exemplo n.º 13
0
        /// <summary>
        /// Gets a script module associated with a specified source file.
        /// </summary>
        public override PhpModule GetModule(PhpSourceFile /*!*/ sourceFile)
        {
            Debug.Assert(sourceFile != null);

            EnsureLibraryReflected();

            ScriptModule result;

            modules.TryGetValue(sourceFile, out result);
            return(result);
        }
Exemplo n.º 14
0
        /// <summary>
        /// Returns metric info created from given test.
        /// </summary>
        /// <param name="test">Test which source will be used for metric info generating.</param>
        /// <returns>Generated metric info.</returns>
        internal static MetricInfo GetInfo(SourceTest test)
        {
            var uid        = GetTestFileUID();
            var fileName   = string.Format(CultureInfo.InvariantCulture, "./test{0}.php", uid);
            var sourceFile = new PhpSourceFile(new FullPath(Path.GetDirectoryName(fileName)),
                                               new FullPath(fileName));

            using (var parser = new SyntaxParser(sourceFile, "<?php " + test.SourceCode + " ?>"))
            {
                return(MetricInfo.FromParsers(true, parser));
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// Reads code from file name and return syntax parser.
        /// </summary>
        /// <param name="fileName">file name to read</param>
        /// <returns>Syntax parser object ready to parser given file</returns>
        private static SyntaxParser GenerateParser(string fileName)
        {
            string code;

            using (StreamReader reader = new StreamReader(fileName))
            {
                code = reader.ReadToEnd();
            }

            PhpSourceFile source_file = new PhpSourceFile(new FullPath(Path.GetDirectoryName(fileName)), new FullPath(fileName));

            return(new SyntaxParser(source_file, code));
        }
Exemplo n.º 16
0
        static SyntaxParser InitializeParser(string phpCode, string fileName)
        {
            PhpSourceFile source_file = new PhpSourceFile(new FullPath(Path.GetDirectoryName(fileName)), new FullPath(fileName));
            SyntaxParser  parser      = new SyntaxParser(source_file, phpCode);

            parser.Parse();
            if (parser.Ast == null)
            {
                throw new ArgumentException("The specified input cannot be parsed.");
            }

            return(parser);
        }
Exemplo n.º 17
0
        /// <summary>
        /// Creates a confrolflow graph from fileName in parameter.
        /// </summary>
        /// <param name="phpCode">source code in string</param>
        /// <param name="fileName">name of the file</param>
        /// <returns>new instace of ControlFlowGraph</returns>
        public static ControlFlowGraph FromSource(string phpCode, string fileName)
        {
            PhpSourceFile source_file = new PhpSourceFile(new FullPath(Path.GetDirectoryName(fileName)), new FullPath(fileName));
            SyntaxParser  parser      = new SyntaxParser(source_file, phpCode);

            parser.Parse();
            if (parser.Ast == null)
            {
                throw new ArgumentException("The specified input cannot be parsed.");
            }

            return(new ControlFlowGraph(parser.Ast, new FileInfo(fileName)));
        }
Exemplo n.º 18
0
        internal static ControlFlowGraph.ControlFlowGraph CreateCFG(string code, FileInfo file)
        {
            var fileName   = "./cfg_test.php";
            var sourceFile = new PhpSourceFile(new FullPath(Path.GetDirectoryName(fileName)), new FullPath(fileName));

            code = "<?php \n" + code + "?>";
            var parser = new SyntaxParser(sourceFile, code);

            parser.Parse();
            var cfg = ControlFlowGraph.ControlFlowGraph.FromSource(parser.Ast, file);

            return(cfg);
        }
Exemplo n.º 19
0
        /// <summary>
        /// Makes a deep copy of the AST expression e in a parameter.
        /// Finds the code of e and than creates a copy of e by parsing the code.
        ///
        /// See <see cref="DeepCopyAstExpressionCopyVisitor"/> to other method
        /// of creating a copy of an expression.
        /// </summary>
        /// <param name="e">expression to copy.</param>
        /// <returns></returns>
        private static Expression DeepCopyAstExpressionByParsing(ControlFlowGraph graph, Expression e)
        {
            //known bug
            //when creating cfg from function of method, we need global code
            //probably need lot of refacotring
            //or getting the global code for every function or method
            if (graph.globalCode == null)
            {
                return(e);
            }
            StringBuilder s = new StringBuilder("<? ");

            if (e.Position.FirstLine == 1)
            {
                for (int i = 3; i < e.Position.FirstOffset; i++)
                {
                    s.Append(" ");
                }
            }
            else
            {
                for (int i = 3 + e.Position.FirstLine - 1 + e.Position.FirstColumn - 1; i < e.Position.FirstOffset; i++)
                {
                    s.Append(" ");
                }

                for (int i = 1; i < e.Position.FirstLine; i++)
                {
                    s.Append("\n");
                }

                for (int i = 1; i < e.Position.FirstColumn; i++)
                {
                    s.Append(" ");
                }
            }
            s.Append(graph.globalCode.SourceUnit.GetSourceCode(e.Position));
            s.Append(" ?>");

            var sourceFile = new PhpSourceFile(new FullPath(Path.GetDirectoryName(graph.File.FullName)),
                                               new FullPath(graph.File.FullName));
            SyntaxParser parser = new SyntaxParser(sourceFile, s.ToString());

            parser.Parse();
            return((parser.Ast.Statements[0] as ExpressionStmt).Expression);
        }
Exemplo n.º 20
0
        /// <summary>
        /// Create new <see cref="ProgramPointGraph"/> object from PHP source code
        /// </summary>
        /// <param name="code">The source code without &lt;?php and ?&gt;</param>
        /// <returns><see cref="ProgramPointGraph"/> that contains CFG and memory model</returns>
        public static ForwardAnalysis GenerateForwardAnalysis(string code)
        {
            var fileName = "./cfg_test.php";
            var fullPath = new FullPath(Path.GetDirectoryName(fileName));
            var file     = new FileInfo(fileName);

            var sourceFile = new PhpSourceFile(fullPath, new FullPath(fileName));

            code = "<?php\n" + code + "\n?>";

            var parser = new SyntaxParser(sourceFile, code);

            parser.Parse();
            var cfg = Weverca.ControlFlowGraph.ControlFlowGraph.FromSource(parser.Ast, file);

            return(new ForwardAnalysis(cfg, MemoryModels.MemoryModels.ModularCopyMM, 50));
        }
Exemplo n.º 21
0
        public static int GetLastModification()
        {
            try
            {
                PhpSourceFile file = ScriptContext.CurrentContext.MainScriptFile;
                if (file == null)
                {
                    return(-1);
                }

                return(DateTimeUtils.UtcToUnixTimeStamp(File.GetLastWriteTime(file.FullPath).ToUniversalTime()));
            }
            catch (System.Exception)
            {
                return(-1);
            }
        }
Exemplo n.º 22
0
 public VirtualSourceFileUnit(CompilationUnitBase /*!*/ compilationUnit, string /*!*/ code,
                              PhpSourceFile /*!*/ sourceFile, Encoding /*!*/ encoding)
     : base(compilationUnit, sourceFile, encoding)
 {
     this.code = code;
 }
Exemplo n.º 23
0
 public PhpScriptSourceUnit(CompilationUnitBase /*!*/ compilationUnit, string /*!*/ code, PhpSourceFile /*!*/ sourceFile,
                            Encoding /*!*/ encoding, int line, int column)
     : base(compilationUnit, code, sourceFile, encoding, line, column)
 {
     this.initialState = Lexer.LexicalStates.INITIAL;
 }
Exemplo n.º 24
0
        public SourceCodeUnit(CompilationUnitBase /*!*/ compilationUnit, string /*!*/ code, PhpSourceFile /*!*/ sourceFile,
                              Encoding /*!*/ encoding, int line, int column)
            : base(compilationUnit, sourceFile, encoding)
        {
            this.code   = code;
            this.line   = line;
            this.column = column;

            this.initialState = Lexer.LexicalStates.ST_IN_SCRIPTING;
        }
Exemplo n.º 25
0
 public SourceFileUnit(CompilationUnitBase /*!*/ compilationUnit, PhpSourceFile /*!*/ sourceFile, Encoding /*!*/ encoding)
     : base(compilationUnit, sourceFile, encoding)
 {
     Debug.Assert(!(compilationUnit is TransientCompilationUnit) && encoding != null && sourceFile != null);
 }
Exemplo n.º 26
0
		public TransientCompilationUnit(string/*!*/ sourceCode, PhpSourceFile/*!*/ sourceFile, Encoding/*!*/ encoding, NamingContext namingContext, int line, int column, bool client)
		{
			Debug.Assert(sourceCode != null && sourceFile != null && encoding != null);
			Debug.Assert(!client);
			this.sourceUnit = new SourceCodeUnit(this, sourceCode, sourceFile, encoding, line, column);
            this.sourceUnit.Naming = namingContext ?? new NamingContext(null, null);    // cant be null
		}
Exemplo n.º 27
0
		/// <summary>
		/// Gets a script module associated with a specified source file.
		/// </summary>
		public override PhpModule GetModule(PhpSourceFile/*!*/ sourceFile)
		{
            Debug.Assert(sourceFile != null);

            EnsureLibraryReflected();

			ScriptModule result;
			modules.TryGetValue(sourceFile, out result);
			return result;
		}
Exemplo n.º 28
0
 public override PhpModule GetModule(PhpSourceFile name)
 {
     return(module);
 }
Exemplo n.º 29
0
		/// <summary>
		/// Gets a full qualified name of a script type given a sub-namespace.
		/// </summary>
		/// <param name="sourceFile">Source file.</param>
		/// <returns>The qualified name.</returns>
		public string GetQualifiedScriptTypeName(PhpSourceFile/*!*/ sourceFile)
		{
			Debug.Assert(sourceFile != null);

			return GetQualifiedScriptTypeName(ScriptModule.GetSubnamespace(sourceFile.RelativePath, true));
		}
Exemplo n.º 30
0
		public TransientCompilationUnit(string/*!*/ sourceCode, PhpSourceFile/*!*/ sourceFile, Encoding/*!*/ encoding, NamingContext namingContext, int line, int column, bool client)
		{
			Debug.Assert(sourceCode != null && sourceFile != null && encoding != null);
			Debug.Assert(!client);
			this.sourceUnit = new SourceCodeUnit(this, sourceCode, sourceFile, encoding, line, column);
			this.sourceUnit.AddImportedNamespaces(namingContext);
		}
Exemplo n.º 31
0
 public override PhpModule GetModule(PhpSourceFile name) {
     return module;
 }
Exemplo n.º 32
0
        /// <summary>
        /// Parse PHP code and return its AST.
        /// </summary>
        /// <param name="code">The PHP code to be parsed.</param>
        /// <param name="encoding">Encoding of the source code.</param>
        /// <param name="lang">Language features that may change parser behavior.</param>
        /// <param name="file">PHP Source file with the file name &amp; location</param>
        /// <returns>Returns the parsed AST node.</returns>
        public AST.GlobalCode ParseString(string code, Encoding encoding, PhpSourceFile file, LanguageFeatures lang) {
            PhpScriptSourceUnit srcUnit = new PhpScriptSourceUnit
                (this, code, file, encoding, 0, 0);

            using(StringReader reader = new StringReader(code)) {
                Parser parser = new Parser();
                return parser.Parse(srcUnit, reader, new ParserErrorSink(), this,
                    Position.Initial, Lexer.LexicalStates.INITIAL, lang);
            }
        }
Exemplo n.º 33
0
 public abstract PhpModule GetModule(PhpSourceFile name);
Exemplo n.º 34
0
		public ClientSourceCodeUnit(TransientCompilationUnit/*!*/ compilationUnit, string/*!*/ code, PhpSourceFile/*!*/ sourceFile,
			Encoding/*!*/ encoding, int line, int column)
			: base(compilationUnit, code, sourceFile, encoding, line, column)
		{
			this.initialState = Lexer.LexicalStates.INITIAL;
		}
Exemplo n.º 35
0
		/// <summary>
		/// Adds a new script module. Used by builder.
		/// </summary>
		internal void AddScriptModule(PhpSourceFile/*!*/ sourceFile, ScriptModule/*!*/ module)
		{
			modules.Add(sourceFile, module);
		}
Exemplo n.º 36
0
        public static PhpAssemblyBuilder /*!*/ Create(ApplicationContext /*!*/ applicationContext, AssemblyKinds kind,
                                                      bool pure, FullPath outPath, FullPath docPath, PhpSourceFile entryPoint, Version version,
                                                      StrongNameKeyPair key, Win32IconResource icon, ICollection <ResourceFileReference> resources, bool debug, bool force32bit)
        {
            string out_dir  = Path.GetDirectoryName(outPath);
            string out_file = Path.GetFileName(outPath);

            AssemblyName assembly_name = new AssemblyName();

            assembly_name.Name    = Path.GetFileNameWithoutExtension(outPath);
            assembly_name.Version = version;
            assembly_name.KeyPair = key;

            if (pure)
            {
                return(new PureAssemblyBuilder(applicationContext, assembly_name, out_dir, out_file,
                                               kind, resources, debug, force32bit, icon));
            }
            else
            {
                return(new MultiScriptAssemblyBuilder(applicationContext, assembly_name, out_dir, out_file,
                                                      kind, resources, debug, force32bit, icon, entryPoint));
            }
        }
Exemplo n.º 37
0
        /// <summary>
        /// Determine if script specified by <paramref name="fullPath"/> is loaded in script library.
        /// </summary>
        /// <param name="fullPath">The script path.</param>
        /// <returns>True if given script is loaded.</returns>
		internal bool ScriptExists(FullPath fullPath)
		{
            EnsureLibraryReflected();

			PhpSourceFile source_file = new PhpSourceFile(Configuration.Application.Compiler.SourceRoot, fullPath);
            return modules.ContainsKey(source_file);
		}
Exemplo n.º 38
0
 public override PhpModule GetModule(PhpSourceFile name)
 {
     throw new NotSupportedException();
 }
Exemplo n.º 39
0
        internal bool ScriptExists(FullPath fullPath)
        {
            PhpSourceFile source_file = new PhpSourceFile(Configuration.Application.Compiler.SourceRoot, fullPath);

            return(GetScriptType(source_file) != null);
        }