Search in sources :

Example 26 with ReParseException

use of org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException in project titan.EclipsePlug-ins by eclipse.

the class RelativeObjectIdentifier_Value method updateSyntax.

@Override
public /**
 * {@inheritDoc}
 */
void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException {
    if (isDamaged) {
        throw new ReParseException();
    }
    for (int i = 0, size = objectIdComponents.size(); i < size; i++) {
        final ObjectIdentifierComponent component = objectIdComponents.get(i);
        component.updateSyntax(reparser, false);
        reparser.updateLocation(component.getLocation());
    }
}
Also used : ObjectIdentifierComponent(org.eclipse.titan.designer.AST.TTCN3.values.ObjectIdentifierComponent) ReParseException(org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException)

Example 27 with ReParseException

use of org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException in project titan.EclipsePlug-ins by eclipse.

the class Value_Range_Template method updateSyntax.

@Override
public /**
 * {@inheritDoc}
 */
void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException {
    if (isDamaged) {
        throw new ReParseException();
    }
    if (lengthRestriction != null) {
        lengthRestriction.updateSyntax(reparser, false);
        reparser.updateLocation(lengthRestriction.getLocation());
    }
    if (baseTemplate instanceof IIncrementallyUpdateable) {
        ((IIncrementallyUpdateable) baseTemplate).updateSyntax(reparser, false);
        reparser.updateLocation(baseTemplate.getLocation());
    } else if (baseTemplate != null) {
        throw new ReParseException();
    }
    if (valueRange != null) {
        valueRange.updateSyntax(reparser, false);
    }
}
Also used : IIncrementallyUpdateable(org.eclipse.titan.designer.AST.TTCN3.IIncrementallyUpdateable) ReParseException(org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException)

Example 28 with ReParseException

use of org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException in project titan.EclipsePlug-ins by eclipse.

the class AbstractOfType method updateSyntax.

@Override
public /**
 * {@inheritDoc}
 */
void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException {
    if (isDamaged) {
        lastTimeChecked = null;
        boolean handled = false;
        if (ofType instanceof IIncrementallyUpdateable && reparser.envelopsDamage(ofType.getLocation())) {
            ((IIncrementallyUpdateable) ofType).updateSyntax(reparser, true);
            reparser.updateLocation(ofType.getLocation());
            handled = true;
        }
        if (subType != null) {
            subType.updateSyntax(reparser, false);
            handled = true;
        }
        if (handled) {
            return;
        }
        throw new ReParseException();
    }
    if (ofType instanceof IIncrementallyUpdateable) {
        ((IIncrementallyUpdateable) ofType).updateSyntax(reparser, false);
        reparser.updateLocation(ofType.getLocation());
    } else if (ofType != null) {
        throw new ReParseException();
    }
    if (subType != null) {
        subType.updateSyntax(reparser, false);
    }
    if (withAttributesPath != null) {
        withAttributesPath.updateSyntax(reparser, false);
        reparser.updateLocation(withAttributesPath.getLocation());
    }
}
Also used : IIncrementallyUpdateable(org.eclipse.titan.designer.AST.TTCN3.IIncrementallyUpdateable) ReParseException(org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException)

Example 29 with ReParseException

use of org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException in project titan.EclipsePlug-ins by eclipse.

the class PortTypeBody method updateSyntax.

@Override
public /**
 * {@inheritDoc}
 */
void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException {
    if (isDamaged) {
        throw new ReParseException();
    }
    IType type;
    if (inTypes != null) {
        for (int i = 0, size = inTypes.size(); i < size; i++) {
            type = inTypes.get(i);
            if (type instanceof IIncrementallyUpdateable) {
                ((IIncrementallyUpdateable) type).updateSyntax(reparser, false);
                reparser.updateLocation(type.getLocation());
            } else {
                throw new ReParseException();
            }
        }
    }
    if (outTypes != null) {
        for (int i = 0, size = outTypes.size(); i < size; i++) {
            type = outTypes.get(i);
            if (type instanceof IIncrementallyUpdateable) {
                ((IIncrementallyUpdateable) type).updateSyntax(reparser, false);
                reparser.updateLocation(type.getLocation());
            } else {
                throw new ReParseException();
            }
        }
    }
    if (inoutTypes != null) {
        for (int i = 0, size = inoutTypes.size(); i < size; i++) {
            type = inoutTypes.get(i);
            if (type instanceof IIncrementallyUpdateable) {
                ((IIncrementallyUpdateable) type).updateSyntax(reparser, false);
                reparser.updateLocation(type.getLocation());
            } else {
                throw new ReParseException();
            }
        }
    }
}
Also used : IIncrementallyUpdateable(org.eclipse.titan.designer.AST.TTCN3.IIncrementallyUpdateable) ReParseException(org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException) IType(org.eclipse.titan.designer.AST.IType)

Example 30 with ReParseException

use of org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException in project titan.EclipsePlug-ins by eclipse.

the class SpecificValue_Template method updateSyntax.

@Override
public /**
 * {@inheritDoc}
 */
void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException {
    if (isDamaged) {
        throw new ReParseException();
    }
    if (lengthRestriction != null) {
        lengthRestriction.updateSyntax(reparser, false);
        reparser.updateLocation(lengthRestriction.getLocation());
    }
    if (baseTemplate instanceof IIncrementallyUpdateable) {
        ((IIncrementallyUpdateable) baseTemplate).updateSyntax(reparser, false);
        reparser.updateLocation(baseTemplate.getLocation());
    } else if (baseTemplate != null) {
        throw new ReParseException();
    }
    if (specificValue instanceof IIncrementallyUpdateable) {
        ((IIncrementallyUpdateable) specificValue).updateSyntax(reparser, false);
        reparser.updateLocation(specificValue.getLocation());
    } else if (specificValue != null) {
        throw new ReParseException();
    }
}
Also used : IIncrementallyUpdateable(org.eclipse.titan.designer.AST.TTCN3.IIncrementallyUpdateable) ReParseException(org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException)

Aggregations

ReParseException (org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException)52 Location (org.eclipse.titan.designer.AST.Location)24 IIncrementallyUpdateable (org.eclipse.titan.designer.AST.TTCN3.IIncrementallyUpdateable)21 IIdentifierReparser (org.eclipse.titan.designer.parsers.ttcn3parser.IIdentifierReparser)18 IdentifierReparser (org.eclipse.titan.designer.parsers.ttcn3parser.IdentifierReparser)18 NULL_Location (org.eclipse.titan.designer.AST.NULL_Location)6 IAppendableSyntax (org.eclipse.titan.designer.AST.TTCN3.IAppendableSyntax)5 IType (org.eclipse.titan.designer.AST.IType)2 FileNotFoundException (java.io.FileNotFoundException)1 CoreException (org.eclipse.core.runtime.CoreException)1 IValue (org.eclipse.titan.designer.AST.IValue)1 Identifier (org.eclipse.titan.designer.AST.Identifier)1 Module (org.eclipse.titan.designer.AST.Module)1 Reference (org.eclipse.titan.designer.AST.Reference)1 Definition (org.eclipse.titan.designer.AST.TTCN3.definitions.Definition)1 TTCN3Module (org.eclipse.titan.designer.AST.TTCN3.definitions.TTCN3Module)1 ObjectIdentifierComponent (org.eclipse.titan.designer.AST.TTCN3.values.ObjectIdentifierComponent)1 Type (org.eclipse.titan.designer.AST.Type)1 ITtcn3FileReparser (org.eclipse.titan.designer.parsers.ttcn3parser.ITtcn3FileReparser)1 Ttcn3FileReparser (org.eclipse.titan.designer.parsers.ttcn3parser.Ttcn3FileReparser)1