2 * $Id: Yytoken.java,v 1.1 2006/04/15 14:10:48 platform Exp $
5 package org.json.simple.parser;
8 * @author FangYidong<fangyidong@yahoo.com.cn>
12 public static final int TYPE_VALUE = 0;// JSON primitive value:
13 // string,number,boolean,null
15 public static final int TYPE_LEFT_BRACE = 1;
17 public static final int TYPE_RIGHT_BRACE = 2;
19 public static final int TYPE_LEFT_SQUARE = 3;
21 public static final int TYPE_RIGHT_SQUARE = 4;
23 public static final int TYPE_COMMA = 5;
25 public static final int TYPE_COLON = 6;
27 public static final int TYPE_EOF = -1;// end of file
31 public Object value = null;
33 public Yytoken(int type, Object value)
39 public String toString()
41 StringBuffer sb = new StringBuffer();
45 sb.append("VALUE(").append(value).append(")");
48 sb.append("LEFT BRACE({)");
50 case TYPE_RIGHT_BRACE:
51 sb.append("RIGHT BRACE(})");
53 case TYPE_LEFT_SQUARE:
54 sb.append("LEFT SQUARE([)");
56 case TYPE_RIGHT_SQUARE:
57 sb.append("RIGHT SQUARE(])");
60 sb.append("COMMA(,)");
63 sb.append("COLON(:)");
66 sb.append("END OF FILE");