示例#1
0
        public static void Execute(Plc plc, string mnemonic)
        {
            var stream  = new AntlrInputStream(mnemonic);
            var lexer   = new gen.MnemonicLexer(stream);
            var parser  = new gen.MnemonicParser(new CommonTokenStream(lexer));
            var visitor = new MnemonicVisitor(plc);

            visitor.Visit(parser.input());
        }
示例#2
0
        private static MnemonicResult VisitOperand(string text)
        {
            var stream  = new AntlrInputStream(text);
            var lexer   = new gen.MnemonicLexer(stream);
            var parser  = new gen.MnemonicParser(new CommonTokenStream(lexer));
            var visitor = new MnemonicVisitor(null);

            return(visitor.Visit(parser.operand()));
        }