Esempio n. 1
0
        public SymTable()
        {
            // Class definitions
            _classesTable.Add(AllType.GRAPH, new Dictionary <string, ClassEntry>());
            _classesTable.Add(AllType.VERTEX, new Dictionary <string, ClassEntry>());
            _classesTable.Add(AllType.EDGE, new Dictionary <string, ClassEntry>());
            // ClassEntries

            ClassEntry VertexFrom = new ClassEntry("VertexFrom", AllType.VERTEX);
            ClassEntry VertexTo   = new ClassEntry("VertexTo", AllType.VERTEX);
            //ClassEntry Adjacent = new ClassEntry("Adjacent", AllType.VERTEX, true);
            //ClassEntry IsAdjacent = new ClassEntry("IsAdjacent", AllType.BOOL);
            //ClassEntry EdgeBetween = new ClassEntry("EdgeBetween", AllType.EDGE);
            //ClassEntry EdgesBetween = new ClassEntry("EdgesBetween", AllType.EDGE, true);
            //ClassEntry IsEmpty = new ClassEntry("IsEmpty", AllType.BOOL);
            //ClassEntry Directed = new ClassEntry("Directed", AllType.BOOL);
            ClassEntry Vertices = new ClassEntry("Vertices", AllType.VERTEX, true);
            ClassEntry Edges    = new ClassEntry("Edges", AllType.EDGE, true);

            // Method Calls
            _classesTable[AllType.EDGE].Add("From", VertexFrom);
            _classesTable[AllType.EDGE].Add("To", VertexTo);
            _classesTable[AllType.EDGE].Add(VertexFrom.Name, VertexFrom);
            _classesTable[AllType.EDGE].Add(VertexTo.Name, VertexTo);
            //_classesTable[AllType.GRAPH].Add("EdgeBetween", EdgeBetween);
            //_classesTable[AllType.GRAPH].Add("EdgesBetween", EdgesBetween);
            //_classesTable[AllType.GRAPH].Add("Adjacent", Adjacent);
            //_classesTable[AllType.GRAPH].Add("IsAdjacent", Adjacent);
            //_classesTable[AllType.GRAPH].Add("Directed", Directed);
            //_classesTable[AllType.COLLECTION].Add("IsEmpty", IsEmpty);
            // Collections
            _classesTable[AllType.GRAPH].Add("Vertices", Vertices);
            _classesTable[AllType.GRAPH].Add("Edges", Edges);
        }
Esempio n. 2
0
        /// <summary>
        /// Extends the class with a long and a short name
        /// </summary>
        /// <param name="Type">Type.</param>
        /// <param name="longAttribute">Long attribute.</param>
        /// <param name="shortAttribute">Short attribute.</param>
        /// <param name="ClassType">Class type.</param>
        public void ExtendClass(AllType Type, string longAttribute, string shortAttribute, AllType ClassType, bool IsCollection = false)
        {
            if (longAttribute == shortAttribute)
            {
                AttributeIdenticalError(longAttribute, shortAttribute);
            }

            if (CheckAttributeDefined(longAttribute, ClassType))
            {
                AlreadyDeclaredError(longAttribute);
            }

            if (CheckAttributeDefined(longAttribute, ClassType))
            {
                AlreadyDeclaredError(shortAttribute);
            }

            if (errorOccured == false)
            {
                ClassEntry Short = new ClassEntry(shortAttribute, Type, IsCollection);
                ClassEntry Long  = new ClassEntry(longAttribute, Type, IsCollection);
                Short.Collection = IsCollection;
                Long.Collection  = IsCollection;
                _classesTable[ClassType].Add(shortAttribute, Short);
                _classesTable[ClassType].Add(longAttribute, Long);
            }
        }