source: other-projects/rsyntax-textarea/devel-packages/jflex-1.4.3/examples/java/JavaParser.java@ 25584

Last change on this file since 25584 was 25584, checked in by davidb, 12 years ago

Initial cut an a text edit area for GLI that supports color syntax highlighting

File size: 2.0 KB
Line 
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Copyright (C) 1998-2009 Gerwin Klein <[email protected]> *
3 * All rights reserved. *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License. See the file *
7 * COPYRIGHT for more information. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License along *
15 * with this program; if not, write to the Free Software Foundation, Inc., *
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
17 * *
18 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
19
20import java.io.*;
21
22
23/**
24 * Simple test driver for the java parser. Just runs it on some
25 * input files, gives no useful output.
26 */
27public class JavaParser {
28
29 public static void main(String argv[]) {
30
31 for (int i = 0; i < argv.length; i++) {
32 try {
33 System.out.println("Parsing ["+argv[i]+"]");
34 Scanner s = new Scanner(new UnicodeEscapes(new FileReader(argv[i])));
35 parser p = new parser(s);
36 p.parse();
37
38 System.out.println("No errors.");
39 }
40 catch (Exception e) {
41 e.printStackTrace(System.out);
42 System.exit(1);
43 }
44 }
45 }
46
47}
Note: See TracBrowser for help on using the repository browser.