Search in sources :

Example 6 with ParseException

use of com.eprosima.idl.parser.exception.ParseException in project ihmc-pub-sub by ihmcrobotics.

the class IDLParser method any_type.

public final Any_typeContext any_type() throws RecognitionException {
    Any_typeContext _localctx = new Any_typeContext(_ctx, getState());
    enterRule(_localctx, 136, RULE_any_type);
    Token tk = _input.LT(1);
    try {
        enterOuterAlt(_localctx, 1);
        {
            setState(946);
            match(KW_ANY);
            throw new ParseException(tk, ". Any type is not supported");
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        exitRule();
    }
    return _localctx;
}
Also used : ParseException(com.eprosima.idl.parser.exception.ParseException)

Example 7 with ParseException

use of com.eprosima.idl.parser.exception.ParseException in project ihmc-pub-sub by ihmcrobotics.

the class IDLParser method value_base_type.

public final Value_base_typeContext value_base_type() throws RecognitionException {
    Value_base_typeContext _localctx = new Value_base_typeContext(_ctx, getState());
    enterRule(_localctx, 218, RULE_value_base_type);
    Token tk = _input.LT(1);
    try {
        enterOuterAlt(_localctx, 1);
        {
            setState(1280);
            match(KW_VALUEBASE);
            throw new ParseException(tk, ". Value type is not supported");
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        exitRule();
    }
    return _localctx;
}
Also used : ParseException(com.eprosima.idl.parser.exception.ParseException)

Example 8 with ParseException

use of com.eprosima.idl.parser.exception.ParseException in project ihmc-pub-sub by ihmcrobotics.

the class IDLParser method annotation_appl.

public final Annotation_applContext annotation_appl() throws RecognitionException {
    Annotation_applContext _localctx = new Annotation_applContext(_ctx, getState());
    enterRule(_localctx, 300, RULE_annotation_appl);
    AnnotationDeclaration anndecl = null;
    int _la;
    try {
        enterOuterAlt(_localctx, 1);
        {
            setState(1557);
            match(AT);
            setState(1558);
            ((Annotation_applContext) _localctx).scoped_name = scoped_name();
            anndecl = ctx.getAnnotationDeclaration(((Annotation_applContext) _localctx).scoped_name.pair.first());
            if (anndecl == null) {
                throw new ParseException(((Annotation_applContext) _localctx).scoped_name.pair.second(), "was not defined previously");
            }
            ((Annotation_applContext) _localctx).annotation = new Annotation(anndecl);
            setState(1565);
            _la = _input.LA(1);
            if (_la == LEFT_BRACKET) {
                {
                    setState(1560);
                    match(LEFT_BRACKET);
                    setState(1562);
                    _la = _input.LA(1);
                    if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << 1) | (1L << 2) | (1L << INTEGER_LITERAL) | (1L << HEX_LITERAL) | (1L << FLOATING_PT_LITERAL) | (1L << FIXED_PT_LITERAL) | (1L << WIDE_CHARACTER_LITERAL) | (1L << CHARACTER_LITERAL) | (1L << WIDE_STRING_LITERAL) | (1L << STRING_LITERAL) | (1L << LEFT_BRACKET) | (1L << TILDE) | (1L << PLUS) | (1L << MINUS) | (1L << DOUBLE_COLON))) != 0) || _la == ID) {
                        {
                            setState(1561);
                            annotation_appl_params(_localctx.annotation, ((Annotation_applContext) _localctx).scoped_name.pair.second());
                        }
                    }
                    setState(1564);
                    match(RIGHT_BRACKET);
                }
            }
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        exitRule();
    }
    return _localctx;
}
Also used : ParseException(com.eprosima.idl.parser.exception.ParseException)

Example 9 with ParseException

use of com.eprosima.idl.parser.exception.ParseException in project ihmc-pub-sub by ihmcrobotics.

the class IDLParser method fixed_pt_const_type.

public final Fixed_pt_const_typeContext fixed_pt_const_type() throws RecognitionException {
    Fixed_pt_const_typeContext _localctx = new Fixed_pt_const_typeContext(_ctx, getState());
    enterRule(_localctx, 216, RULE_fixed_pt_const_type);
    Token tk = _input.LT(1);
    try {
        enterOuterAlt(_localctx, 1);
        {
            setState(1277);
            match(KW_FIXED);
            throw new ParseException(tk, ". Fixed type is not supported");
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        exitRule();
    }
    return _localctx;
}
Also used : ParseException(com.eprosima.idl.parser.exception.ParseException)

Example 10 with ParseException

use of com.eprosima.idl.parser.exception.ParseException in project ihmc-pub-sub by ihmcrobotics.

the class IDLParser method interface_inheritance_spec.

public final Interface_inheritance_specContext interface_inheritance_spec(Interface interfaceObject) throws RecognitionException {
    Interface_inheritance_specContext _localctx = new Interface_inheritance_specContext(_ctx, getState(), interfaceObject);
    enterRule(_localctx, 22, RULE_interface_inheritance_spec);
    Vector<Pair<String, Token>> iflist = null;
    try {
        enterOuterAlt(_localctx, 1);
        {
            setState(465);
            match(COLON);
            setState(466);
            ((Interface_inheritance_specContext) _localctx).scoped_name_list = scoped_name_list();
            iflist = ((Interface_inheritance_specContext) _localctx).scoped_name_list.retlist;
            for (Pair<String, Token> pair : iflist) {
                Interface base = ctx.getInterface(pair.first());
                if (base != null) {
                    if (!_localctx.interfaceObject.addBase(base))
                        throw new ParseException(pair.second(), " is duplicated.");
                } else {
                    throw new ParseException(pair.second(), "was not defined previously");
                }
            }
        }
    } catch (RecognitionException re) {
        _localctx.exception = re;
        _errHandler.reportError(this, re);
        _errHandler.recover(this, re);
    } finally {
        exitRule();
    }
    return _localctx;
}
Also used : ParseException(com.eprosima.idl.parser.exception.ParseException) Pair(com.eprosima.idl.util.Pair)

Aggregations

ParseException (com.eprosima.idl.parser.exception.ParseException)11 Pair (com.eprosima.idl.util.Pair)2 ArrayList (java.util.ArrayList)2 TemplateGroup (com.eprosima.idl.generator.manager.TemplateGroup)1 com.eprosima.idl.parser.tree (com.eprosima.idl.parser.tree)1 org.antlr.v4.runtime.tree (org.antlr.v4.runtime.tree)1