Mercurial > hg > Members > kono > PLparser
comparison src/plparser/Property.java @ 6:563bcb96e4fa
pretty printer
author | one |
---|---|
date | Mon, 30 Aug 2010 12:35:23 +0900 |
parents | b149a5aa465a |
children |
comparison
equal
deleted
inserted
replaced
5:29b5497fc942 | 6:563bcb96e4fa |
---|---|
1 package plparser; | 1 package plparser; |
2 | |
3 import java.io.PrintStream; | |
2 | 4 |
3 public class Property { | 5 public class Property { |
4 String name; | 6 String name; |
7 public static int indent_step = 4; | |
5 | 8 |
6 public Property() { | 9 public Property() { |
7 | 10 |
8 } | 11 } |
9 | 12 |
13 | 16 |
14 public String toString() { | 17 public String toString() { |
15 return name; | 18 return name; |
16 } | 19 } |
17 | 20 |
21 public void indent(PrintStream out, int indent,int flag) { | |
22 if (flag==0) return; | |
23 for(int i=0;i<indent;i++) | |
24 out.print(' '); | |
25 } | |
26 | |
27 public void pp(PrintStream out, int i,int flag) { | |
28 indent(out,i,flag); | |
29 out.print(toString()); | |
30 } | |
31 | |
18 } | 32 } |