Ejemplo n.º 1
0
		public static CompileUnit ParseFile(ParserSettings settings, string fname)
		{
			if (null == fname)
				throw new ArgumentNullException("fname");
	
			using (StreamReader reader = File.OpenText(fname))
				return ParseReader(settings, fname, reader);
		}
Ejemplo n.º 2
0
        public static CompileUnit ParseReader(string readerName, TextReader reader)
        {
            var settings = new ParserSettings();

            return(ParseReader(settings, readerName, reader));
        }
Ejemplo n.º 3
0
		public static CompileUnit ParseReader(string readerName, TextReader reader)
		{
			var settings = new ParserSettings();
			return ParseReader(settings, readerName, reader);
		}
Ejemplo n.º 4
0
		public static BooParser CreateParser(ParserSettings settings, string readerName, TextReader reader)
		{
			var parser = new BooParser(CreateBooLexer(settings.TabSize, readerName, reader)) {
				MaxRecursionLimit = settings.MaxRecursionLimit,
				ErrorPatterns = settings.ErrorPatterns
			};
			parser.setFilename(readerName);
			if (null != settings.ErrorHandler)
				parser.Error += settings.ErrorHandler;
			return parser;
		}
Ejemplo n.º 5
0
		public static CompileUnit ParseFile(int tabSize, string fname)
		{
			var settings = new ParserSettings() { TabSize = tabSize };
			return ParseFile(settings, fname);
		}
Ejemplo n.º 6
0
		public static BooParser CreateParser(int tabSize, string readerName, TextReader reader, ParserErrorHandler errorHandler)
		{
			var settings = new ParserSettings() { TabSize = tabSize, ErrorHandler = errorHandler };
			return CreateParser(settings, readerName, reader);
		}
Ejemplo n.º 7
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.º 8
0
		public static Module ParseModule(int tabSize, CompileUnit cu, string readerName, TextReader reader, ParserErrorHandler errorHandler)
		{
			var settings = new ParserSettings() { TabSize = tabSize, ErrorHandler = errorHandler };
			return ParseModule(settings, cu, readerName, reader);
		}
Ejemplo n.º 9
0
		public static CompileUnit ParseReader(ParserSettings settings, string readerName, TextReader reader)
		{
			var cu = new CompileUnit();
			ParseModule(settings, cu, readerName, reader);
			return cu;
		}
Ejemplo n.º 10
0
		public static CompileUnit ParseReader(int tabSize, string readerName, TextReader reader)
		{		
			var settings = new ParserSettings() { TabSize = tabSize };
			return ParseReader(settings, readerName, reader);
		}