/** * * OOAS Compiler (Deprecated) * * Copyright 2015, Institute for Software Technology, Graz University of * Technology. Portions are copyright 2015 by the AIT Austrian Institute * of Technology. All rights reserved. * * SEE THE "LICENSE" FILE FOR THE TERMS UNDER WHICH THIS FILE IS PROVIDED. * * Please notice that this version of the OOAS compiler is considered de- * precated. Only the Java version is maintained. * * Contributors: * Willibald Krenn (TU Graz/AIT) * Stefan Tiran (TU Graz/AIT) */ using System; using System.Collections.Generic; using System.Text; using TUG.Mogentes.Codegen; namespace TUG.Mogentes.Codegen.CSharp //Simulation.SimulationCore { public class UlyssesList : System.Collections.Generic.List { public UlyssesList() : base() { } public UlyssesList(T element) :base() { if (element != null) base.Add(element); } public UlyssesList(T[] elements) : base() { if (elements != null) { base.AddRange(elements); } } } public class UlyssesQualitativeValue { public int? intervalLow; public int? intervalHigh; public int? derivation; public UlyssesQualitativeValue(int? lowval, int? highval, int? deriv) { intervalLow = lowval; intervalHigh = highval; derivation = deriv; } } public delegate void CallBack(UlyssesActionSystemClass self); // class all instances in simulation inherit from public class UlyssesActionSystemClass { public static OoaCSharpInitVisitor objectInstantiator; public static C5.HashSet givenObjectNames = new C5.HashSet(); public string givenName; public string objectName; public int objectCreationCounter = 0; public int _AstTypeLookupIndex = -1; public UlyssesActionSystemClass parent = null; public OoActionSystemInstance objectInstance = null; public UlyssesActionSystemClass(UlyssesActionSystemClass aParent, int constrNum, int LookupIndex, string aGivenName) { parent = aParent; _AstTypeLookupIndex = LookupIndex; if (parent == null) objectName = String.Format("{0}_root", this.GetType().Name); else { objectName = String.Format("{0}_{1}_{2}", this.GetType().Name, parent.objectName, parent.objectCreationCounter); parent.objectCreationCounter += 1; } if (aGivenName != String.Empty) { if (givenObjectNames.Contains(aGivenName)) { objectInstantiator.Error(0, 0, String.Format("Another object with name {0} exists.", aGivenName)); } else { objectName = aGivenName; givenObjectNames.Add(aGivenName); } } objectInstantiator.visit(this, constrNum); } } }