本文整理汇总了C#中IIntStream类的典型用法代码示例。如果您正苦于以下问题:C# IIntStream类的具体用法?C# IIntStream怎么用?C# IIntStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IIntStream类属于命名空间,在下文中一共展示了IIntStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NoViableAltException
public NoViableAltException(string grammarDecisionDescription, int decisionNumber, int stateNumber, IIntStream input)
: base(input)
{
this.grammarDecisionDescription = grammarDecisionDescription;
this.decisionNumber = decisionNumber;
this.stateNumber = stateNumber;
}
示例2: NoViableAltException
public NoViableAltException(string message, string grammarDecisionDescription, int decisionNumber, int stateNumber, IIntStream input, Exception innerException)
: base(message, input, innerException)
{
this._grammarDecisionDescription = grammarDecisionDescription;
this._decisionNumber = decisionNumber;
this._stateNumber = stateNumber;
}
示例3: RecognitionException
public RecognitionException(string message, IIntStream input, Exception innerException) : base(message, innerException)
{
this._input = input;
if (input != null)
{
this._index = input.Index;
if (input is ITokenStream)
{
this._token = ((ITokenStream) input).LT(1);
this._line = this._token.Line;
this._charPositionInLine = this._token.CharPositionInLine;
}
ITreeNodeStream stream = input as ITreeNodeStream;
if (stream != null)
{
this.ExtractInformationFromTreeNodeStream(stream);
}
else if (input is ICharStream)
{
this._c = input.LA(1);
this._line = ((ICharStream) input).Line;
this._charPositionInLine = ((ICharStream) input).CharPositionInLine;
}
else
{
this._c = input.LA(1);
}
}
}
示例4: MismatchedTokenException
public MismatchedTokenException(string message, int expecting, IIntStream input, IList<string> tokenNames, Exception innerException)
: base(message, input, innerException) {
this._expecting = expecting;
if (tokenNames != null)
this._tokenNames = new ReadOnlyCollection<string>(new List<string>(tokenNames));
}
示例5: MatchAny
public override void MatchAny(IIntStream ignore)
{
base.state.errorRecovery = false;
base.state.failed = false;
this.input.Consume();
if (this.input.LA(1) == 2)
{
this.input.Consume();
int num2 = 1;
while (num2 > 0)
{
switch (this.input.LA(1))
{
case -1:
return;
case 2:
num2++;
break;
case 3:
num2--;
break;
}
this.input.Consume();
}
}
}
示例6: MismatchedTokenException
public MismatchedTokenException(string message, int expecting, IIntStream input, IList<string> tokenNames)
: base(message, input)
{
this._expecting = expecting;
if (tokenNames != null)
this._tokenNames = tokenNames.ToList().AsReadOnly();
}
示例7: RecognitionException
public RecognitionException(IRecognizer recognizer, IIntStream input, ParserRuleContext ctx)
{
this.recognizer = recognizer;
this.input = input;
this.ctx = ctx;
if (recognizer != null)
{
this.offendingState = recognizer.State;
}
}
示例8: NoViableAlt
protected virtual void NoViableAlt(int s, IIntStream input)
{
if (this.recognizer.state.backtracking > 0)
{
this.recognizer.state.failed = true;
}
else
{
NoViableAltException nvae = new NoViableAltException(this.Description, this.decisionNumber, s, input);
this.Error(nvae);
throw nvae;
}
}
示例9: AlreadyParsedRule
public virtual bool AlreadyParsedRule(IIntStream input, int ruleIndex)
{
int ruleMemoization = this.GetRuleMemoization(ruleIndex, input.Index);
switch (ruleMemoization)
{
case -1:
return false;
case -2:
this.state.failed = true;
break;
default:
input.Seek(ruleMemoization + 1);
break;
}
return true;
}
示例10: GetMissingSymbol
protected override object GetMissingSymbol(IIntStream input,
RecognitionException e,
int expectedTokenType,
BitSet follow)
{
String tokenText = null;
if ( expectedTokenType==Token.EOF ) tokenText = "<missing EOF>";
else tokenText = "<missing " + TokenNames[expectedTokenType] + ">";
CommonToken t = new CommonToken(expectedTokenType, tokenText);
IToken current = ((ITokenStream)input).LT(1);
if (current.Type == Token.EOF) {
current = ((ITokenStream)input).LT(-1);
}
t.line = current.Line;
t.CharPositionInLine = current.CharPositionInLine;
t.Channel = DEFAULT_TOKEN_CHANNEL;
return t;
}
示例11: Match
public override object Match(IIntStream input, int ttype, BitSet follow)
{
object currentInputSymbol = this.GetCurrentInputSymbol(input);
DumpSymbol(currentInputSymbol);
if (input.LA(1) == ttype)
{
input.Consume();
this.state.errorRecovery = false;
this.state.failed = false;
return currentInputSymbol;
}
else
{
if (this.state.backtracking <= 0)
return this.RecoverFromMismatchedToken(input, ttype, follow);
this.state.failed = true;
return currentInputSymbol;
}
}
示例12: GetMissingSymbol
protected override object GetMissingSymbol(IIntStream input, RecognitionException e, int expectedTokenType, BitSet follow)
{
string text = null;
if (expectedTokenType == -1)
{
text = "<missing EOF>";
}
else
{
text = "<missing " + this.TokenNames[expectedTokenType] + ">";
}
CommonToken token = new CommonToken(expectedTokenType, text);
IToken token2 = ((ITokenStream) input).LT(1);
if (token2.Type == -1)
{
token2 = ((ITokenStream) input).LT(-1);
}
token.Line = token2.Line;
token.CharPositionInLine = token2.CharPositionInLine;
token.Channel = 0;
return token;
}
示例13: GetMissingSymbol
protected override object GetMissingSymbol( IIntStream input,
RecognitionException e,
int expectedTokenType,
BitSet follow )
{
string tokenText = null;
if ( expectedTokenType == TokenTypes.EndOfFile )
tokenText = "<missing EOF>";
else
tokenText = "<missing " + TokenNames[expectedTokenType] + ">";
CommonToken t = new CommonToken( expectedTokenType, tokenText );
IToken current = ( (ITokenStream)input ).LT( 1 );
if ( current.Type == TokenTypes.EndOfFile )
{
current = ( (ITokenStream)input ).LT( -1 );
}
t.Line = current.Line;
t.CharPositionInLine = current.CharPositionInLine;
t.Channel = DefaultTokenChannel;
t.InputStream = current.InputStream;
return t;
}
示例14: SpecialStateTransition5
private int SpecialStateTransition5(DFA dfa, int s, IIntStream _input)
{
IIntStream input = _input;
int _s = s;
switch (s)
{
case 0:
int LA5_31 = input.LA(1);
s = -1;
if ( ((LA5_31>='\u0000' && LA5_31<='\uFFFF')) ) {s = 63;}
else s = 62;
if ( s>=0 ) return s;
break;
}
NoViableAltException nvae = new NoViableAltException(dfa.Description, 5, _s, input);
dfa.Error(nvae);
throw nvae;
}
示例15: DFA8_SpecialStateTransition
protected internal int DFA8_SpecialStateTransition(DFA dfa, int s, IIntStream _input) //throws NoViableAltException
{
IIntStream input = _input;
int _s = s;
switch ( s )
{
case 0 :
int LA8_6 = input.LA(1);
s = -1;
if ( ((LA8_6 >= '\u0000' && LA8_6 <= '\uFFFF')) ) { s = 40; }
else s = 39;
if ( s >= 0 ) return s;
break;
case 1 :
int LA8_7 = input.LA(1);
s = -1;
if ( ((LA8_7 >= '\u0000' && LA8_7 <= '\uFFFF')) ) { s = 42; }
else s = 41;
if ( s >= 0 ) return s;
break;
case 2 :
int LA8_0 = input.LA(1);
s = -1;
if ( (LA8_0 == 'G') ) { s = 1; }
else if ( (LA8_0 == 'S') ) { s = 2; }
else if ( (LA8_0 == '[') ) { s = 3; }
else if ( ((LA8_0 >= '\t' && LA8_0 <= '\n') || LA8_0 == '\r' || LA8_0 == ' ') ) { s = 4; }
else if ( (LA8_0 == '%') ) { s = 5; }
else if ( (LA8_0 == '\"') ) { s = 6; }
else if ( (LA8_0 == '\'') ) { s = 7; }
else if ( (LA8_0 == 'C') ) { s = 8; }
else if ( (LA8_0 == 'D') ) { s = 9; }
else if ( (LA8_0 == 'I') ) { s = 10; }
else if ( (LA8_0 == 'P') ) { s = 11; }
else if ( (LA8_0 == 'W') ) { s = 12; }
else if ( (LA8_0 == 'B') ) { s = 13; }
else if ( (LA8_0 == 'F') ) { s = 14; }
else if ( (LA8_0 == 'U') ) { s = 15; }
else if ( (LA8_0 == 'E') ) { s = 16; }
else if ( (LA8_0 == 'M') ) { s = 17; }
else if ( (LA8_0 == 'R') ) { s = 18; }
else if ( (LA8_0 == 'T') ) { s = 19; }
else if ( (LA8_0 == 'N') ) { s = 20; }
else if ( (LA8_0 == 'L') ) { s = 21; }
else if ( (LA8_0 == 'A' || LA8_0 == 'H' || (LA8_0 >= 'J' && LA8_0 <= 'K') || LA8_0 == 'O' || LA8_0 == 'Q' || LA8_0 == 'V' || (LA8_0 >= 'X' && LA8_0 <= 'Z') || LA8_0 == '_' || (LA8_0 >= 'a' && LA8_0 <= 'z')) ) { s = 22; }
else if ( ((LA8_0 >= '0' && LA8_0 <= '9')) ) { s = 23; }
else if ( (LA8_0 == '+') ) { s = 24; }
else if ( (LA8_0 == '-') ) { s = 25; }
else if ( (LA8_0 == '*') ) { s = 26; }
else if ( (LA8_0 == '/') ) { s = 27; }
else if ( (LA8_0 == '=') ) { s = 28; }
else if ( ((LA8_0 >= '\u0000' && LA8_0 <= '\b') || (LA8_0 >= '\u000B' && LA8_0 <= '\f') || (LA8_0 >= '\u000E' && LA8_0 <= '\u001F') || LA8_0 == '!' || (LA8_0 >= '#' && LA8_0 <= '$') || LA8_0 == '&' || (LA8_0 >= '(' && LA8_0 <= ')') || LA8_0 == ',' || LA8_0 == '.' || (LA8_0 >= ':' && LA8_0 <= '<') || (LA8_0 >= '>' && LA8_0 <= '@') || (LA8_0 >= '\\' && LA8_0 <= '^') || LA8_0 == '`' || (LA8_0 >= '{' && LA8_0 <= '\uFFFF')) ) { s = 29; }
if ( s >= 0 ) return s;
break;
}
NoViableAltException nvae8 =
new NoViableAltException(dfa.Description, 8, _s, input);
dfa.Error(nvae8);
throw nvae8;
}