Beispiel #1
0
        private bool CompileStream(TokenStream tokenStream)
        {
            Compiler compiler = new Compiler();
            if (!compiler.Compile(tokenStream))
                return false;

            state.Modules.AddRange(compiler.Modules);

            return true;
        }
Beispiel #2
0
        public bool Compile(TokenStream tokenStream)
        {
            streamStack.Push(tokenStream);

            try
            {
                Module(Vm.Module.GetNameFromFilename(tokenStream.Filename));
            }
            catch (CompilerException e)
            {
                streamStack.Pop();
                Console.WriteLine(e.Message);
                return false;
            }

            streamStack.Pop();

            return true;
        }