本文整理汇总了C#中Antlr.Runtime.RecognitionException.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# RecognitionException.ToString方法的具体用法?C# RecognitionException.ToString怎么用?C# RecognitionException.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Antlr.Runtime.RecognitionException
的用法示例。
在下文中一共展示了RecognitionException.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReportError
public void ReportError(RecognitionException e)
{
ReportError( e.ToString() );
_recognitionExceptions.Add( e );
if ( log.IsDebugEnabled ) {
log.Debug( e.ToString(), e );
}
}
示例2: ReportError
public override void ReportError(RecognitionException e)
{
if (e is MissingTokenException)
{
errors.Add(string.Format("{0}:{1} - Unexpected {2}\n {3}", e.Line, e.CharPositionInLine, e.Token.Text, e));
}
else
{
errors.Add(string.Format("{0}:{1} - Error with token {2}\n {3}", e.Line, e.CharPositionInLine, e.Token.Text, e.ToString()));
}
base.ReportError(e);
}
示例3: ReportError
public override void ReportError(RecognitionException ex)
{
IToken token = null;
if (ex is MismatchedTokenException)
{
token = ((MismatchedTokenException)ex).Token;
}
else if (ex is NoViableAltException)
{
token = ((NoViableAltException)ex).Token;
}
ErrorManager.SyntaxError(
ErrorManager.MSG_SYNTAX_ERROR,
grammar,
token,
"assign.types: " + ex.ToString(),
ex);
}
示例4: ReportError
public override void ReportError(RecognitionException e) {
Errors.Add(e.ToString());
}
示例5: ReportError
public override void ReportError( RecognitionException ex )
{
if ( inTest > 0 )
throw ex;
IToken token = null;
if ( ex is MismatchedTokenException )
{
token = ( (MismatchedTokenException)ex ).Token;
}
else if ( ex is NoViableAltException )
{
token = ( (NoViableAltException)ex ).Token;
}
ErrorManager.SyntaxError(
ErrorManager.MSG_SYNTAX_ERROR,
grammar,
token,
"buildnfa: " + ex.ToString(),
ex );
}
示例6: ReportError
public override void ReportError( RecognitionException ex )
{
//Token token = null;
//try
//{
// token = LT( 1 );
//}
//catch ( TokenStreamException tse )
//{
// ErrorManager.internalError( "can't get token???", tse );
//}
IToken token = ex.Token;
ErrorManager.SyntaxError(
ErrorManager.MSG_SYNTAX_ERROR,
Grammar,
token,
"antlr: " + ex.ToString(),
ex );
}