01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.jdo.query;
12:
13: /**
14: * Container for method calls and array indexing.
15: */
16: public class PrimaryExprNode extends Node {
17:
18: public PrimaryExprNode() {
19: }
20:
21: public Field visit(MemVisitor visitor, Object obj) {
22: return visitor.visitPrimaryExprNode(this , obj);
23: }
24:
25: /**
26: * Simplify this node tree as much as possible.
27: */
28: protected void normalizeImp() {
29: super .normalizeImp();
30: // convert this tree:
31: // PrimaryExprNode [this]
32: // FieldNavNode data (cast Address)
33: // into:
34: // FieldNavNode data (cast: Address)
35: if (parent != null && childList instanceof FieldNavNode) {
36: parent.replaceChild(this , childList);
37: }
38: }
39:
40: public Object arrive(NodeVisitor v, Object msg) {
41: return v.arrivePrimaryExprNode(this, msg);
42: }
43:
44: }
|