예제 #1
0
        public void DeclareVariableInSubscopes()
        {
            Tokenizer t = new Tokenizer(s_errorHandler, true);
            Parser p = new Parser(t.process(File.OpenText("code16.txt")), s_errorHandler);
            p.process();

            ScopeBuilder scopeBuilder = new ScopeBuilder(p.getAST(), s_errorHandler);
            scopeBuilder.process();
        }
예제 #2
0
        public void DeclareAndReferenceFunctionsAndVariables()
        {
            Tokenizer t = new Tokenizer(s_errorHandler, true);
            Parser p = new Parser(t.process(File.OpenText("code13.txt")), s_errorHandler);
            p.process();

            ScopeBuilder scopeBuilder = new ScopeBuilder(p.getAST(), s_errorHandler);
            scopeBuilder.process();
        }
예제 #3
0
        public void DeclareVariableInSubscopes()
        {
            Tokenizer t = new Tokenizer(s_errorHandler, true);
            Parser    p = new Parser(t.process(File.OpenText("code16.txt")), s_errorHandler);

            p.process();

            ScopeBuilder scopeBuilder = new ScopeBuilder(p.getAST(), s_errorHandler);

            scopeBuilder.process();
        }
예제 #4
0
        public void DeclareAndReferenceFunctionsAndVariables()
        {
            Tokenizer t = new Tokenizer(s_errorHandler, true);
            Parser    p = new Parser(t.process(File.OpenText("code13.txt")), s_errorHandler);

            p.process();

            ScopeBuilder scopeBuilder = new ScopeBuilder(p.getAST(), s_errorHandler);

            scopeBuilder.process();
        }
예제 #5
0
        public void DefineVariableFromCode()
        {
            Tokenizer t = new Tokenizer(s_errorHandler, true);
            Parser p = new Parser(t.process(File.OpenText("code11.txt")), s_errorHandler);
            p.process();

            ScopeBuilder scopeBuilder = new ScopeBuilder(p.getAST(), s_errorHandler);
            scopeBuilder.process();
            Scope globalScope = scopeBuilder.getGlobalScope();

            Assert.IsNotNull(globalScope.resolve("x"));
        }
예제 #6
0
        public void ForgettingEndStatement()
        {
            Tokenizer t = new Tokenizer(s_errorHandler, true);
            ErrorHandler e = new ErrorHandler();
            Parser p = new Parser(t.process(File.OpenText("code68.txt")), e);
            p.process();

            ScopeBuilder scopeBuilder = new ScopeBuilder(p.getAST(), e);
            scopeBuilder.process();

            e.printErrorsToConsole();

            Assert.AreEqual(1, e.getErrors().Count);
        }
예제 #7
0
        public void DefineFunction()
        {
            Tokenizer t = new Tokenizer(s_errorHandler, true);
            Parser    p = new Parser(t.process(File.OpenText("code12.txt")), s_errorHandler);

            p.process();

            ScopeBuilder scopeBuilder = new ScopeBuilder(p.getAST(), s_errorHandler);

            scopeBuilder.process();
            Scope globalScope = scopeBuilder.getGlobalScope();

            Assert.IsNotNull(globalScope.resolve("foo"));
        }
예제 #8
0
        public void ForgettingEndStatement()
        {
            Tokenizer    t = new Tokenizer(s_errorHandler, true);
            ErrorHandler e = new ErrorHandler();
            Parser       p = new Parser(t.process(File.OpenText("code68.txt")), e);

            p.process();

            ScopeBuilder scopeBuilder = new ScopeBuilder(p.getAST(), e);

            scopeBuilder.process();

            e.printErrorsToConsole();

            Assert.AreEqual(1, e.getErrors().Count);
        }