예제 #1
0
        public SinTD ParseIDL(string idlString, SinTD targetSinTD)
        {
            CurrentlyParsedSinTD    = targetSinTD;
            lineNumberParsed        = 0;
            currentlyParsing        = ParseMode.NONE;
            wasParsingBeforeComment = ParseMode.NONE;

            string[] idlLines =
                idlString.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);

            foreach (string line in idlLines)
            {
                ++lineNumberParsed;
                parseLine(line.Trim());
            }

            return(CurrentlyParsedSinTD);
        }
예제 #2
0
파일: IDLParser.cs 프로젝트: tospie/SINFONI
        public SinTD ParseIDL(string idlString, SinTD targetSinTD)
        {
            CurrentlyParsedSinTD = targetSinTD;
            lineNumberParsed = 0;
            currentlyParsing = ParseMode.NONE;
            wasParsingBeforeComment = ParseMode.NONE;

            string[] idlLines =
                idlString.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);

            foreach (string line in idlLines)
            {
                ++lineNumberParsed;
                parseLine(line.Trim());
            }

            return CurrentlyParsedSinTD;
        }
예제 #3
0
        public void TestSetUp()
        {
            i32 = SinTDInstance.GetSinTDType("i32");
            SinTDString = SinTDInstance.GetSinTDType("string");
            SinTDBool = SinTDInstance.GetSinTDType("boolean");

            intStruct = new SinTDStruct("intStruct");
            intStruct.members["x"] = i32;
            intStruct.members["y"] = i32;

            aStruct = new SinTDStruct("arrayStruct");
            aStruct.members.Add("arr", new SinTDArray(i32));
            SinTDInstance.RegisterType(aStruct);

            mStruct = new SinTDStruct("mapStruct");
            mStruct.members.Add("map", new SinTDMap(SinTDString, SinTDBool));
            SinTDInstance.RegisterType(mStruct);

            sStruct = new SinTDStruct("structStruct");
            sStruct.members.Add("child", intStruct);
            SinTDInstance.RegisterType(sStruct);

            SinTDInstance = new SinTD();
        }
예제 #4
0
        public void Setup()
        {
            SinTDInstance = new SinTD();
            SinTDInstance.SINFONIServices = new ServiceRegistry();

            i32 = SinTDInstance.GetSinTDType("i32");
            SinTD_string = SinTDInstance.GetSinTDType("string");

            intStruct = new SinTDStruct("intStruct");
            intStruct.members["x"] = i32;
            intStruct.members["y"] = i32;

            serviceFunction = new ServiceFunctionDescription("function", new SinTDType("void"));
            serviceFunction.Parameters.Add("intParameter", i32);
            serviceFunction.Parameters.Add("stringParameter", SinTD_string);

            service = new SINFONIService("service");
            service.serviceFunctions.Add("function", serviceFunction);

            SinTDInstance.SINFONIServices.services.Add("service", service);
            connection = new TestConnection();
            connection.SinTD = SinTDInstance;
        }