Skip to content

Commit

Permalink
Deleted some debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Madiel committed Sep 16, 2022
1 parent f71d5ee commit 808480c
Showing 1 changed file with 21 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,17 @@ class RoboSimScopeProvider extends AbstractRoboSimScopeProvider {
@Inject extension RoboSimTypeProvider
override getScope(EObject context, EReference reference) {
if (context instanceof SimRefExp) {
switch(reference) {
case SIM_REF_EXP__ELEMENT : System.out.println("element")
case SIM_REF_EXP__PREDICATE: System.out.println("predicate")
case SIM_REF_EXP__EXP: System.out.println("exp")
case SIM_REF_EXP__VARIABLE: System.out.println("variable")
}
// switch(reference) {
// case SIM_REF_EXP__ELEMENT : System.out.println("element")
// case SIM_REF_EXP__PREDICATE: System.out.println("predicate")
// case SIM_REF_EXP__EXP: System.out.println("exp")
// case SIM_REF_EXP__VARIABLE: System.out.println("variable")
// }
}else if( context instanceof SimCall){
if (reference === CALL__OPERATION) {
//changed the parent scope to avoid accepting OperationDefs being in the scope for Calls
val s = delegateGetScope(context, reference) //IScope::NULLSCOPE
System.out.println(" s " + s);
val s = delegateGetScope(context, reference)
return context.outputOperationsDeclared(s)
//getOutputOperationsDeclared(s)
}
}

Expand All @@ -69,11 +67,6 @@ class RoboSimScopeProvider extends AbstractRoboSimScopeProvider {

}






def dispatch IScope resolveScope(RefExp context, EReference reference) {
if (context.eContainer instanceof SimRefExp && reference == REF_EXP__REF) {
val parent = context.eContainer as SimRefExp
Expand Down Expand Up @@ -397,9 +390,7 @@ class RoboSimScopeProvider extends AbstractRoboSimScopeProvider {

//outputOperations
def dispatch IScope resolveScope(SimCall context, EReference reference) {
//return getExecScope(context)
val s = delegateGetScope(context, reference) //IScope::NULLSCOPE
System.out.println(s);
val s = delegateGetScope(context, reference)
return context.outputOperationsDeclared(s)
}

Expand All @@ -410,9 +401,7 @@ class RoboSimScopeProvider extends AbstractRoboSimScopeProvider {
def dispatch IScope outputOperationsDeclared(SimOperationDef n, IScope p) {
getOutputOperationsDeclared(n as SimContext, p)
}




def dispatch IScope outputOperationsDeclared(EObject cont, IScope parent) {
val container = cont.eContainer
if (container !== null)
Expand All @@ -421,38 +410,21 @@ class RoboSimScopeProvider extends AbstractRoboSimScopeProvider {
parent
}

def dispatch IScope outputOperationsDeclared(Interface cont, IScope parent) {
Scopes::scopeFor(
cont.operations.filter[o|!(o instanceof OperationDef)],
parent

def dispatch IScope getOutputOperationsDeclared(SimContext n, IScope p) {
var finalScope = n.getoutputOperationsDeclared(p)
// @author: Pedro
// NOTE: Commented out to include, in addition to this scope, that
// already calculated by the RoboChartScopeProvider for
// operations. I believe a similar approach needs to be
// adopted for all other RoboSim elements.
finalScope.scopesFor(
n.interfaces.map[it.operations].flatten,
n.RInterfaces.map[it.operations].flatten
)
return finalScope
}



// def dispatch IScope getOutputOperationsDeclared(EObject cont, IScope parent) {
// val container = cont.eContainer
// if (container !== null)
// container.getOutputOperationsDeclared(parent)
// else
// parent
// }

// def dispatch IScope outputOperationsDeclared(EObject n, IScope p) {
// if (n.eContainer !== null) {
// return n.eContainer.outputOperationsDeclared(p)
// }
// return p
// }
//
// def dispatch IScope outputOperationsDeclared(SimMachineDef n, IScope p) {
// getoutputOperationsDeclared(n as SimContext, p)
// }
//
// def dispatch IScope outputOperationsDeclared(SimOperationDef n, IScope p) {
// getoutputOperationsDeclared(n as SimContext, p)
// }

def IScope getoutputOperationsDeclared(SimContext n, IScope p) {
if (n.outputContext === null) {
return p
Expand All @@ -465,20 +437,4 @@ class RoboSimScopeProvider extends AbstractRoboSimScopeProvider {

}

def dispatch IScope getOutputOperationsDeclared(SimContext n, IScope p) {
var finalScope = n.getoutputOperationsDeclared(p)
// @author: Pedro
// NOTE: Commented out to include, in addition to this scope, that
// already calculated by the RoboChartScopeProvider for
// operations. I believe a similar approach needs to be
// adopted for all other RoboSim elements.
finalScope.scopesFor(
n.interfaces.map[it.operations].flatten,
n.RInterfaces.map[it.operations].flatten
)
//return super.operationsDeclared(n as StateMachineDef, finalScope)
System.out.println(" finalScope " + finalScope);
return finalScope
}

}

0 comments on commit 808480c

Please sign in to comment.