forked from jasder/antlr
Merge branch 'sharpen'
This commit is contained in:
commit
21dcd8f5a3
|
@ -1 +1 @@
|
|||
Subproject commit 421b0b305ac3db5fac0074f8b3ec36fed675b3b8
|
||||
Subproject commit dde8d7b3178c9654db7eccbbf6c629b4ed2e7fd4
|
|
@ -1 +1 @@
|
|||
Subproject commit 047ebf59b4eee4fc8700f62c4b365f7d190a5b33
|
||||
Subproject commit a33407d027751c632b53432f0e07ea8b62ee3a39
|
|
@ -469,13 +469,11 @@ namespace Antlr4.Runtime.Atn
|
|||
{
|
||||
// not implemented yet
|
||||
continue;
|
||||
goto default;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
/// ,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,7 +236,6 @@ namespace Antlr4.Runtime
|
|||
{
|
||||
// do nothing if we can't identify the exact kind of ATN state
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,89 +389,102 @@ outer_continue: ;
|
|||
{
|
||||
return Interpreter.GetCharPositionInLine();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetLine(int line)
|
||||
{
|
||||
Interpreter.SetLine(line);
|
||||
}
|
||||
|
||||
public virtual void SetCharPositionInLine(int charPositionInLine)
|
||||
{
|
||||
Interpreter.SetCharPositionInLine(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
|
||||
{
|
||||
return _input.Index;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </remarks>
|
||||
public virtual string GetText()
|
||||
{
|
||||
if (_text != null)
|
||||
get
|
||||
{
|
||||
return _text;
|
||||
return _input.Index;
|
||||
}
|
||||
return Interpreter.GetText(_input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the complete text of this token; it wipes any previous
|
||||
/// changes to the text.
|
||||
/// Return the text matched so far for the current token or any text
|
||||
/// override.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Set the complete text of this token; it wipes any previous
|
||||
/// changes to the text.
|
||||
/// Return the text matched so far for the current token or any text
|
||||
/// override.
|
||||
/// </remarks>
|
||||
public virtual void SetText(string text)
|
||||
/// <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
|
||||
{
|
||||
this._text = text;
|
||||
get
|
||||
{
|
||||
if (_text != null)
|
||||
{
|
||||
return _text;
|
||||
}
|
||||
return Interpreter.GetText(_input);
|
||||
}
|
||||
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
|
||||
{
|
||||
return _token;
|
||||
get
|
||||
{
|
||||
return _token;
|
||||
}
|
||||
set
|
||||
{
|
||||
IToken _token = value;
|
||||
this._token = _token;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetToken(IToken _token)
|
||||
public virtual int Type
|
||||
{
|
||||
this._token = _token;
|
||||
get
|
||||
{
|
||||
return _type;
|
||||
}
|
||||
set
|
||||
{
|
||||
int ttype = value;
|
||||
_type = ttype;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetType(int ttype)
|
||||
public virtual int Channel
|
||||
{
|
||||
_type = ttype;
|
||||
get
|
||||
{
|
||||
return _channel;
|
||||
}
|
||||
set
|
||||
{
|
||||
int channel = value;
|
||||
_channel = channel;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int GetType()
|
||||
public virtual string[] ModeNames
|
||||
{
|
||||
return _type;
|
||||
}
|
||||
|
||||
public virtual void SetChannel(int channel)
|
||||
{
|
||||
_channel = channel;
|
||||
}
|
||||
|
||||
public virtual int GetChannel()
|
||||
{
|
||||
return _channel;
|
||||
}
|
||||
|
||||
public virtual string[] GetModeNames()
|
||||
{
|
||||
return null;
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue