Search in sources :

Example 6 with Asn1Parser

use of org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser in project titan.EclipsePlug-ins by eclipse.

the class Undefined_Block_Value method parseBlockSequenceValue.

private Sequence_Value parseBlockSequenceValue() {
    if (null == mBlock) {
        return null;
    }
    final Asn1Parser parser = BlockLevelTokenStreamTracker.getASN1ParserForBlock(mBlock);
    if (null == parser) {
        return null;
    }
    final Sequence_Value value = parser.pr_special_SequenceValue().value;
    final List<SyntacticErrorStorage> errors = parser.getErrorStorage();
    if (null != errors && !errors.isEmpty()) {
        isErroneous = true;
        for (int i = 0; i < errors.size(); i++) {
            ParserMarkerSupport.createOnTheFlyMixedMarker((IFile) mBlock.getLocation().getFile(), errors.get(i), IMarker.SEVERITY_ERROR);
        }
        return null;
    }
    return value;
}
Also used : Asn1Parser(org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser) SyntacticErrorStorage(org.eclipse.titan.common.parsers.SyntacticErrorStorage) Sequence_Value(org.eclipse.titan.designer.AST.TTCN3.values.Sequence_Value)

Example 7 with Asn1Parser

use of org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser in project titan.EclipsePlug-ins by eclipse.

the class Undefined_Block_Value method parseBlockSeqofValue.

private SequenceOf_Value parseBlockSeqofValue() {
    if (null == mBlock) {
        return null;
    }
    final Asn1Parser parser = BlockLevelTokenStreamTracker.getASN1ParserForBlock(mBlock);
    if (null == parser) {
        return null;
    }
    final SequenceOf_Value value = parser.pr_special_SeqOfValue().value;
    final List<SyntacticErrorStorage> errors = parser.getErrorStorage();
    if (null != errors && !errors.isEmpty()) {
        isErroneous = true;
        for (int i = 0; i < errors.size(); i++) {
            ParserMarkerSupport.createOnTheFlyMixedMarker((IFile) mBlock.getLocation().getFile(), errors.get(i), IMarker.SEVERITY_ERROR);
        }
        return null;
    }
    return value;
}
Also used : Asn1Parser(org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser) SyntacticErrorStorage(org.eclipse.titan.common.parsers.SyntacticErrorStorage) SequenceOf_Value(org.eclipse.titan.designer.AST.TTCN3.values.SequenceOf_Value)

Example 8 with Asn1Parser

use of org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser in project titan.EclipsePlug-ins by eclipse.

the class Undefined_Block_Value method parseBlockSetValue.

private Set_Value parseBlockSetValue() {
    if (null == mBlock) {
        return null;
    }
    final Asn1Parser parser = BlockLevelTokenStreamTracker.getASN1ParserForBlock(mBlock);
    if (null == parser) {
        return null;
    }
    final Set_Value value = parser.pr_special_SetValue().value;
    final List<SyntacticErrorStorage> errors = parser.getErrorStorage();
    if (null != errors && !errors.isEmpty()) {
        isErroneous = true;
        for (int i = 0; i < errors.size(); i++) {
            ParserMarkerSupport.createOnTheFlyMixedMarker((IFile) mBlock.getLocation().getFile(), errors.get(i), IMarker.SEVERITY_ERROR);
        }
        return null;
    }
    return value;
}
Also used : Asn1Parser(org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser) SyntacticErrorStorage(org.eclipse.titan.common.parsers.SyntacticErrorStorage) Set_Value(org.eclipse.titan.designer.AST.TTCN3.values.Set_Value)

Example 9 with Asn1Parser

use of org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser in project titan.EclipsePlug-ins by eclipse.

the class Undefined_Block_Value method parseBlockNamedBits.

private Named_Bits parseBlockNamedBits() {
    if (null == mBlock) {
        return null;
    }
    final Asn1Parser parser = BlockLevelTokenStreamTracker.getASN1ParserForBlock(mBlock);
    if (null == parser) {
        return null;
    }
    final Named_Bits namedBits = parser.pr_special_NamedBitListValue().named_bits;
    final List<SyntacticErrorStorage> errors = parser.getErrorStorage();
    if (null != errors && !errors.isEmpty()) {
        isErroneous = true;
        for (int i = 0; i < errors.size(); i++) {
            ParserMarkerSupport.createOnTheFlyMixedMarker((IFile) mBlock.getLocation().getFile(), errors.get(i), IMarker.SEVERITY_ERROR);
        }
        return null;
    }
    return namedBits;
}
Also used : Asn1Parser(org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser) SyntacticErrorStorage(org.eclipse.titan.common.parsers.SyntacticErrorStorage)

Example 10 with Asn1Parser

use of org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser in project titan.EclipsePlug-ins by eclipse.

the class Undefined_Block_Value method parseBlockObjectIdentifierValue.

private ObjectIdentifier_Value parseBlockObjectIdentifierValue() {
    final Asn1Parser parser = BlockLevelTokenStreamTracker.getASN1ParserForBlock(mBlock);
    if (null == parser) {
        return null;
    }
    final ObjectIdentifier_Value value = parser.pr_special_ObjectIdentifierValue().value;
    final List<SyntacticErrorStorage> errors = parser.getErrorStorage();
    if (null != errors && !errors.isEmpty()) {
        isErroneous = true;
        for (int i = 0; i < errors.size(); i++) {
            ParserMarkerSupport.createOnTheFlyMixedMarker((IFile) mBlock.getLocation().getFile(), errors.get(i), IMarker.SEVERITY_ERROR);
        }
        return null;
    }
    return value;
}
Also used : Asn1Parser(org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser) SyntacticErrorStorage(org.eclipse.titan.common.parsers.SyntacticErrorStorage) ObjectIdentifier_Value(org.eclipse.titan.designer.AST.TTCN3.values.ObjectIdentifier_Value)

Aggregations

Asn1Parser (org.eclipse.titan.designer.parsers.asn1parser.Asn1Parser)25 SyntacticErrorStorage (org.eclipse.titan.common.parsers.SyntacticErrorStorage)24 StringReader (java.io.StringReader)2 CharStream (org.antlr.v4.runtime.CharStream)2 UnbufferedCharStream (org.antlr.v4.runtime.UnbufferedCharStream)2 ASN1Listener (org.eclipse.titan.designer.parsers.asn1parser.ASN1Listener)2 Asn1Lexer (org.eclipse.titan.designer.parsers.asn1parser.Asn1Lexer)2 ModuleLevelTokenStreamTracker (org.eclipse.titan.designer.parsers.asn1parser.ModuleLevelTokenStreamTracker)2 TokenWithIndexAndSubTokensFactory (org.eclipse.titan.designer.parsers.asn1parser.TokenWithIndexAndSubTokensFactory)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Token (org.antlr.v4.runtime.Token)1 ASN1Assignment (org.eclipse.titan.designer.AST.ASN1.ASN1Assignment)1 ASN1Object (org.eclipse.titan.designer.AST.ASN1.ASN1Object)1 ASN1Type (org.eclipse.titan.designer.AST.ASN1.ASN1Type)1 ObjectSet_definition (org.eclipse.titan.designer.AST.ASN1.Object.ObjectSet_definition)1 ObjectSet (org.eclipse.titan.designer.AST.ASN1.ObjectSet)1 AtNotations (org.eclipse.titan.designer.AST.AtNotations)1 Constraint (org.eclipse.titan.designer.AST.Constraint)1 Identifier (org.eclipse.titan.designer.AST.Identifier)1