View Javadoc

1   /* Generated By:JJTree: Do not edit this line. ASTOrNode.java */
2   
3   package org.osoco.dyninc.parser;
4   
5   import org.osoco.dyninc.ConversionUtil;
6   import org.osoco.dyninc.Context;
7   
8   public class ASTOrNode extends SimpleNode {
9     public ASTOrNode(int id) {
10      super(id);
11    }
12  
13    public ASTOrNode(Parser p, int id) {
14      super(p, id);
15    }
16  
17    public static Node jjtCreate(int id) {
18        return new ASTOrNode(id);
19    }
20  
21    public static Node jjtCreate(Parser p, int id) {
22        return new ASTOrNode(p, id);
23    }
24  
25    /*** Accept the visitor. **/
26    public Object jjtAccept(ParserVisitor visitor, Object data) {
27      return visitor.visit(this, data);
28    }
29    
30    /* (non-Javadoc)
31     * @see org.osoco.dyninc.parser.SimpleNode#getValue(org.osoco.dyninc.Context, java.lang.Object)
32     */
33    protected Object getValue(Context context, Object current)
34    throws Exception {
35        Object left = ((SimpleNode) jjtGetChild(0)).getValue(context, current);
36        if ( !ConversionUtil.convertToBoolean(left).booleanValue() ) {
37            Object right = ((SimpleNode) jjtGetChild(1)).getValue(context, current);
38  
39            return ConversionUtil.convertToBoolean(right);
40        }
41        return Boolean.TRUE;
42    }
43    
44  }