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); }
public static CompileUnit ParseReader(string readerName, TextReader reader) { var settings = new ParserSettings(); return(ParseReader(settings, readerName, reader)); }
public static CompileUnit ParseReader(string readerName, TextReader reader) { var settings = new ParserSettings(); return ParseReader(settings, readerName, reader); }
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; }
public static CompileUnit ParseFile(int tabSize, string fname) { var settings = new ParserSettings() { TabSize = tabSize }; return ParseFile(settings, fname); }
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); }
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; }
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); }
public static CompileUnit ParseReader(ParserSettings settings, string readerName, TextReader reader) { var cu = new CompileUnit(); ParseModule(settings, cu, readerName, reader); return cu; }
public static CompileUnit ParseReader(int tabSize, string readerName, TextReader reader) { var settings = new ParserSettings() { TabSize = tabSize }; return ParseReader(settings, readerName, reader); }