2
// File: SIDLDumpVisitor.java
4
// Copyright: (c) 2005 The Lawrence Livermore National Security, LLC
6
// Revision: @(#) $Id: SIDLDumpVisitor.java 6171 2007-10-08 23:39:28Z epperly $
9
package gov.llnl.babel.parsers.sidl2;
11
import java.io.PrintStream;
13
public class SIDLDumpVisitor implements SIDLParserVisitor {
15
protected PrintStream out;
17
private int indent = 0;
19
public SIDLDumpVisitor ( PrintStream o ) {
23
private String indentString() {
24
StringBuffer sb = new StringBuffer();
25
for (int i = 0; i < indent; ++i) {
31
public Object visit( ParseTreeNode node, Object data) {
33
if(node.doc == null) {
35
} else if(node.doc != null && node.doc.length() != 0) {
36
doc_com = " /**" + node.doc + "*/";
38
if ( node.name.equals("") ) {
39
out.println(indentString() + node + doc_com );
41
out.println(indentString() + node + " (" + node.name + ")" + doc_com);
44
data = node.childrenAccept(this, data);