001 /* Generated By:JJTree: Do not edit this line. ASTvalue.java */ 002 003 package net.sourceforge.javajson.parser; 004 005 public class ASTvalue extends SimpleNode { 006 String val; 007 008 public ASTvalue(int id) { 009 super(id); 010 } 011 012 public ASTvalue(JsonParser p, int id) { 013 super(p, id); 014 } 015 016 @Override 017 protected void interpret() { 018 if (children != null) { 019 for (int i = 0; i < children.length; i++) { 020 if (children[i] instanceof SimpleNode) { 021 SimpleNode node = (SimpleNode) children[i]; 022 node.interpret(); 023 // push(node); 024 } 025 } 026 } else { 027 //System.out.println("What's my value?" + val); 028 if ("true".equals(val)) 029 push(Boolean.TRUE); 030 else if ("false".equals(val)) 031 push(Boolean.FALSE); 032 else if ("null".equals(val)) 033 push(null); 034 } 035 } 036 037 @Override 038 protected void push(Object o) { 039 ((SimpleNode) parent).push(o); 040 } 041 042 }