Merge branch 'sharpen'

This commit is contained in:
Sam Harwell 2013-02-25 13:04:05 -06:00
commit 21dcd8f5a3
7 changed files with 78 additions and 68 deletions

@ -1 +1 @@
Subproject commit 421b0b305ac3db5fac0074f8b3ec36fed675b3b8
Subproject commit dde8d7b3178c9654db7eccbbf6c629b4ed2e7fd4

@ -1 +1 @@
Subproject commit 047ebf59b4eee4fc8700f62c4b365f7d190a5b33
Subproject commit a33407d027751c632b53432f0e07ea8b62ee3a39

View File

@ -469,13 +469,11 @@ namespace Antlr4.Runtime.Atn
{
// not implemented yet
continue;
goto default;
}
default:
{
continue;
break;
}
}
}

View File

@ -514,7 +514,6 @@ namespace Antlr4.Runtime.Atn
{
c = null;
break;
break;
}
}
return c;
@ -536,7 +535,7 @@ namespace Antlr4.Runtime.Atn
/// </see>
/// before evaluating the predicate to ensure position
/// sensitive values, including
/// <see cref="Antlr4.Runtime.Lexer.GetText()">Antlr4.Runtime.Lexer.GetText()</see>
/// <see cref="Antlr4.Runtime.Lexer.Text()">Antlr4.Runtime.Lexer.Text()</see>
/// ,
/// <see cref="Antlr4.Runtime.Lexer.Line()">Antlr4.Runtime.Lexer.Line()</see>
/// ,

View File

@ -602,7 +602,6 @@ namespace Antlr4.Runtime.Atn
}
ReportAmbiguity(dfa, s, startIndex, stopIndex, alts, s.configs);
return alts.NextSetBit(0);
break;
}
}
}
@ -783,7 +782,6 @@ namespace Antlr4.Runtime.Atn
}
ReportAmbiguity(dfa, D, startIndex, stopIndex, alts, D.configs);
return alts.NextSetBit(0);
break;
}
}
}
@ -1411,7 +1409,6 @@ namespace Antlr4.Runtime.Atn
default:
{
break;
break;
}
}
if (checkClosure && !closureBusy.Add(c))
@ -1514,7 +1511,6 @@ namespace Antlr4.Runtime.Atn
default:
{
return null;
break;
}
}
}

View File

@ -236,7 +236,6 @@ namespace Antlr4.Runtime
{
// do nothing if we can't identify the exact kind of ATN state
break;
break;
}
}
}

View File

@ -349,7 +349,7 @@ outer_continue: ;
public virtual IToken Emit()
{
IToken t = _factory.Create(_tokenFactorySourcePair, _type, _text, _channel, _tokenStartCharIndex
, GetCharIndex() - 1, _tokenStartLine, _tokenStartCharPositionInLine);
, CharIndex - 1, _tokenStartLine, _tokenStartCharPositionInLine);
Emit(t);
return t;
}
@ -376,6 +376,11 @@ outer_continue: ;
{
return Interpreter.GetLine();
}
set
{
int line = value;
Interpreter.SetLine(line);
}
}
public virtual int Column
@ -384,33 +389,41 @@ outer_continue: ;
{
return Interpreter.GetCharPositionInLine();
}
}
public virtual void SetLine(int line)
{
Interpreter.SetLine(line);
}
public virtual void SetCharPositionInLine(int charPositionInLine)
set
{
int charPositionInLine = value;
Interpreter.SetCharPositionInLine(charPositionInLine);
}
}
/// <summary>What is the index of the current character of lookahead?</summary>
public virtual int GetCharIndex()
public virtual int CharIndex
{
get
{
return _input.Index;
}
}
/// <summary>
/// Return the text matched so far for the current token or any
/// text override.
/// Return the text matched so far for the current token or any text
/// override.
/// </summary>
/// <remarks>
/// Return the text matched so far for the current token or any
/// text override.
/// Return the text matched so far for the current token or any text
/// override.
/// </remarks>
public virtual string GetText()
/// <summary>
/// Set the complete text of this token; it wipes any previous changes to the
/// text.
/// </summary>
/// <remarks>
/// Set the complete text of this token; it wipes any previous changes to the
/// text.
/// </remarks>
public virtual string Text
{
get
{
if (_text != null)
{
@ -418,56 +431,61 @@ outer_continue: ;
}
return Interpreter.GetText(_input);
}
/// <summary>
/// Set the complete text of this token; it wipes any previous
/// changes to the text.
/// </summary>
/// <remarks>
/// Set the complete text of this token; it wipes any previous
/// changes to the text.
/// </remarks>
public virtual void SetText(string text)
set
{
string text = value;
this._text = text;
}
}
/// <summary>Override if emitting multiple tokens.</summary>
/// <remarks>Override if emitting multiple tokens.</remarks>
public virtual IToken GetToken()
public virtual IToken Token
{
get
{
return _token;
}
public virtual void SetToken(IToken _token)
set
{
IToken _token = value;
this._token = _token;
}
public virtual void SetType(int ttype)
{
_type = ttype;
}
public virtual int GetType()
public virtual int Type
{
get
{
return _type;
}
public virtual void SetChannel(int channel)
set
{
_channel = channel;
int ttype = value;
_type = ttype;
}
}
public virtual int GetChannel()
public virtual int Channel
{
get
{
return _channel;
}
set
{
int channel = value;
_channel = channel;
}
}
public virtual string[] GetModeNames()
public virtual string[] ModeNames
{
get
{
return null;
}
}
/// <summary>
/// Used to print out token names like ID during debugging and