forked from jasder/antlr
Map java.util.Reader to System.IO.TextReader
This commit is contained in:
parent
9f90162a7d
commit
bd8d057d02
|
@ -132,7 +132,7 @@
|
|||
-typeMapping java.util.zip.ZipException ICSharpCode.SharpZipLib.SharpZipBaseException
|
||||
-typeMapping java.util.zip.DataFormatException ICSharpCode.SharpZipLib.SharpZipBaseException
|
||||
-typeMapping java.io.FileNotFoundException System.IO.FileNotFoundException
|
||||
-typeMapping java.io.Reader System.IO.StreamReader
|
||||
-typeMapping java.io.Reader System.IO.TextReader
|
||||
-typeMapping java.util.SortedSet<> System.Collections.Generic.ICollection
|
||||
-typeMapping java.lang.AssertionError System.Exception
|
||||
-typeMapping java.io.InterruptedIOException System.Threading.ThreadInterruptedException
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace Antlr4.Runtime
|
|||
{
|
||||
/// <summary>
|
||||
/// Vacuum all input from a
|
||||
/// <see cref="System.IO.StreamReader"/>
|
||||
/// <see cref="System.IO.TextReader"/>
|
||||
/// /
|
||||
/// <see cref="System.IO.Stream"/>
|
||||
/// and then treat it
|
||||
|
@ -87,19 +87,19 @@ namespace Antlr4.Runtime
|
|||
}
|
||||
|
||||
/// <exception cref="System.IO.IOException"/>
|
||||
public AntlrInputStream(StreamReader r)
|
||||
public AntlrInputStream(TextReader r)
|
||||
: this(r, InitialBufferSize, ReadBufferSize)
|
||||
{
|
||||
}
|
||||
|
||||
/// <exception cref="System.IO.IOException"/>
|
||||
public AntlrInputStream(StreamReader r, int initialSize)
|
||||
public AntlrInputStream(TextReader r, int initialSize)
|
||||
: this(r, initialSize, ReadBufferSize)
|
||||
{
|
||||
}
|
||||
|
||||
/// <exception cref="System.IO.IOException"/>
|
||||
public AntlrInputStream(StreamReader r, int initialSize, int readChunkSize)
|
||||
public AntlrInputStream(TextReader r, int initialSize, int readChunkSize)
|
||||
{
|
||||
Load(r, initialSize, readChunkSize);
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ namespace Antlr4.Runtime
|
|||
}
|
||||
|
||||
/// <exception cref="System.IO.IOException"/>
|
||||
public virtual void Load(StreamReader r, int size, int readChunkSize)
|
||||
public virtual void Load(TextReader r, int size, int readChunkSize)
|
||||
{
|
||||
if (r == null)
|
||||
{
|
||||
|
|
|
@ -220,7 +220,7 @@ namespace Antlr4.Runtime.Misc
|
|||
if (inputFiles.IsEmpty())
|
||||
{
|
||||
Stream @is = Sharpen.Runtime.@in;
|
||||
StreamReader r;
|
||||
TextReader r;
|
||||
if (encoding != null)
|
||||
{
|
||||
r = new StreamReader(@is, encoding);
|
||||
|
@ -239,7 +239,7 @@ namespace Antlr4.Runtime.Misc
|
|||
{
|
||||
@is = new FileInputStream(inputFile);
|
||||
}
|
||||
StreamReader r;
|
||||
TextReader r;
|
||||
if (encoding != null)
|
||||
{
|
||||
r = new StreamReader(@is, encoding);
|
||||
|
@ -260,7 +260,7 @@ namespace Antlr4.Runtime.Misc
|
|||
/// <exception cref="System.MemberAccessException"/>
|
||||
/// <exception cref="System.Reflection.TargetInvocationException"/>
|
||||
/// <exception cref="Javax.Print.PrintException"/>
|
||||
protected internal virtual void Process<_T0>(Lexer lexer, Type<_T0> parserClass, Parser parser, Stream @is, StreamReader r)
|
||||
protected internal virtual void Process<_T0>(Lexer lexer, Type<_T0> parserClass, Parser parser, Stream @is, TextReader r)
|
||||
where _T0 : Parser
|
||||
{
|
||||
try
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace Antlr4.Runtime
|
|||
/// </remarks>
|
||||
protected internal int currentCharIndex = 0;
|
||||
|
||||
protected internal StreamReader input;
|
||||
protected internal TextReader input;
|
||||
|
||||
/// <summary>The name or source of this char stream.</summary>
|
||||
/// <remarks>The name or source of this char stream.</remarks>
|
||||
|
@ -152,7 +152,7 @@ namespace Antlr4.Runtime
|
|||
{
|
||||
}
|
||||
|
||||
public UnbufferedCharStream(StreamReader input)
|
||||
public UnbufferedCharStream(TextReader input)
|
||||
: this(input, 256)
|
||||
{
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ namespace Antlr4.Runtime
|
|||
Fill(1);
|
||||
}
|
||||
|
||||
public UnbufferedCharStream(StreamReader input, int bufferSize)
|
||||
public UnbufferedCharStream(TextReader input, int bufferSize)
|
||||
: this(bufferSize)
|
||||
{
|
||||
// prime
|
||||
|
|
Loading…
Reference in New Issue