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

📄 commandnode.java~6~

📁 《深入浅出设计模式》的完整源代码
💻 JAVA~6~
字号:
package littlecompiler;
// <command> ::= <repeat command> | <primitive command>
public class CommandNode implements Node {
  private Node node;

  public void parse (Context context) {
    if (context.currentToken ().equals ("REPEAT")) {
      node = new RepeatCommandNode ();
      node.parse (context);
    }
    else {
      node = new PrimitiveCommandNode ();
      node.parse (context);
    }
  }
  public void execute() {
      node.execute();
  }

  public String toString() {
      return node.toString();
  }

}

⌨️ 快捷键说明

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