blob: f2fa62a08869e5aa8786d2acb43761ee4b523991 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004-2008 Andras Balogh and Daniel Varro
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andras Balogh - initial API and implementation
*******************************************************************************/
package org.eclipse.viatra2.imports.vtml;
import org.eclipse.viatra2.core.IModelSpace;
import org.eclipse.viatra2.core.IRelation;
import org.eclipse.viatra2.errors.VPMCoreException;
public class AnySourceDefinition extends RelationshipDefinition{
boolean isAny = true;
public AnySourceDefinition(int l, String ns, String n, boolean is)
{
super(l,ns,n,null);
isAny=is;
}
@Override
public boolean checkDefintion(ASTBuilder ab, IModelSpace m) {
// TODO Auto-generated method stub
boolean tmp = super.checkDefintion(ab, m);
if (tmp)
{
if (_mstr instanceof EntityDefinition)
{
ab.log.error("Any source property can be specified only for relations. Error in line "+getLine());
return false;
}
}
return tmp;
}
@Override
public void resolveReferences(ASTBuilder ab) throws VPMCoreException {
ab.mm.setIsAnyFrom((IRelation)_mstr.getElement(),isAny);
}
}