ada.editor/src/org/netbeans/modules/ada/editor/ast/nodes/FieldAccess.java
author Andrea Lucarelli <raster@netbeans.org>
Sun, 22 Aug 2010 23:37:11 +0200
branchrelease68
changeset 16367 d2820c029d3a
permissions -rw-r--r--
Add JVM compiler support.
raster@16367
     1
/*
raster@16367
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
raster@16367
     3
 * 
raster@16367
     4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
raster@16367
     5
 * 
raster@16367
     6
 * The contents of this file are subject to the terms of either the GNU
raster@16367
     7
 * General Public License Version 2 only ("GPL") or the Common
raster@16367
     8
 * Development and Distribution License("CDDL") (collectively, the
raster@16367
     9
 * "License"). You may not use this file except in compliance with the
raster@16367
    10
 * License. You can obtain a copy of the License at
raster@16367
    11
 * http://www.netbeans.org/cddl-gplv2.html
raster@16367
    12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
raster@16367
    13
 * specific language governing permissions and limitations under the
raster@16367
    14
 * License.  When distributing the software, include this License Header
raster@16367
    15
 * Notice in each file and include the License file at
raster@16367
    16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
raster@16367
    17
 * particular file as subject to the "Classpath" exception as provided
raster@16367
    18
 * by Sun in the GPL Version 2 section of the License file that
raster@16367
    19
 * accompanied this code. If applicable, add the following below the
raster@16367
    20
 * License Header, with the fields enclosed by brackets [] replaced by
raster@16367
    21
 * your own identifying information:
raster@16367
    22
 * "Portions Copyrighted [year] [name of copyright owner]"
raster@16367
    23
 * 
raster@16367
    24
 * If you wish your version of this file to be governed by only the CDDL
raster@16367
    25
 * or only the GPL Version 2, indicate your decision by adding
raster@16367
    26
 * "[Contributor] elects to include this software in this distribution
raster@16367
    27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
raster@16367
    28
 * single choice of license, a recipient has the option to distribute
raster@16367
    29
 * your version of this file under either the CDDL, the GPL Version 2 or
raster@16367
    30
 * to extend the choice of license to its licensees as provided above.
raster@16367
    31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
raster@16367
    32
 * Version 2 license, then the option applies only if the new code is
raster@16367
    33
 * made subject to such option by the copyright holder.
raster@16367
    34
 * 
raster@16367
    35
 * Contributor(s):
raster@16367
    36
 * 
raster@16367
    37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
raster@16367
    38
 */
raster@16367
    39
package org.netbeans.modules.ada.editor.ast.nodes;
raster@16367
    40
raster@16367
    41
import org.netbeans.modules.ada.editor.ast.nodes.visitors.Visitor;
raster@16367
    42
raster@16367
    43
/**
raster@16367
    44
 * Represents a field access
raster@16367
    45
 * <pre>e.g.<pre>
raster@16367
    46
 *
raster@16367
    47
 * MyPackage.Foo
raster@16367
    48
 */
raster@16367
    49
public class FieldAccess extends Dispatch {
raster@16367
    50
raster@16367
    51
    private Variable field;
raster@16367
    52
raster@16367
    53
    public FieldAccess(int start, int end, NameBase dispatcher, Variable field) {
raster@16367
    54
        super(start, end, dispatcher);
raster@16367
    55
        this.field = field;
raster@16367
    56
    }
raster@16367
    57
raster@16367
    58
    /**
raster@16367
    59
     * Return the field component of this field access
raster@16367
    60
     * 
raster@16367
    61
     * @return the field component of this field access
raster@16367
    62
     */
raster@16367
    63
    public Variable getField() {
raster@16367
    64
        return field;
raster@16367
    65
    }
raster@16367
    66
raster@16367
    67
    /**
raster@16367
    68
     * see {@link #getField()}
raster@16367
    69
     */
raster@16367
    70
    public NameBase getMember() {
raster@16367
    71
        return getField();
raster@16367
    72
    }
raster@16367
    73
    
raster@16367
    74
    @Override
raster@16367
    75
    public void accept(Visitor visitor) {
raster@16367
    76
        visitor.visit(this);
raster@16367
    77
    }
raster@16367
    78
}