Mercurial > hg > Members > kono > PLparser
diff src/plparser/Property.java @ 6:563bcb96e4fa
pretty printer
author | one |
---|---|
date | Mon, 30 Aug 2010 12:35:23 +0900 |
parents | b149a5aa465a |
children |
line wrap: on
line diff
--- a/src/plparser/Property.java Sun Aug 29 20:28:00 2010 +0900 +++ b/src/plparser/Property.java Mon Aug 30 12:35:23 2010 +0900 @@ -1,7 +1,10 @@ package plparser; +import java.io.PrintStream; + public class Property { String name; + public static int indent_step = 4; public Property() { @@ -15,4 +18,15 @@ return name; } + public void indent(PrintStream out, int indent,int flag) { + if (flag==0) return; + for(int i=0;i<indent;i++) + out.print(' '); + } + + public void pp(PrintStream out, int i,int flag) { + indent(out,i,flag); + out.print(toString()); + } + }