Mercurial > hg > Members > kono > PLparser
diff src/plparser/ArrayProperty.java @ 6:563bcb96e4fa
pretty printer
author | one |
---|---|
date | Mon, 30 Aug 2010 12:35:23 +0900 |
parents | 1f46c9d09c1e |
children | 1baccfe55597 |
line wrap: on
line diff
--- a/src/plparser/ArrayProperty.java Sun Aug 29 20:28:00 2010 +0900 +++ b/src/plparser/ArrayProperty.java Mon Aug 30 12:35:23 2010 +0900 @@ -1,5 +1,6 @@ package plparser; +import java.io.PrintStream; import java.util.LinkedList; public class ArrayProperty extends Property { @@ -19,5 +20,19 @@ s += ")"; return s; } + + public void pp(PrintStream out, int indent, int flag) { + indent(out, indent,flag); + out.print("Array("); + flag = 0; + for(int i = 0;i<list.size();i++) { + list.get(i).pp(out,indent+indent_step,flag); flag = 1; + if (i<list.size()-1) out.println(","); + else { + if (list.size()>1) indent(out,indent,1); + out.print(")"); + } + } + } }