Search in sources :

Example 1 with AtNotations

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

the class TableConstraint method parseBlocks.

private void parseBlocks() {
    if (mObjectSetBlock == null) {
        return;
    }
    objectSet = null;
    atNotationList = null;
    if (null != mObjectSetBlock) {
        if (mAtNotationsBlock == null) {
            // SimpleTableConstraint
            Asn1Parser parser = BlockLevelTokenStreamTracker.getASN1ParserForBlock(mObjectSetBlock, 0);
            if (parser != null) {
                objectSet = parser.pr_special_ObjectSetSpec().definition;
                List<SyntacticErrorStorage> errors = parser.getErrorStorage();
                if (null != errors && !errors.isEmpty()) {
                    objectSet = null;
                    for (int i = 0; i < errors.size(); i++) {
                        ParserMarkerSupport.createOnTheFlyMixedMarker((IFile) mObjectSetBlock.getLocation().getFile(), errors.get(i), IMarker.SEVERITY_ERROR);
                    }
                }
            }
        } else {
            // ComponentRelationConstraint
            Asn1Parser parser = BlockLevelTokenStreamTracker.getASN1ParserForBlock(mObjectSetBlock, 0);
            if (parser != null) {
                objectSet = parser.pr_DefinedObjectSetBlock().objectSet;
                List<SyntacticErrorStorage> errors = parser.getErrorStorage();
                if (null != errors && !errors.isEmpty()) {
                    objectSet = null;
                    for (int i = 0; i < errors.size(); i++) {
                        ParserMarkerSupport.createOnTheFlySyntacticMarker((IFile) mObjectSetBlock.getLocation().getFile(), errors.get(i), IMarker.SEVERITY_ERROR);
                    }
                }
            }
            parser = BlockLevelTokenStreamTracker.getASN1ParserForBlock(mAtNotationsBlock, 0);
            if (parser != null) {
                atNotationList = parser.pr_AtNotationList().notationList;
                List<SyntacticErrorStorage> errors = parser.getErrorStorage();
                if (null != errors && !errors.isEmpty()) {
                    objectSet = null;
                    for (int i = 0; i < errors.size(); i++) {
                        ParserMarkerSupport.createOnTheFlySyntacticMarker((IFile) mAtNotationsBlock.getLocation().getFile(), errors.get(i), IMarker.SEVERITY_ERROR);
                    }
                }
            }
            if (atNotationList == null) {
                atNotationList = new AtNotations();
            }
        }
    }
    if (objectSet == null) {
        objectSet = new ObjectSet_definition();
    }
}
Also used : Asn1Parser(org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser) ObjectSet_definition(org.eclipse.titan.designer.AST.ASN1.Object.ObjectSet_definition) SyntacticErrorStorage(org.eclipse.titan.common.parsers.SyntacticErrorStorage) Constraint(org.eclipse.titan.designer.AST.Constraint) AtNotations(org.eclipse.titan.designer.AST.AtNotations)

Aggregations

SyntacticErrorStorage (org.eclipse.titan.common.parsers.SyntacticErrorStorage)1 ObjectSet_definition (org.eclipse.titan.designer.AST.ASN1.Object.ObjectSet_definition)1 AtNotations (org.eclipse.titan.designer.AST.AtNotations)1 Constraint (org.eclipse.titan.designer.AST.Constraint)1 Asn1Parser (org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser)1