Example #1
0
 public ParseSourceTreeControl()
 {
     InitializeComponent();
     CodeBaseOptions = new CodeBaseOptions();
     LoadCatalog();
     ShowRunnerStatus();
 }
Example #2
0
        public MainForm()
        {
            InitializeComponent();

            _codeBaseOptions = new CodeBaseOptions();
            _codeBaseOptions.LoadFromRegistry();
            parseSourceTreeControl1.CodeBaseOptions = _codeBaseOptions;
            compilerOptionsControl1.CodeBaseOptions = _codeBaseOptions;
        }
Example #3
0
 public static CodeBase Execute(CodeBaseOptions options, BackgroundWorker backgroundWorker)
 {
     CodeBase codeBase = new CodeBase(options.CreateCompilerDefines(), new FileLoader());
     CodeBaseWorker worker = new CodeBaseWorker(codeBase, options, backgroundWorker);
     Stopwatch stopwatch = new Stopwatch();
     stopwatch.Start();
     try {
         worker.ExecuteInternal();
     } catch(CancelException) {
     }
     stopwatch.Stop();
     codeBase.ParseDuration = stopwatch.Elapsed;
     return codeBase;
 }
Example #4
0
        public CodeBaseOptions Clone()
        {
            CodeBaseOptions result = new CodeBaseOptions();

            result.CompilerOptionsSetOff = CompilerOptionsSetOff;
            result.CompilerOptionsSetOn  = CompilerOptionsSetOn;
            result.CustomDefines         = CustomDefines;
            result.DelphiVersionDefine   = DelphiVersionDefine;
            result.FalseIfConditions     = FalseIfConditions;
            result.FileMasks             = FileMasks;
            result.SearchPaths           = SearchPaths;
            result.TrueIfConditions      = TrueIfConditions;
            return(result);
        }
Example #5
0
        public static CodeBase Execute(CodeBaseOptions options, BackgroundWorker backgroundWorker)
        {
            CodeBase       codeBase  = new CodeBase(options.CreateCompilerDefines(), new FileLoader(false));
            CodeBaseWorker worker    = new CodeBaseWorker(codeBase, options, backgroundWorker);
            Stopwatch      stopwatch = new Stopwatch();

            stopwatch.Start();
            try {
                worker.ExecuteInternal();
            } catch (CancelException) {
            }
            stopwatch.Stop();
            codeBase.ParseDuration = stopwatch.Elapsed;
            return(codeBase);
        }
Example #6
0
        private IEnumerable <Token> GetSourceTokensForInclude(Token token, string baseName)
        {
            string currentDirectory = token.Location.Directory;
            string fileName         = "";

            foreach (string searchPath in CodeBaseOptions.Instance().SearchPaths.Split(';'))
            {
                currentDirectory = searchPath;
                fileName         = _fileLoader.ExpandFileName(currentDirectory, baseName);
                if (File.Exists(fileName))
                {
                    break;
                }
            }
            string source = _fileLoader.Load(fileName);
            Lexer  lexer  = new Lexer(source, fileName);

            return(lexer.Tokens);
        }
Example #7
0
 private CodeBaseWorker(CodeBase codeBase, CodeBaseOptions options, BackgroundWorker backgroundWorker)
 {
     _codeBase         = codeBase;
     _options          = options;
     _backgroundWorker = backgroundWorker;
 }
Example #8
0
 private CodeBaseWorker(CodeBase codeBase, CodeBaseOptions options, BackgroundWorker backgroundWorker)
 {
     _codeBase = codeBase;
     _options = options;
     _backgroundWorker = backgroundWorker;
 }
Example #9
0
 public CodeBaseOptions()
 {
     _instance = this;
 }
Example #10
0
 public CodeBaseOptions Clone()
 {
     CodeBaseOptions result = new CodeBaseOptions();
     result.CompilerOptionsSetOff = CompilerOptionsSetOff;
     result.CompilerOptionsSetOn = CompilerOptionsSetOn;
     result.CustomDefines = CustomDefines;
     result.DelphiVersionDefine = DelphiVersionDefine;
     result.FalseIfConditions = FalseIfConditions;
     result.FileMasks = FileMasks;
     result.SearchPaths = SearchPaths;
     result.TrueIfConditions = TrueIfConditions;
     return result;
 }
Example #11
0
 public void SetUp()
 {
     _options = new CodeBaseOptions();
 }