Example #1
0
        public void Ose_LineArgs()
        {
            var line = new OllyScript.Line();

            OllyScript.ParseArgumentsIntoLine(" hello,world", line);
            Assert.AreEqual(2, line.args.Length);
        }
Example #2
0
        public OllyScript ParseScript()
        {
            int lastLineNumber = 0;

            while (lexerStack !.Count > 0)
            {
                this.lexer = lexerStack.Pop();
                var line = Line();
                while (line != null)
                {
                    while (lastLineNumber < line.LineNumber)
                    {
                        this.script.Lines.Add(new OllyScript.Line {
                            LineNumber = lastLineNumber
                        });
                        ++lastLineNumber;
                    }
                    this.script.Lines.Add(line);
                    ++lastLineNumber;
                    line = Line();
                }
                this.lexer.Dispose();
                this.lexer = null !;
            }

            var script = this.script;

            this.script = new OllyScript();
            return(script);
        }
Example #3
0
 public OllyScriptParser(TextReader rdr, string currentDir, IOdbgScriptHost host, IFileSystemService fsSvc)
 {
     this.host       = host;
     this.fsSvc      = fsSvc;
     this.script     = new OllyScript();
     this.currentDir = currentDir;
     this.lexerStack = new Stack <Lexer>();
     this.lexerStack.Push(new Lexer(rdr));
 }
Example #4
0
        public virtual void LoadScript(string scriptFilename, OllyScript script)
        {
            // If the script file is not a rooted path, first try looking at
            // the current directory. If there is no file there, try finding
            // it in the installation directory.
            var fsSvc = Services.RequireService <IFileSystemService>();

            if (!fsSvc.IsPathRooted(scriptFilename))
            {
                string curDir  = fsSvc.GetCurrentDirectory();
                var    absPath = Path.Combine(curDir, scriptFilename);
                if (fsSvc.FileExists(absPath))
                {
                    scriptFilename = absPath;
                }
                else
                {
                    var dir = Path.GetDirectoryName(GetType().Assembly.Location);
                    absPath        = Path.Combine(dir, scriptFilename);
                    scriptFilename = absPath;
                }
            }
            script.LoadFile(scriptFilename, null);
        }
Example #5
0
 public virtual void LoadScript(string scriptFilename, OllyScript script)
 {
     script.LoadFile(scriptFilename, null);
 }
Example #6
0
 public virtual void LoadScript(string scriptFilename, OllyScript script)
 {
     script.LoadFile(scriptFilename, null);
 }