Search in sources :

Example 16 with ReParseException

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

the class Def_ExternalConst method updateSyntax.

@Override
public /**
 * {@inheritDoc}
 */
void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException {
    if (isDamaged) {
        lastTimeChecked = null;
        boolean enveloped = false;
        final Location temporalIdentifier = identifier.getLocation();
        if (reparser.envelopsDamage(temporalIdentifier) || reparser.isExtending(temporalIdentifier)) {
            reparser.extendDamagedRegion(temporalIdentifier);
            final IIdentifierReparser r = new IdentifierReparser(reparser);
            final int result = r.parseAndSetNameChanged();
            identifier = r.getIdentifier();
            // damage handled
            if (result == 0 && identifier != null) {
                enveloped = true;
            } else {
                throw new ReParseException(result);
            }
        }
        if (type != null) {
            if (enveloped) {
                type.updateSyntax(reparser, false);
                reparser.updateLocation(type.getLocation());
            } else if (reparser.envelopsDamage(type.getLocation())) {
                type.updateSyntax(reparser, true);
                enveloped = true;
                reparser.updateLocation(type.getLocation());
            }
        }
        if (withAttributesPath != null) {
            if (enveloped) {
                withAttributesPath.updateSyntax(reparser, false);
                reparser.updateLocation(withAttributesPath.getLocation());
            } else if (reparser.envelopsDamage(withAttributesPath.getLocation())) {
                withAttributesPath.updateSyntax(reparser, true);
                enveloped = true;
                reparser.updateLocation(withAttributesPath.getLocation());
            }
        }
        if (!enveloped) {
            throw new ReParseException();
        }
        return;
    }
    reparser.updateLocation(identifier.getLocation());
    if (type != null) {
        type.updateSyntax(reparser, false);
        reparser.updateLocation(type.getLocation());
    }
    if (withAttributesPath != null) {
        withAttributesPath.updateSyntax(reparser, false);
        reparser.updateLocation(withAttributesPath.getLocation());
    }
}
Also used : IIdentifierReparser(org.eclipse.titan.designer.parsers.ttcn3parser.IIdentifierReparser) IdentifierReparser(org.eclipse.titan.designer.parsers.ttcn3parser.IdentifierReparser) IIdentifierReparser(org.eclipse.titan.designer.parsers.ttcn3parser.IIdentifierReparser) ReParseException(org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException) Location(org.eclipse.titan.designer.AST.Location)

Example 17 with ReParseException

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

the class Invoke_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 (value != null) {
        value.updateSyntax(reparser, false);
        reparser.updateLocation(value.getLocation());
    }
    if (actualParameterList != null) {
        actualParameterList.updateSyntax(reparser, false);
        reparser.updateLocation(actualParameterList.getLocation());
    }
}
Also used : IIncrementallyUpdateable(org.eclipse.titan.designer.AST.TTCN3.IIncrementallyUpdateable) ReParseException(org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException)

Example 18 with ReParseException

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

the class Named_Template_List 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();
    }
    namedTemplates.updateSyntax(reparser, false);
}
Also used : IIncrementallyUpdateable(org.eclipse.titan.designer.AST.TTCN3.IIncrementallyUpdateable) ReParseException(org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException)

Example 19 with ReParseException

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

the class Referenced_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 (reference != null) {
        reference.updateSyntax(reparser, false);
        reparser.updateLocation(reference.getLocation());
    }
}
Also used : IIncrementallyUpdateable(org.eclipse.titan.designer.AST.TTCN3.IIncrementallyUpdateable) ReParseException(org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException)

Example 20 with ReParseException

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

the class Raise_Statement method updateSyntax.

@Override
public /**
 * {@inheritDoc}
 */
void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException {
    if (isDamaged) {
        throw new ReParseException();
    }
    if (portReference != null) {
        portReference.updateSyntax(reparser, false);
        reparser.updateLocation(portReference.getLocation());
    }
    if (signatureReference != null) {
        signatureReference.updateSyntax(reparser, false);
        reparser.updateLocation(signatureReference.getLocation());
    }
    if (parameter != null) {
        parameter.updateSyntax(reparser, false);
        reparser.updateLocation(parameter.getLocation());
    }
    if (toClause instanceof IIncrementallyUpdateable) {
        ((IIncrementallyUpdateable) toClause).updateSyntax(reparser, false);
        reparser.updateLocation(toClause.getLocation());
    } else if (toClause != 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