Esempio n. 1
0
 public ParseSourceTreeControl()
 {
     InitializeComponent();
     CodeBaseOptions = new CodeBaseOptions();
     LoadCatalog();
     ShowRunnerStatus();
 }
Esempio n. 2
0
        public MainForm()
        {
            InitializeComponent();

            _codeBaseOptions = new CodeBaseOptions();
            _codeBaseOptions.LoadFromRegistry();
            parseSourceTreeControl1.CodeBaseOptions = _codeBaseOptions;
            compilerOptionsControl1.CodeBaseOptions = _codeBaseOptions;
        }
Esempio n. 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;
 }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 7
0
 private CodeBaseWorker(CodeBase codeBase, CodeBaseOptions options, BackgroundWorker backgroundWorker)
 {
     _codeBase         = codeBase;
     _options          = options;
     _backgroundWorker = backgroundWorker;
 }
Esempio n. 8
0
 private CodeBaseWorker(CodeBase codeBase, CodeBaseOptions options, BackgroundWorker backgroundWorker)
 {
     _codeBase = codeBase;
     _options = options;
     _backgroundWorker = backgroundWorker;
 }
Esempio n. 9
0
 public CodeBaseOptions()
 {
     _instance = this;
 }
Esempio n. 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;
 }
Esempio n. 11
0
 public void SetUp()
 {
     _options = new CodeBaseOptions();
 }