Merge branch 'sharpen'

This commit is contained in:
Sam Harwell 2014-02-16 15:03:32 -06:00
commit 082f0bbfad
48 changed files with 161 additions and 112 deletions

@ -1 +1 @@
Subproject commit f01e18ba72eda0825e09da106ff9c9e7c337cd22 Subproject commit ee88c0a13113436b09009d8f621333e239ac926f

View File

@ -51,7 +51,8 @@ namespace Antlr4.Runtime
protected internal string fileName; protected internal string fileName;
/// <exception cref="System.IO.IOException"></exception> /// <exception cref="System.IO.IOException"></exception>
public AntlrFileStream(string fileName) : this(fileName, null) public AntlrFileStream(string fileName)
: this(fileName, null)
{ {
} }

View File

@ -88,14 +88,14 @@ namespace Antlr4.Runtime
} }
/// <exception cref="System.IO.IOException"></exception> /// <exception cref="System.IO.IOException"></exception>
public AntlrInputStream(TextReader r) : this(r, InitialBufferSize, ReadBufferSize public AntlrInputStream(TextReader r)
) : this(r, InitialBufferSize, ReadBufferSize)
{ {
} }
/// <exception cref="System.IO.IOException"></exception> /// <exception cref="System.IO.IOException"></exception>
public AntlrInputStream(TextReader r, int initialSize) : this(r, initialSize, ReadBufferSize public AntlrInputStream(TextReader r, int initialSize)
) : this(r, initialSize, ReadBufferSize)
{ {
} }
@ -106,20 +106,20 @@ namespace Antlr4.Runtime
} }
/// <exception cref="System.IO.IOException"></exception> /// <exception cref="System.IO.IOException"></exception>
public AntlrInputStream(Stream input) : this(new StreamReader(input), InitialBufferSize public AntlrInputStream(Stream input)
) : this(new StreamReader(input), InitialBufferSize)
{ {
} }
/// <exception cref="System.IO.IOException"></exception> /// <exception cref="System.IO.IOException"></exception>
public AntlrInputStream(Stream input, int initialSize) : this(new StreamReader(input public AntlrInputStream(Stream input, int initialSize)
), initialSize) : this(new StreamReader(input), initialSize)
{ {
} }
/// <exception cref="System.IO.IOException"></exception> /// <exception cref="System.IO.IOException"></exception>
public AntlrInputStream(Stream input, int initialSize, int readChunkSize) : this( public AntlrInputStream(Stream input, int initialSize, int readChunkSize)
new StreamReader(input), initialSize, readChunkSize) : this(new StreamReader(input), initialSize, readChunkSize)
{ {
} }

View File

@ -504,15 +504,15 @@ namespace Antlr4.Runtime.Atn
private readonly Antlr4.Runtime.Atn.SemanticContext semanticContext; private readonly Antlr4.Runtime.Atn.SemanticContext semanticContext;
public SemanticContextATNConfig(Antlr4.Runtime.Atn.SemanticContext semanticContext public SemanticContextATNConfig(Antlr4.Runtime.Atn.SemanticContext semanticContext
, ATNState state, int alt, PredictionContext context) : base(state, alt, context , ATNState state, int alt, PredictionContext context)
) : base(state, alt, context)
{ {
this.semanticContext = semanticContext; this.semanticContext = semanticContext;
} }
public SemanticContextATNConfig(Antlr4.Runtime.Atn.SemanticContext semanticContext public SemanticContextATNConfig(Antlr4.Runtime.Atn.SemanticContext semanticContext
, ATNConfig c, ATNState state, PredictionContext context) : base(c, state, context , ATNConfig c, ATNState state, PredictionContext context)
) : base(c, state, context)
{ {
this.semanticContext = semanticContext; this.semanticContext = semanticContext;
} }
@ -531,13 +531,15 @@ namespace Antlr4.Runtime.Atn
private readonly int actionIndex; private readonly int actionIndex;
public ActionATNConfig(int actionIndex, ATNState state, int alt, PredictionContext public ActionATNConfig(int actionIndex, ATNState state, int alt, PredictionContext
context) : base(state, alt, context) context)
: base(state, alt, context)
{ {
this.actionIndex = actionIndex; this.actionIndex = actionIndex;
} }
protected internal ActionATNConfig(int actionIndex, ATNConfig c, ATNState state, protected internal ActionATNConfig(int actionIndex, ATNConfig c, ATNState state,
PredictionContext context) : base(c, state, context) PredictionContext context)
: base(c, state, context)
{ {
if (c.SemanticContext != SemanticContext.None) if (c.SemanticContext != SemanticContext.None)
{ {
@ -560,15 +562,15 @@ namespace Antlr4.Runtime.Atn
private readonly int actionIndex; private readonly int actionIndex;
public ActionSemanticContextATNConfig(int actionIndex, SemanticContext semanticContext public ActionSemanticContextATNConfig(int actionIndex, SemanticContext semanticContext
, ATNState state, int alt, PredictionContext context) : base(semanticContext, , ATNState state, int alt, PredictionContext context)
state, alt, context) : base(semanticContext, state, alt, context)
{ {
this.actionIndex = actionIndex; this.actionIndex = actionIndex;
} }
public ActionSemanticContextATNConfig(int actionIndex, SemanticContext semanticContext public ActionSemanticContextATNConfig(int actionIndex, SemanticContext semanticContext
, ATNConfig c, ATNState state, PredictionContext context) : base(semanticContext , ATNConfig c, ATNState state, PredictionContext context)
, c, state, context) : base(semanticContext, c, state, context)
{ {
this.actionIndex = actionIndex; this.actionIndex = actionIndex;
} }

View File

@ -35,7 +35,8 @@ namespace Antlr4.Runtime.Atn
/// <author>Sam Harwell</author> /// <author>Sam Harwell</author>
public abstract class AbstractPredicateTransition : Transition public abstract class AbstractPredicateTransition : Transition
{ {
public AbstractPredicateTransition(ATNState target) : base(target) public AbstractPredicateTransition(ATNState target)
: base(target)
{ {
} }
} }

View File

@ -40,13 +40,14 @@ namespace Antlr4.Runtime.Atn
public readonly bool isCtxDependent; public readonly bool isCtxDependent;
public ActionTransition(ATNState target, int ruleIndex) : this(target, ruleIndex, public ActionTransition(ATNState target, int ruleIndex)
-1, false) : this(target, ruleIndex, -1, false)
{ {
} }
public ActionTransition(ATNState target, int ruleIndex, int actionIndex, bool isCtxDependent public ActionTransition(ATNState target, int ruleIndex, int actionIndex, bool isCtxDependent
) : base(target) )
: base(target)
{ {
// e.g., $i ref in action // e.g., $i ref in action
this.ruleIndex = ruleIndex; this.ruleIndex = ruleIndex;

View File

@ -44,8 +44,8 @@ namespace Antlr4.Runtime.Atn
[NotNull] [NotNull]
public readonly int[] returnStates; public readonly int[] returnStates;
internal ArrayPredictionContext(PredictionContext[] parents, int[] returnStates) : internal ArrayPredictionContext(PredictionContext[] parents, int[] returnStates)
base(CalculateHashCode(parents, returnStates)) : base(CalculateHashCode(parents, returnStates))
{ {
System.Diagnostics.Debug.Assert(parents.Length == returnStates.Length); System.Diagnostics.Debug.Assert(parents.Length == returnStates.Length);
System.Diagnostics.Debug.Assert(returnStates.Length > 1 || returnStates[0] != EmptyFullStateKey System.Diagnostics.Debug.Assert(returnStates.Length > 1 || returnStates[0] != EmptyFullStateKey
@ -55,7 +55,8 @@ namespace Antlr4.Runtime.Atn
} }
internal ArrayPredictionContext(PredictionContext[] parents, int[] returnStates, internal ArrayPredictionContext(PredictionContext[] parents, int[] returnStates,
int hashCode) : base(hashCode) int hashCode)
: base(hashCode)
{ {
System.Diagnostics.Debug.Assert(parents.Length == returnStates.Length); System.Diagnostics.Debug.Assert(parents.Length == returnStates.Length);
System.Diagnostics.Debug.Assert(returnStates.Length > 1 || returnStates[0] != EmptyFullStateKey System.Diagnostics.Debug.Assert(returnStates.Length > 1 || returnStates[0] != EmptyFullStateKey

View File

@ -40,7 +40,8 @@ namespace Antlr4.Runtime.Atn
/// <remarks>The token type or character value; or, signifies special label.</remarks> /// <remarks>The token type or character value; or, signifies special label.</remarks>
public readonly int label; public readonly int label;
public AtomTransition(ATNState target, int label) : base(target) public AtomTransition(ATNState target, int label)
: base(target)
{ {
this.label = label; this.label = label;
} }

View File

@ -45,7 +45,8 @@ namespace Antlr4.Runtime.Atn
private readonly bool fullContext; private readonly bool fullContext;
private EmptyPredictionContext(bool fullContext) : base(CalculateEmptyHashCode()) private EmptyPredictionContext(bool fullContext)
: base(CalculateEmptyHashCode())
{ {
this.fullContext = fullContext; this.fullContext = fullContext;
} }

View File

@ -35,7 +35,8 @@ namespace Antlr4.Runtime.Atn
{ {
public sealed class EpsilonTransition : Transition public sealed class EpsilonTransition : Transition
{ {
public EpsilonTransition(ATNState target) : base(target) public EpsilonTransition(ATNState target)
: base(target)
{ {
} }

View File

@ -117,11 +117,13 @@ namespace Antlr4.Runtime.Atn
public static int match_calls = 0; public static int match_calls = 0;
public LexerATNSimulator(ATN atn) : this(null, atn) public LexerATNSimulator(ATN atn)
: this(null, atn)
{ {
} }
public LexerATNSimulator(Lexer recog, ATN atn) : base(atn) public LexerATNSimulator(Lexer recog, ATN atn)
: base(atn)
{ {
this.recog = recog; this.recog = recog;
} }

View File

@ -35,7 +35,8 @@ namespace Antlr4.Runtime.Atn
{ {
public sealed class NotSetTransition : SetTransition public sealed class NotSetTransition : SetTransition
{ {
public NotSetTransition(ATNState target, IntervalSet set) : base(target, set) public NotSetTransition(ATNState target, IntervalSet set)
: base(target, set)
{ {
} }

View File

@ -39,8 +39,8 @@ namespace Antlr4.Runtime.Atn
{ {
} }
public OrderedATNConfigSet(ATNConfigSet set, bool @readonly) : base(set, @readonly public OrderedATNConfigSet(ATNConfigSet set, bool @readonly)
) : base(set, @readonly)
{ {
} }

View File

@ -268,11 +268,13 @@ namespace Antlr4.Runtime.Atn
protected internal bool userWantsCtxSensitive = true; protected internal bool userWantsCtxSensitive = true;
/// <summary>Testing only!</summary> /// <summary>Testing only!</summary>
public ParserATNSimulator(ATN atn) : this(null, atn) public ParserATNSimulator(ATN atn)
: this(null, atn)
{ {
} }
public ParserATNSimulator(Parser parser, ATN atn) : base(atn) public ParserATNSimulator(Parser parser, ATN atn)
: base(atn)
{ {
this.parser = parser; this.parser = parser;
} }

View File

@ -37,8 +37,8 @@ namespace Antlr4.Runtime.Atn
{ {
public readonly int precedence; public readonly int precedence;
public PrecedencePredicateTransition(ATNState target, int precedence) : base(target public PrecedencePredicateTransition(ATNState target, int precedence)
) : base(target)
{ {
this.precedence = precedence; this.precedence = precedence;
} }

View File

@ -53,7 +53,8 @@ namespace Antlr4.Runtime.Atn
public readonly bool isCtxDependent; public readonly bool isCtxDependent;
public PredicateTransition(ATNState target, int ruleIndex, int predIndex, bool isCtxDependent public PredicateTransition(ATNState target, int ruleIndex, int predIndex, bool isCtxDependent
) : base(target) )
: base(target)
{ {
// e.g., $i ref in pred // e.g., $i ref in pred
this.ruleIndex = ruleIndex; this.ruleIndex = ruleIndex;

View File

@ -522,8 +522,8 @@ outer_continue: ;
public sealed class IdentityHashMap : Dictionary<PredictionContext, PredictionContext public sealed class IdentityHashMap : Dictionary<PredictionContext, PredictionContext
> >
{ {
public IdentityHashMap() : base(PredictionContext.IdentityEqualityComparator.Instance public IdentityHashMap()
) : base(PredictionContext.IdentityEqualityComparator.Instance)
{ {
} }
} }

View File

@ -59,7 +59,8 @@ namespace Antlr4.Runtime.Atn
private readonly bool enableCache; private readonly bool enableCache;
public PredictionContextCache() : this(true) public PredictionContextCache()
: this(true)
{ {
} }

View File

@ -80,8 +80,8 @@ namespace Antlr4.Runtime.Atn
/// <remarks>A Map that uses just the state and the stack context as the key.</remarks> /// <remarks>A Map that uses just the state and the stack context as the key.</remarks>
internal class AltAndContextMap : Dictionary<ATNConfig, BitSet> internal class AltAndContextMap : Dictionary<ATNConfig, BitSet>
{ {
public AltAndContextMap() : base(PredictionMode.AltAndContextConfigEqualityComparator public AltAndContextMap()
.Instance) : base(PredictionMode.AltAndContextConfigEqualityComparator.Instance)
{ {
} }
} }

View File

@ -39,7 +39,8 @@ namespace Antlr4.Runtime.Atn
public readonly int to; public readonly int to;
public RangeTransition(ATNState target, int from, int to) : base(target) public RangeTransition(ATNState target, int from, int to)
: base(target)
{ {
this.from = from; this.from = from;
this.to = to; this.to = to;

View File

@ -49,7 +49,8 @@ namespace Antlr4.Runtime.Atn
public bool optimizedTailCall; public bool optimizedTailCall;
public RuleTransition(RuleStartState ruleStart, int ruleIndex, int precedence, ATNState public RuleTransition(RuleStartState ruleStart, int ruleIndex, int precedence, ATNState
followState) : base(ruleStart) followState)
: base(ruleStart)
{ {
// no Rule object at runtime // no Rule object at runtime
this.ruleIndex = ruleIndex; this.ruleIndex = ruleIndex;

View File

@ -40,7 +40,8 @@ namespace Antlr4.Runtime.Atn
[NotNull] [NotNull]
public readonly IntervalSet set; public readonly IntervalSet set;
public SetTransition(ATNState target, IntervalSet set) : base(target) public SetTransition(ATNState target, IntervalSet set)
: base(target)
{ {
// TODO (sam): should we really allow null here? // TODO (sam): should we really allow null here?
if (set == null) if (set == null)

View File

@ -41,8 +41,8 @@ namespace Antlr4.Runtime.Atn
public readonly int returnState; public readonly int returnState;
internal SingletonPredictionContext(PredictionContext parent, int returnState) : internal SingletonPredictionContext(PredictionContext parent, int returnState)
base(CalculateHashCode(parent, returnState)) : base(CalculateHashCode(parent, returnState))
{ {
System.Diagnostics.Debug.Assert(returnState != EmptyFullStateKey && returnState != System.Diagnostics.Debug.Assert(returnState != EmptyFullStateKey && returnState !=
EmptyLocalStateKey); EmptyLocalStateKey);

View File

@ -35,7 +35,8 @@ namespace Antlr4.Runtime.Atn
{ {
public sealed class WildcardTransition : Transition public sealed class WildcardTransition : Transition
{ {
public WildcardTransition(ATNState target) : base(target) public WildcardTransition(ATNState target)
: base(target)
{ {
} }

View File

@ -60,7 +60,8 @@ namespace Antlr4.Runtime
this.copyText = copyText; this.copyText = copyText;
} }
public CommonTokenFactory() : this(false) public CommonTokenFactory()
: this(false)
{ {
} }

View File

@ -66,12 +66,13 @@ namespace Antlr4.Runtime
/// </remarks> /// </remarks>
protected internal int channel = TokenConstants.DefaultChannel; protected internal int channel = TokenConstants.DefaultChannel;
public CommonTokenStream(ITokenSource tokenSource) : base(tokenSource) public CommonTokenStream(ITokenSource tokenSource)
: base(tokenSource)
{ {
} }
public CommonTokenStream(ITokenSource tokenSource, int channel) : this(tokenSource public CommonTokenStream(ITokenSource tokenSource, int channel)
) : this(tokenSource)
{ {
this.channel = channel; this.channel = channel;
} }

View File

@ -43,7 +43,8 @@ namespace Antlr4.Runtime.Dfa
private int size; private int size;
public ArrayEdgeMap(int minIndex, int maxIndex) : base(minIndex, maxIndex) public ArrayEdgeMap(int minIndex, int maxIndex)
: base(minIndex, maxIndex)
{ {
arrayData = new T[maxIndex - minIndex + 1]; arrayData = new T[maxIndex - minIndex + 1];
} }

View File

@ -68,7 +68,8 @@ namespace Antlr4.Runtime.Dfa
private int nextStateNumber; private int nextStateNumber;
public DFA(ATNState atnStartState) : this(atnStartState, 0) public DFA(ATNState atnStartState)
: this(atnStartState, 0)
{ {
} }

View File

@ -53,14 +53,14 @@ namespace Antlr4.Runtime.Dfa
[Nullable] [Nullable]
internal readonly ATN atn; internal readonly ATN atn;
public DFASerializer(DFA dfa, string[] tokenNames) : this(dfa, tokenNames, null, public DFASerializer(DFA dfa, string[] tokenNames)
null) : this(dfa, tokenNames, null, null)
{ {
} }
public DFASerializer(DFA dfa, IRecognizer parser) : this(dfa, parser public DFASerializer(DFA dfa, IRecognizer parser)
!= null ? parser.TokenNames : null, parser != null ? parser.RuleNames : null : this(dfa, parser != null ? parser.TokenNames : null, parser != null ? parser.RuleNames
, parser != null ? parser.Atn : null) : null, parser != null ? parser.Atn : null)
{ {
} }

View File

@ -35,7 +35,8 @@ namespace Antlr4.Runtime.Dfa
{ {
public class LexerDFASerializer : DFASerializer public class LexerDFASerializer : DFASerializer
{ {
public LexerDFASerializer(DFA dfa) : base(dfa, (string[])null) public LexerDFASerializer(DFA dfa)
: base(dfa, (string[])null)
{ {
} }

View File

@ -41,14 +41,15 @@ namespace Antlr4.Runtime.Dfa
private readonly T value; private readonly T value;
public SingletonEdgeMap(int minIndex, int maxIndex) : base(minIndex, maxIndex) public SingletonEdgeMap(int minIndex, int maxIndex)
: base(minIndex, maxIndex)
{ {
this.key = 0; this.key = 0;
this.value = null; this.value = null;
} }
public SingletonEdgeMap(int minIndex, int maxIndex, int key, T value) : base(minIndex public SingletonEdgeMap(int minIndex, int maxIndex, int key, T value)
, maxIndex) : base(minIndex, maxIndex)
{ {
if (key >= minIndex && key <= maxIndex) if (key >= minIndex && key <= maxIndex)
{ {

View File

@ -45,20 +45,20 @@ namespace Antlr4.Runtime.Dfa
private readonly List<T> values; private readonly List<T> values;
public SparseEdgeMap(int minIndex, int maxIndex) : this(minIndex, maxIndex, DefaultMaxSize public SparseEdgeMap(int minIndex, int maxIndex)
) : this(minIndex, maxIndex, DefaultMaxSize)
{ {
} }
public SparseEdgeMap(int minIndex, int maxIndex, int maxSparseSize) : base(minIndex public SparseEdgeMap(int minIndex, int maxIndex, int maxSparseSize)
, maxIndex) : base(minIndex, maxIndex)
{ {
this.keys = new int[maxSparseSize]; this.keys = new int[maxSparseSize];
this.values = new List<T>(maxSparseSize); this.values = new List<T>(maxSparseSize);
} }
private SparseEdgeMap(Antlr4.Runtime.Dfa.SparseEdgeMap<T> map, int maxSparseSize) private SparseEdgeMap(Antlr4.Runtime.Dfa.SparseEdgeMap<T> map, int maxSparseSize)
: base(map.minIndex, map.maxIndex) : base(map.minIndex, map.maxIndex)
{ {
if (maxSparseSize < map.values.Count) if (maxSparseSize < map.values.Count)
{ {

View File

@ -74,7 +74,8 @@ namespace Antlr4.Runtime
/// which only /// which only
/// reports exact ambiguities. /// reports exact ambiguities.
/// </summary> /// </summary>
public DiagnosticErrorListener() : this(true) public DiagnosticErrorListener()
: this(true)
{ {
} }

View File

@ -55,18 +55,20 @@ namespace Antlr4.Runtime
private readonly string predicate; private readonly string predicate;
public FailedPredicateException(Parser recognizer) : this(recognizer, null) public FailedPredicateException(Parser recognizer)
: this(recognizer, null)
{ {
} }
public FailedPredicateException(Parser recognizer, string predicate) : this(recognizer public FailedPredicateException(Parser recognizer, string predicate)
, predicate, null) : this(recognizer, predicate, null)
{ {
} }
public FailedPredicateException(Parser recognizer, string predicate, string message public FailedPredicateException(Parser recognizer, string predicate, string message
) : base(FormatMessage(predicate, message), recognizer, ((ITokenStream)recognizer )
.InputStream), recognizer._ctx) : base(FormatMessage(predicate, message), recognizer, ((ITokenStream)recognizer.InputStream
), recognizer._ctx)
{ {
ATNState s = recognizer.Interpreter.atn.states[recognizer.State]; ATNState s = recognizer.Interpreter.atn.states[recognizer.State];
AbstractPredicateTransition trans = (AbstractPredicateTransition)s.Transition(0); AbstractPredicateTransition trans = (AbstractPredicateTransition)s.Transition(0);

View File

@ -47,8 +47,8 @@ namespace Antlr4.Runtime
{ {
private const long serialVersionUID = 1532568338707443067L; private const long serialVersionUID = 1532568338707443067L;
public InputMismatchException(Parser recognizer) : base(recognizer, ((ITokenStream public InputMismatchException(Parser recognizer)
)recognizer.InputStream), recognizer._ctx) : base(recognizer, ((ITokenStream)recognizer.InputStream), recognizer._ctx)
{ {
this.OffendingToken = recognizer.CurrentToken; this.OffendingToken = recognizer.CurrentToken;
} }

View File

@ -51,7 +51,8 @@ namespace Antlr4.Runtime
private readonly ATNConfigSet deadEndConfigs; private readonly ATNConfigSet deadEndConfigs;
public LexerNoViableAltException(Lexer lexer, ICharStream input, int startIndex, public LexerNoViableAltException(Lexer lexer, ICharStream input, int startIndex,
ATNConfigSet deadEndConfigs) : base(lexer, input) ATNConfigSet deadEndConfigs)
: base(lexer, input)
{ {
this.startIndex = startIndex; this.startIndex = startIndex;
this.deadEndConfigs = deadEndConfigs; this.deadEndConfigs = deadEndConfigs;

View File

@ -61,12 +61,13 @@ namespace Antlr4.Runtime.Misc
protected internal int initialBucketCapacity = InitalBucketCapacity; protected internal int initialBucketCapacity = InitalBucketCapacity;
public Array2DHashSet() : this(null, InitalCapacity, InitalBucketCapacity) public Array2DHashSet()
: this(null, InitalCapacity, InitalBucketCapacity)
{ {
} }
public Array2DHashSet(EqualityComparer<T> comparator) : this(comparator, InitalCapacity public Array2DHashSet(EqualityComparer<T> comparator)
, InitalBucketCapacity) : this(comparator, InitalCapacity, InitalBucketCapacity)
{ {
} }
@ -436,7 +437,8 @@ namespace Antlr4.Runtime.Misc
return true; return true;
} }
public virtual bool AddAll<_T0>(ICollection<_T0> c) where _T0:T public virtual bool AddAll<_T0>(ICollection<_T0> c)
where _T0 : T
{ {
bool changed = false; bool changed = false;
foreach (T o in c) foreach (T o in c)

View File

@ -73,7 +73,8 @@ namespace Antlr4.Runtime.Misc
this.intervals = intervals; this.intervals = intervals;
} }
public IntervalSet(Antlr4.Runtime.Misc.IntervalSet set) : this() public IntervalSet(Antlr4.Runtime.Misc.IntervalSet set)
: this()
{ {
AddAll(set); AddAll(set);
} }

View File

@ -59,7 +59,8 @@ namespace Antlr4.Runtime.Misc
{ {
} }
public ParseCanceledException(string message) : base(message) public ParseCanceledException(string message)
: base(message)
{ {
} }

View File

@ -265,7 +265,8 @@ namespace Antlr4.Runtime.Misc
/// <exception cref="System.Reflection.TargetInvocationException"></exception> /// <exception cref="System.Reflection.TargetInvocationException"></exception>
/// <exception cref="Javax.Print.PrintException"></exception> /// <exception cref="Javax.Print.PrintException"></exception>
protected internal virtual void Process<_T0>(Lexer lexer, Type<_T0> parserClass, protected internal virtual void Process<_T0>(Lexer lexer, Type<_T0> parserClass,
Parser parser, Stream @is, StreamReader r) where _T0:Parser Parser parser, Stream @is, StreamReader r)
where _T0 : Parser
{ {
try try
{ {

View File

@ -69,15 +69,16 @@ namespace Antlr4.Runtime
[NotNull] [NotNull]
private readonly IToken startToken; private readonly IToken startToken;
public NoViableAltException(Parser recognizer) : this(recognizer, ((ITokenStream) public NoViableAltException(Parser recognizer)
recognizer.InputStream), recognizer.CurrentToken, recognizer.CurrentToken, null : this(recognizer, ((ITokenStream)recognizer.InputStream), recognizer.CurrentToken
, recognizer._ctx) , recognizer.CurrentToken, null, recognizer._ctx)
{ {
} }
public NoViableAltException(IRecognizer recognizer, ITokenStream input public NoViableAltException(IRecognizer recognizer, ITokenStream input
, IToken startToken, IToken offendingToken, ATNConfigSet deadEndConfigs, ParserRuleContext , IToken startToken, IToken offendingToken, ATNConfigSet deadEndConfigs, ParserRuleContext
ctx) : base(recognizer, input, ctx) ctx)
: base(recognizer, input, ctx)
{ {
// LL(1) error // LL(1) error
this.deadEndConfigs = deadEndConfigs; this.deadEndConfigs = deadEndConfigs;

View File

@ -153,7 +153,8 @@ namespace Antlr4.Runtime
} }
public ParserRuleContext(Antlr4.Runtime.ParserRuleContext parent, int invokingStateNumber public ParserRuleContext(Antlr4.Runtime.ParserRuleContext parent, int invokingStateNumber
) : base(parent, invokingStateNumber) )
: base(parent, invokingStateNumber)
{ {
} }
@ -235,7 +236,8 @@ namespace Antlr4.Runtime
return children != null && i >= 0 && i < children.Count ? children[i] : null; return children != null && i >= 0 && i < children.Count ? children[i] : null;
} }
public virtual T GetChild<T>(int i) where T:IParseTree public virtual T GetChild<T>(int i)
where T : IParseTree
{ {
if (children == null || i < 0 || i >= children.Count) if (children == null || i < 0 || i >= children.Count)
{ {
@ -322,15 +324,18 @@ namespace Antlr4.Runtime
#endif #endif
} }
public virtual T GetRuleContext<T>(int i) where T:Antlr4.Runtime.ParserRuleContext public virtual T GetRuleContext<T>(int i)
where T : Antlr4.Runtime.ParserRuleContext
{ {
return GetChild<T>(i); return GetChild<T>(i);
} }
#if NET_4_5 #if NET_4_5
public virtual IReadOnlyList<T> GetRuleContexts<T>() where T:Antlr4.Runtime.ParserRuleContext public virtual IReadOnlyList<T> GetRuleContexts<T>()
where T : Antlr4.Runtime.ParserRuleContext
#else #else
public virtual T[] GetRuleContexts<T>() where T:Antlr4.Runtime.ParserRuleContext public virtual T[] GetRuleContexts<T>()
where T : Antlr4.Runtime.ParserRuleContext
#endif #endif
{ {
if (children == null) if (children == null)

View File

@ -39,7 +39,8 @@ namespace Antlr4.Runtime
public class ProxyParserErrorListener : ProxyErrorListener<IToken>, IParserErrorListener public class ProxyParserErrorListener : ProxyErrorListener<IToken>, IParserErrorListener
{ {
public ProxyParserErrorListener(ICollection<IAntlrErrorListener<IToken>> delegates public ProxyParserErrorListener(ICollection<IAntlrErrorListener<IToken>> delegates
) : base(delegates) )
: base(delegates)
{ {
} }

View File

@ -95,7 +95,8 @@ namespace Antlr4.Runtime
} }
} }
public RecognitionException(string message, IRecognizer recognizer, IIntStream input, ParserRuleContext ctx) : base(message) public RecognitionException(string message, IRecognizer recognizer, IIntStream input, ParserRuleContext ctx)
: base(message)
{ {
this.recognizer = recognizer; this.recognizer = recognizer;
this.input = input; this.input = input;

View File

@ -149,8 +149,8 @@ namespace Antlr4.Runtime
internal class InsertBeforeOp : TokenStreamRewriter.RewriteOperation internal class InsertBeforeOp : TokenStreamRewriter.RewriteOperation
{ {
public InsertBeforeOp(ITokenStream tokens, int index, object text) : base(tokens, public InsertBeforeOp(ITokenStream tokens, int index, object text)
index, text) : base(tokens, index, text)
{ {
} }
@ -177,8 +177,8 @@ namespace Antlr4.Runtime
{ {
protected internal int lastIndex; protected internal int lastIndex;
public ReplaceOp(ITokenStream tokens, int from, int to, object text) : base(tokens public ReplaceOp(ITokenStream tokens, int from, int to, object text)
, from, text) : base(tokens, from, text)
{ {
lastIndex = to; lastIndex = to;
} }

View File

@ -46,7 +46,8 @@ namespace Antlr4.Runtime.Tree
/// </remarks> /// </remarks>
public class ErrorNodeImpl : TerminalNodeImpl, IErrorNode public class ErrorNodeImpl : TerminalNodeImpl, IErrorNode
{ {
public ErrorNodeImpl(IToken token) : base(token) public ErrorNodeImpl(IToken token)
: base(token)
{ {
} }

View File

@ -136,7 +136,8 @@ namespace Antlr4.Runtime
/// <summary>Useful for subclasses that pull char from other than this.input.</summary> /// <summary>Useful for subclasses that pull char from other than this.input.</summary>
/// <remarks>Useful for subclasses that pull char from other than this.input.</remarks> /// <remarks>Useful for subclasses that pull char from other than this.input.</remarks>
public UnbufferedCharStream() : this(256) public UnbufferedCharStream()
: this(256)
{ {
} }
@ -148,22 +149,25 @@ namespace Antlr4.Runtime
data = new char[bufferSize]; data = new char[bufferSize];
} }
public UnbufferedCharStream(Stream input) : this(input, 256) public UnbufferedCharStream(Stream input)
: this(input, 256)
{ {
} }
public UnbufferedCharStream(TextReader input) : this(input, 256) public UnbufferedCharStream(TextReader input)
: this(input, 256)
{ {
} }
public UnbufferedCharStream(Stream input, int bufferSize) : this(bufferSize) public UnbufferedCharStream(Stream input, int bufferSize)
: this(bufferSize)
{ {
this.input = new StreamReader(input); this.input = new StreamReader(input);
Fill(1); Fill(1);
} }
public UnbufferedCharStream(TextReader input, int bufferSize) : this(bufferSize public UnbufferedCharStream(TextReader input, int bufferSize)
) : this(bufferSize)
{ {
// prime // prime
this.input = input; this.input = input;

View File

@ -128,7 +128,8 @@ namespace Antlr4.Runtime
/// </remarks> /// </remarks>
protected internal int currentTokenIndex = 0; protected internal int currentTokenIndex = 0;
public UnbufferedTokenStream(ITokenSource tokenSource) : this(tokenSource, 256) public UnbufferedTokenStream(ITokenSource tokenSource)
: this(tokenSource, 256)
{ {
} }