private static Map ReadStream(ICharStream charStream, BaseErrorListener errorListener) { Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US"); MapLexer lexer = new MapLexer(charStream); MapParser parser = new MapParser(new CommonTokenStream(lexer)); parser.RemoveErrorListeners(); if (errorListener != null) { parser.AddErrorListener(errorListener); } return(parser.map().value); }