Search in sources :

Example 1 with ASN1Type

use of org.eclipse.titan.designer.AST.ASN1.ASN1Type in project titan.EclipsePlug-ins by eclipse.

the class ObjectClassSyntax_Parser method visitSetting.

@Override
public /**
 * {@inheritDoc}
 */
void visitSetting(final ObjectClassSyntax_setting parameter) {
    FieldSetting fieldSetting = null;
    switch(parameter.getSettingType()) {
        case S_T:
            final ASN1Type type = parseType();
            if (null != type) {
                fieldSetting = new FieldSetting_Type(parameter.getIdentifier().newInstance(), type);
                fieldSetting.setLocation(mBlock.getLocation());
            }
            break;
        case S_V:
            final boolean parseSuccess = parseValue();
            if (parseSuccess) {
                fieldSetting = new FieldSetting_Value(parameter.getIdentifier().newInstance());
                fieldSetting.setLocation(mBlock.getLocation());
            }
            break;
        case S_VS:
            // TODO mark as NOT SUPPORTED
            break;
        case S_O:
            final ASN1Object object = parseObject();
            if (null != object) {
                fieldSetting = new FieldSetting_Object(parameter.getIdentifier().newInstance(), object);
                fieldSetting.setLocation(mBlock.getLocation());
            }
            break;
        case S_OS:
            final ObjectSet objectSet = parseObjectSet();
            if (null != objectSet) {
                fieldSetting = new FieldSetting_ObjectSet(parameter.getIdentifier().newInstance(), objectSet);
                fieldSetting.setLocation(mBlock.getLocation());
            }
            break;
        case S_UNDEF:
        // FATAL ERROR
        default:
            break;
    }
    previousSuccess = null != fieldSetting;
    myObject.addFieldSetting(fieldSetting);
}
Also used : ASN1Type(org.eclipse.titan.designer.AST.ASN1.ASN1Type) ObjectSet(org.eclipse.titan.designer.AST.ASN1.ObjectSet) ASN1Object(org.eclipse.titan.designer.AST.ASN1.ASN1Object)

Example 2 with ASN1Type

use of org.eclipse.titan.designer.AST.ASN1.ASN1Type in project titan.EclipsePlug-ins by eclipse.

the class ObjectClassSyntax_Parser method parseType.

private ASN1Type parseType() {
    ASN1Type type = null;
    if (mBlock != null) {
        final Asn1Parser parser = BlockLevelTokenStreamTracker.getASN1ParserForBlock(mBlock, internalIndex);
        if (parser != null) {
            type = parser.pr_special_Type().type;
            internalIndex += parser.nof_consumed_tokens();
            final List<SyntacticErrorStorage> errors = parser.getErrorStorage();
            if (null != errors && !errors.isEmpty()) {
                for (int i = 0; i < errors.size(); i++) {
                    ParserMarkerSupport.createOnTheFlyMixedMarker((IFile) mBlock.getLocation().getFile(), errors.get(i), IMarker.SEVERITY_ERROR);
                }
            }
        }
    }
    return type;
}
Also used : Asn1Parser(org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser) SyntacticErrorStorage(org.eclipse.titan.common.parsers.SyntacticErrorStorage) ASN1Type(org.eclipse.titan.designer.AST.ASN1.ASN1Type)

Aggregations

ASN1Type (org.eclipse.titan.designer.AST.ASN1.ASN1Type)2 SyntacticErrorStorage (org.eclipse.titan.common.parsers.SyntacticErrorStorage)1 ASN1Object (org.eclipse.titan.designer.AST.ASN1.ASN1Object)1 ObjectSet (org.eclipse.titan.designer.AST.ASN1.ObjectSet)1 Asn1Parser (org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser)1