Package net.percederberg.mibble.value

Examples of net.percederberg.mibble.value.ValueReference


     * @throws ParseException if the node analysis discovered errors
     */
    protected Node exitDefinedValue(Production node)
        throws ParseException {

        ValueReference  ref;
        MibContext      local = getContext();
        String          name;
        Node            child;

        // Check for module reference
        child = getChildAt(node, 0);
        if (child.getId() == Asn1Constants.MODULE_REFERENCE) {
            name = getStringValue(child, 0);
            local = currentMib.getImport(name);
            if (local == null) {
                throw new ParseException(
                    ParseException.ANALYSIS_ERROR,
                    "referenced module not imported '" + name + "'",
                    child.getStartLine(),
                    child.getStartColumn());
            }
            child = getChildAt(node, 1);
        }

        // Create value reference
        name = getStringValue(child, 0);
        ref = new ValueReference(getLocation(node), local, name);
        node.addValue(ref);
        return node;
    }
View Full Code Here


        for (int i = 0; i < components.size(); i++) {
            number = (NamedNumber) components.get(i);
            if (number.hasNumber()) {
                value = number.getNumber().intValue();
                if (parent == null && value == 0) {
                    parent = new ValueReference(getLocation(node),
                                                getContext(),
                                                DefaultContext.CCITT);
                } else if (parent == null && value == 1) {
                    parent = new ValueReference(getLocation(node),
                                                getContext(),
                                                DefaultContext.ISO);
                } else if (parent == null && value == 2) {
                    parent = new ValueReference(getLocation(node),
                                                getContext(),
                                                DefaultContext.JOINT_ISO_CCITT);
                } else if (parent instanceof ObjectIdentifierValue) {
                    try {
                        parent = new ObjectIdentifierValue(
View Full Code Here

    protected Node exitNameOrNumber(Production node)
        throws ParseException {

        NamedNumber     value;
        Object          obj;
        ValueReference  ref;

        obj = getValue(getChildAt(node, 0), 0);
        if (obj instanceof Number) {
            value = new NamedNumber((Number) obj);
        } else if (obj instanceof String) {
            ref = new ValueReference(getLocation(node),
                                     getContext(),
                                     (String) obj);
            value = new NamedNumber((String) obj, ref);
        } else {
            value = (NamedNumber) obj;
View Full Code Here

TOP

Related Classes of net.percederberg.mibble.value.ValueReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.