use of org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException in project titan.EclipsePlug-ins by eclipse.
the class Call_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 (parameter != null) {
parameter.updateSyntax(reparser, false);
reparser.updateLocation(parameter.getLocation());
}
if (timerValue != null) {
timerValue.updateSyntax(reparser, false);
reparser.updateLocation(timerValue.getLocation());
}
if (toClause instanceof IIncrementallyUpdateable) {
((IIncrementallyUpdateable) toClause).updateSyntax(reparser, false);
reparser.updateLocation(toClause.getLocation());
} else if (toClause != null) {
throw new ReParseException();
}
if (altGuards != null) {
altGuards.updateSyntax(reparser, false);
reparser.updateLocation(altGuards.getLocation());
}
}
use of org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException in project titan.EclipsePlug-ins by eclipse.
the class AltGuards method updateSyntax.
@Override
public /**
* {@inheritDoc}
*/
void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException {
if (isDamaged) {
boolean enveloped = false;
int nofDamaged = 0;
int leftBoundary = location.getOffset();
int rightBoundary = location.getEndOffset();
final int damageOffset = reparser.getDamageStart();
for (int i = 0, size = altGuards.size(); i < size && !enveloped; i++) {
final AltGuard altGuard = altGuards.get(i);
final Location temporalLocation = altGuard.getLocation();
if (reparser.envelopsDamage(temporalLocation)) {
enveloped = true;
leftBoundary = temporalLocation.getOffset();
rightBoundary = temporalLocation.getEndOffset();
} else if (reparser.isDamaged(temporalLocation)) {
nofDamaged++;
} else {
if (temporalLocation.getEndOffset() < damageOffset && temporalLocation.getEndOffset() > leftBoundary) {
leftBoundary = temporalLocation.getEndOffset();
}
if (temporalLocation.getOffset() >= damageOffset && temporalLocation.getOffset() < rightBoundary) {
rightBoundary = temporalLocation.getOffset();
}
}
}
if (nofDamaged != 0) {
throw new ReParseException();
}
for (Iterator<AltGuard> iterator = altGuards.iterator(); iterator.hasNext(); ) {
final AltGuard altGuard = iterator.next();
final Location temporalLocation = altGuard.getLocation();
if (reparser.isAffectedAppended(temporalLocation)) {
altGuard.updateSyntax(reparser, enveloped && reparser.envelopsDamage(temporalLocation));
reparser.updateLocation(altGuard.getLocation());
}
}
return;
}
for (int i = 0, size = altGuards.size(); i < size; i++) {
final AltGuard guard = altGuards.get(i);
guard.updateSyntax(reparser, false);
reparser.updateLocation(guard.getLocation());
}
}
use of org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException in project titan.EclipsePlug-ins by eclipse.
the class ControlPart method updateSyntax.
/**
* Handles the incremental parsing of this control part.
*
* @param reparser
* the parser doing the incremental parsing.
* @throws ReParseException
* if there was an error while refreshing the location
* information and it could not be solved internally.
*/
public void updateSyntax(final TTCN3ReparseUpdater reparser) throws ReParseException {
if (reparser.isDamaged(getLocation())) {
lastTimeChecked = null;
boolean enveloped = false;
if (reparser.envelopsDamage(statementblock.getLocation())) {
statementblock.updateSyntax(reparser, true);
enveloped = true;
reparser.updateLocation(statementblock.getLocation());
} else if (reparser.isDamaged(statementblock.getLocation())) {
throw new ReParseException();
} else {
statementblock.updateSyntax(reparser, false);
reparser.updateLocation(statementblock.getLocation());
}
if (withAttributesPath != null) {
if (enveloped) {
withAttributesPath.updateSyntax(reparser, false);
reparser.updateLocation(withAttributesPath.getLocation());
} else if (reparser.envelopsDamage(withAttributesPath.getLocation())) {
reparser.extendDamagedRegion(withAttributesPath.getLocation());
final int result = reparse(reparser);
if (result == 0) {
enveloped = true;
} else {
throw new ReParseException();
}
} else if (reparser.isDamaged(withAttributesPath.getLocation())) {
throw new ReParseException();
} else {
withAttributesPath.updateSyntax(reparser, false);
reparser.updateLocation(withAttributesPath.getLocation());
}
}
if (!enveloped) {
throw new ReParseException();
}
return;
}
statementblock.updateSyntax(reparser, false);
reparser.updateLocation(statementblock.getLocation());
if (withAttributesPath != null) {
withAttributesPath.updateSyntax(reparser, false);
reparser.updateLocation(withAttributesPath.getLocation());
}
}
use of org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException in project titan.EclipsePlug-ins by eclipse.
the class Def_Const 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 (value != null) {
if (enveloped) {
value.updateSyntax(reparser, false);
reparser.updateLocation(value.getLocation());
} else if (reparser.envelopsDamage(value.getLocation())) {
reparser.extendDamagedRegion(value.getLocation().getOffset(), value.getLocation().getEndOffset());
final int result = reparse(reparser);
if (result == 0) {
enveloped = true;
value.setFullNameParent(this);
value.setMyScope(getMyScope());
} else {
throw new ReParseException();
}
}
}
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 (value != null) {
value.updateSyntax(reparser, false);
reparser.updateLocation(value.getLocation());
}
if (withAttributesPath != null) {
withAttributesPath.updateSyntax(reparser, false);
reparser.updateLocation(withAttributesPath.getLocation());
}
}
use of org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException in project titan.EclipsePlug-ins by eclipse.
the class SignatureExceptions method updateSyntax.
@Override
public /**
* {@inheritDoc}
*/
void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged) throws ReParseException {
if (isDamaged) {
throw new ReParseException();
}
Type exception;
for (int i = 0, size = exceptionTypes.size(); i < size; i++) {
exception = exceptionTypes.get(i);
exception.updateSyntax(reparser, isDamaged);
reparser.updateLocation(exception.getLocation());
}
}
Aggregations