printtypicalcompilersymbols.java
来自「JAVA在编译原理上的应用。」· Java 代码 · 共 44 行
JAVA
44 行
package lolo.test;/** Used by all <tt>TypicalCompilerScannerBy...</tt> scanners to print the recognized symbols.. * * @author <a href="http://www.inf.uos.de/bernd" target="_blank">Bernd Kühl</a> (<a href="mailto:bernd@informatik.uni-osnabrueck.de">bernd@informatik.uni-osnabrueck.de</a>) */public class PrintTypicalCompilerSymbols { public static boolean print = false; static { try { print = new Boolean(System.getProperty("PrintTypicalCompilerSymbols.print")).booleanValue(); } catch (Exception e) { System.err.println(e); } } public static void integer(String integer) { if (print) System.out.println("found integer -"+new Long(integer)+"-"); } public static void floating(String integer) { if (print) System.out.println("found floating number -"+new Double(integer)+"-"); } public static void character(char ch) { if (print) System.out.println("found character -"+ch+"-"); } public static void word(String word) { if (print) System.out.println("found word -"+word+"-"); } public static void identifier(String identifier) { if (print) System.out.println("found identifier -"+identifier+"-"); } public static void whitespace(String whitespace) { if (print) System.out.println("found whitespace -"+whitespace+"-"); } public static void comment(String comment) { if (print) System.out.println("found comment -"+comment+"-"); } public static void quotedText(String quotedText) { if (print) System.out.println("found quotedText -"+quotedText+"-"); } public static void quotedChar(char ch) { if (print) System.out.println("found quotedChar -"+ch+"-"); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?