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

📄 main.java

📁 java语法解释器生成器
💻 JAVA
字号:
/*  This example comes from a short article series in the Linux   Gazette by Richard A. Sevenich and Christopher Lopes, titled  "Compiler Construction Tools". The article series starts at  http://www.linuxgazette.com/issue39/sevenich.html  Small changes and updates to newest JFlex+Cup versions   by Gerwin Klein*//*  Commented By: Christopher Lopes  File Name: Main.java  To Create:   After the scanner, lcalc.flex, and the parser, ycalc.cup, have been created.  > javac Main.java    To Run:   > java Main test.txt  where test.txt is an test input file for the calculator.*/   import java.io.*;   public class Main {  static public void main(String argv[]) {        /* Start the parser */    try {      parser p = new parser(new Lexer(new FileReader(argv[0])));      Object result = p.parse().value;          } catch (Exception e) {      /* do cleanup here -- possibly rethrow e */      e.printStackTrace();    }  }}

⌨️ 快捷键说明

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