示例#1
0
文件: App.cs 项目: mhusinsky/prepose
        public static App ReadAppText(string inputString)
        {
            //var input = new Antlr4.Runtime.AntlrFileStream(filename);    //"..\\..\\Tests\\simple.app"
            var input = new Antlr4.Runtime.AntlrInputStream(inputString);    //"..\\..\\Tests\\simple.app"
            var lexer = new PreposeGesturesLexer(input);
            var tokens = new CommonTokenStream(lexer);
            var parser = new PreposeGesturesParser(tokens);
            var tree = parser.app(); // parse
            var visitor = new AppConverter();
            var app = (App)visitor.Visit(tree);

            return app;
        }
示例#2
0
文件: App.cs 项目: virrkharia/prepose
        public static App ReadAppText(string inputString)
        {
            //var input = new Antlr4.Runtime.AntlrFileStream(filename);    //"..\\..\\Tests\\simple.app"
            var input   = new Antlr4.Runtime.AntlrInputStream(inputString);              //"..\\..\\Tests\\simple.app"
            var lexer   = new PreposeGesturesLexer(input);
            var tokens  = new CommonTokenStream(lexer);
            var parser  = new PreposeGesturesParser(tokens);
            var tree    = parser.app();          // parse
            var visitor = new AppConverter();
            var app     = (App)visitor.Visit(tree);

            return(app);
        }
示例#3
0
        private static App GestureAppFromAntlrInput(ICharStream input)
        {
            var lexer  = new PreposeGesturesLexer(input);
            var tokens = new CommonTokenStream(lexer);
            var parser = new PreposeGesturesParser(tokens);

            parser.AddErrorListener((IAntlrErrorListener <IToken>) new ParserErrorListener <IToken>());

            var tree    = parser.app(); // parse
            var visitor = new AppConverter();
            var app     = (App)visitor.Visit(tree);

            return(app);
        }
示例#4
0
        public void UploadOrders(List <JetOrder> orders, OrderStatus status)
        {
            Logger.Log("Upload Jet Orders to Ship Station", Status.INFO);

            List <ShipStationOrder> ShipStationOrders = new List <ShipStationOrder>();

            foreach (JetOrder JetOrder in orders)
            {
                Logger.Log("Jet Order " + JetOrder.MerchantOrderId, Status.DEBUG);

                ShipStationOrder ShipStationOrder = AppConverter.ConvertToShipStationOrder(JetOrder);
                ShipStationOrder.OrderStatus = status;

                ShipStationOrders.Add(ShipStationOrder);

                Logger.Log("Jet Order Complete", Status.DEBUG);
            }
            Task.Run(async() => await ShipStationClientService.CreateOrders(ShipStationOrders));
        }