Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 private static string ModuleNameFrom(string readerName)
 {
     return(CodeFactory.ModuleNameFrom(readerName));
 }