Example #1
0
        public static RefId GetNamedId(string name)
        {
            var retId = RefId.CreateRefId();

            retId.SetProperty(nameTag, StringId.CreateStringId(name));
            return(retId);
        }
Example #2
0
        public static IId getCombinedFunctionDefinition(IId parameterSet, IId functionCallList)
        {
            var ret = RefId.CreateRefId();

            ret.SetProperty(parameters, parameterSet);
            ret.SetProperty(subFunctionCalls, functionCallList);
            return(ret);
        }
Example #3
0
        public static IId GetFunctionCall(IId valueDictionary, IId callee)
        {
            var ret = RefId.CreateRefId();

            ret.SetProperty(parameterValues, valueDictionary);
            ret.SetProperty(functionCalled, callee);
            return(ret);
        }
Example #4
0
        public RefId RegisterAndCreateUniqueIId(string uniqueName)
        {
            if (environment.NameToId.ContainsKey(uniqueName))
            {
                throw new Exception();
            }
            var ret = RefId.CreateRefId();

            environment.NameToId.Add(uniqueName, ret);
            return(ret);
        }
Example #5
0
        public static RefId CreateList(IId[] elements)
        {
            var list    = RefId.CreateRefId();
            var rawList = BareListId.CreateBareListId();

            list.SetProperty(listId, rawList);
            for (int i = 0; i < elements.Length; i++)
            {
                rawList.SetProperty(IntId.CreateId(i), elements[i]);
            }
            return(list);
        }
Example #6
0
        public static IId CreateSet(ISet <IId> values)
        {
            var set    = RefId.CreateRefId();
            var rawSet = BareSetId.CreateBareSetId();

            set.SetProperty(setId, rawSet);
            foreach (var value in values)
            {
                set.SetProperty(value, value);
            }
            return(set);
        }
Example #7
0
        public IEnumerable <string> StreamAllIIds()
        {
            var isStreaming = RefId.CreateRefId();
            var streamList  = new List <string>()
            {
                "IID"
            };

            AddIdAndMark(environment.GetRoot(), streamList, isStreaming);
            UnMark(environment.GetRoot(), isStreaming);
            streamList.Add("NAMES");
            WriteUniqueNames(environment.NameToId, streamList);
            return(streamList);
        }