Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/debugtools/DDR_Autoblob/testsrc/TestConstantParser.java
6000 views
1
import java.io.File;
2
import java.io.IOException;
3
4
import com.ibm.j9ddr.autoblob.constants.ConstantParser;
5
import com.ibm.j9ddr.autoblob.constants.ICVisitor;
6
7
/*******************************************************************************
8
* Copyright (c) 2010, 2014 IBM Corp. and others
9
*
10
* This program and the accompanying materials are made available under
11
* the terms of the Eclipse Public License 2.0 which accompanies this
12
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
13
* or the Apache License, Version 2.0 which accompanies this distribution and
14
* is available at https://www.apache.org/licenses/LICENSE-2.0.
15
*
16
* This Source Code may also be made available under the following
17
* Secondary Licenses when the conditions for such availability set
18
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
19
* General Public License, version 2 with the GNU Classpath
20
* Exception [1] and GNU General Public License, version 2 with the
21
* OpenJDK Assembly Exception [2].
22
*
23
* [1] https://www.gnu.org/software/classpath/license.html
24
* [2] http://openjdk.java.net/legal/assembly-exception.html
25
*
26
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
27
*******************************************************************************/
28
29
/**
30
* @author andhall
31
*
32
*/
33
public class TestConstantParser
34
{
35
36
/**
37
* @param args
38
*/
39
public static void main(String[] args) throws IOException
40
{
41
for (String filename : args)
42
{
43
System.out.println("Trying " + filename);
44
45
ConstantParser parser = new ConstantParser();
46
47
parser.visitCFile(new File(filename), new ICVisitor(){
48
49
public void visitComment(String comment, int lineNumber)
50
{
51
System.out.println("START COMMENT, LINE " + lineNumber);
52
System.out.println(comment);
53
System.out.println("END COMMENT");
54
}
55
56
public void visitNumericConstant(String name, int lineNumber)
57
{
58
System.out.println("CONSTANT NAME: " + name + " LINE: " + lineNumber);
59
}
60
61
public void visitNoValueConstant(String name, boolean defined)
62
{
63
64
}});
65
}
66
}
67
68
}
69
70