Exemple #1
0
        public static Module ParseModule(int tabSize, CompileUnit cu, string readerName, TextReader reader, ParserErrorHandler errorHandler)
        {
            if (Readers.IsEmpty(reader))
            {
                var emptyModule = new Module(new LexicalInfo(readerName), CodeFactory.ModuleNameFrom(readerName));
                cu.Modules.Add(emptyModule);
                return(emptyModule);
            }

            var module = CreateParser(tabSize, readerName, reader, errorHandler).start(cu);

            module.Name = CodeFactory.ModuleNameFrom(readerName);
            return(module);
        }
Exemple #2
0
        public static Module ParseModule(ParserSettings settings, CompileUnit cu, string readerName, TextReader reader)
        {
            if (Readers.IsEmpty(reader))
            {
                var emptyModule = new Module(new LexicalInfo(readerName), CodeFactory.ModuleNameFrom(readerName));
                cu.Modules.Add(emptyModule);
                return(emptyModule);
            }

            var module = CreateParser(settings, readerName, reader).start(cu);

            module.Name = CodeFactory.ModuleNameFrom(readerName);
            return(module);
        }
Exemple #3
0
 private static string ModuleNameFrom(string readerName)
 {
     return(CodeFactory.ModuleNameFrom(readerName));
 }