Path: blob/master/debugtools/DDR_Autoblob/testsrc/TestConstantParser.java
6000 views
import java.io.File;1import java.io.IOException;23import com.ibm.j9ddr.autoblob.constants.ConstantParser;4import com.ibm.j9ddr.autoblob.constants.ICVisitor;56/*******************************************************************************7* Copyright (c) 2010, 2014 IBM Corp. and others8*9* This program and the accompanying materials are made available under10* the terms of the Eclipse Public License 2.0 which accompanies this11* distribution and is available at https://www.eclipse.org/legal/epl-2.0/12* or the Apache License, Version 2.0 which accompanies this distribution and13* is available at https://www.apache.org/licenses/LICENSE-2.0.14*15* This Source Code may also be made available under the following16* Secondary Licenses when the conditions for such availability set17* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU18* General Public License, version 2 with the GNU Classpath19* Exception [1] and GNU General Public License, version 2 with the20* OpenJDK Assembly Exception [2].21*22* [1] https://www.gnu.org/software/classpath/license.html23* [2] http://openjdk.java.net/legal/assembly-exception.html24*25* 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-exception26*******************************************************************************/2728/**29* @author andhall30*31*/32public class TestConstantParser33{3435/**36* @param args37*/38public static void main(String[] args) throws IOException39{40for (String filename : args)41{42System.out.println("Trying " + filename);4344ConstantParser parser = new ConstantParser();4546parser.visitCFile(new File(filename), new ICVisitor(){4748public void visitComment(String comment, int lineNumber)49{50System.out.println("START COMMENT, LINE " + lineNumber);51System.out.println(comment);52System.out.println("END COMMENT");53}5455public void visitNumericConstant(String name, int lineNumber)56{57System.out.println("CONSTANT NAME: " + name + " LINE: " + lineNumber);58}5960public void visitNoValueConstant(String name, boolean defined)61{6263}});64}65}6667}686970