Package net.percederberg.grammatica.parser

Examples of net.percederberg.grammatica.parser.Node


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

        Node    child;
        Number  number;
        String  text;

        child = getChildAt(node, 0);
        number = (Number) child.getValue(0);
        text = (String) child.getValue(1);
        node.addValue(new BinaryNumberValue(number, text.length()));
        return node;
    }
View Full Code Here


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

        Node    child;
        Number  number;
        String  text;

        child = getChildAt(node, 0);
        number = (Number) child.getValue(0);
        text = (String) child.getValue(1);
        node.addValue(new HexNumberValue(number, text.length()));
        return node;
    }
View Full Code Here

        SnmpStatus      status = null;
        String          desc = null;
        String          ref = null;
        Object          index = null;
        MibValue        defVal = null;
        Node            child;

        for (int i = 0; i < node.getChildCount(); i++) {
            child = node.getChildAt(i);
            switch (child.getId()) {
            case Asn1Constants.SNMP_SYNTAX_PART:
                syntax = (MibType) getValue(child, 0);
                if (syntax instanceof MibContext) {
                    popContext();
                }
View Full Code Here

        ArrayList   objects = new ArrayList();
        SnmpStatus  status = null;
        String      desc = null;
        String      ref = null;
        Node        child;

        currentMib.setSmiVersion(2);
        for (int i = 0; i < node.getChildCount(); i++) {
            child = node.getChildAt(i);
            switch (child.getId()) {
            case Asn1Constants.SNMP_OBJECTS_PART:
                objects = (ArrayList) getValue(child, 0);
                break;
            case Asn1Constants.SNMP_STATUS_PART:
                status = (SnmpStatus) getValue(child, 0);
View Full Code Here

        MibValue   enterprise = null;
        ArrayList  vars = new ArrayList();
        String     desc = null;
        String     ref = null;
        Node       child;

        for (int i = 0; i < node.getChildCount(); i++) {
            child = node.getChildAt(i);
            switch (child.getId()) {
            case Asn1Constants.SNMP_ENTERPRISE_PART:
                enterprise = (MibValue) getValue(child, 0);
                break;
            case Asn1Constants.SNMP_VAR_PART:
                vars = child.getAllValues();
                break;
            case Asn1Constants.SNMP_DESCR_PART:
                desc = getStringValue(child, 0);
                break;
            case Asn1Constants.SNMP_REFER_PART:
View Full Code Here

        String      display = null;
        SnmpStatus  status = null;
        String      desc = null;
        String      ref = null;
        MibType     syntax = null;
        Node        child;

        currentMib.setSmiVersion(2);
        for (int i = 0; i < node.getChildCount(); i++) {
            child = node.getChildAt(i);
            switch (child.getId()) {
            case Asn1Constants.SNMP_DISPLAY_PART:
                display = getStringValue(child, 0);
                break;
            case Asn1Constants.SNMP_STATUS_PART:
                status = (SnmpStatus) getValue(child, 0);
View Full Code Here

        SnmpStatus  status = null;
        String      desc = null;
        String      ref = null;
        ArrayList   modules = new ArrayList();
        Node        child;

        currentMib.setSmiVersion(2);
        for (int i = 0; i < node.getChildCount(); i++) {
            child = node.getChildAt(i);
            switch (child.getId()) {
            case Asn1Constants.SNMP_STATUS_PART:
                status = (SnmpStatus) getValue(child, 0);
                break;
            case Asn1Constants.SNMP_DESCR_PART:
                desc = getStringValue(child, 0);
View Full Code Here

        String      prod = null;
        SnmpStatus  status = null;
        String      desc = null;
        String      ref = null;
        ArrayList   modules = new ArrayList();
        Node        child;

        currentMib.setSmiVersion(2);
        for (int i = 0; i < node.getChildCount(); i++) {
            child = node.getChildAt(i);
            switch (child.getId()) {
            case Asn1Constants.SNMP_PRODUCT_RELEASE_PART:
                prod = getStringValue(child, 0);
                break;
            case Asn1Constants.SNMP_STATUS_PART:
                status = (SnmpStatus) getValue(child, 0);
View Full Code Here

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

        Node    child;
        String  name;

        child = getChildAt(node, 1);
        name = getStringValue(child, 0);
        if (name.equals("mandatory")) {
            node.addValue(SnmpStatus.MANDATORY);
        } else if (name.equals("optional")) {
            node.addValue(SnmpStatus.OPTIONAL);
        } else if (name.equals("current")) {
            node.addValue(SnmpStatus.CURRENT);
        } else if (name.equals("deprecated")) {
            node.addValue(SnmpStatus.DEPRECATED);
        } else if (name.equals("obsolete")) {
            node.addValue(SnmpStatus.OBSOLETE);
        } else {
            node.addValue(SnmpStatus.CURRENT);
            throw new ParseException(
                ParseException.ANALYSIS_ERROR,
                "unrecognized status value: '" + name + "'",
                child.getStartLine(),
                child.getStartColumn());
        }
        return node;
    }
View Full Code Here

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

        Node    child;
        String  name;

        child = getChildAt(node, 0);
        if (child.getId() != Asn1Constants.ACCESS) {
            currentMib.setSmiVersion(2);
        }
        child = getChildAt(node, 1);
        name = getStringValue(child, 0);
        if (name.equals("read-only")) {
            node.addValue(SnmpAccess.READ_ONLY);
        } else if (name.equals("read-write")) {
            node.addValue(SnmpAccess.READ_WRITE);
        } else if (name.equals("read-create")) {
            node.addValue(SnmpAccess.READ_CREATE);
        } else if (name.equals("write-only")) {
            node.addValue(SnmpAccess.WRITE_ONLY);
        } else if (name.equals("not-implemented")) {
            node.addValue(SnmpAccess.NOT_IMPLEMENTED);
        } else if (name.equals("not-accessible")) {
            node.addValue(SnmpAccess.NOT_ACCESSIBLE);
        } else if (name.equals("accessible-for-notify")) {
            node.addValue(SnmpAccess.ACCESSIBLE_FOR_NOTIFY);
        } else {
            node.addValue(SnmpAccess.READ_WRITE);
            throw new ParseException(
                ParseException.ANALYSIS_ERROR,
                "unrecognized access value: '" + name + "'",
                child.getStartLine(),
                child.getStartColumn());
        }
        return node;
    }
View Full Code Here

TOP

Related Classes of net.percederberg.grammatica.parser.Node

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.