⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 evaluationexception.java

📁 外国人写的c#语法解析器
💻 JAVA
字号:
/**
 * Soft Gems Resource parser. Created by Mike Lischke.
 * 
 * The source code in this file can freely be used for any purpose provided this notice remains 
 * unchanged in the file.
 * 
 * Copyright 2004 by Mike Lischke, www.soft-gems.net, public@soft-gems.net. All rights reserved.
 */

package net.softgems.resourceparser.expressions;

import java.text.MessageFormat;

import antlr.collections.AST;

/**
 * This exception class is used in the expression evaluator to provide special information.
 */
public class EvaluationException extends RuntimeException
{
  //------------------------------------------------------------------------------------------------

  /**
   * Standard constructor for the exception.
   */
  public EvaluationException(String message) 
  {
    super(message);
  }

  //------------------------------------------------------------------------------------------------

  /**
   * Extended constructor to provide information about an invalid node.
   * 
   * @param node The node to show information for.
   */
  public static EvaluationException create(AST node)
  {
    String message = MessageFormat.format("[Expression evaluator] [{0}, {1}] Invalid token \"{2}\"",
      new Object[] 
      {
        new Integer(node.getLine()), 
        new Integer(node.getColumn()),
        node.getText()
      }
    );

    return new EvaluationException(message);
  }

  //------------------------------------------------------------------------------------------------

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -