Esempio n. 1
0
        /// <summary>
        /// 
        /// </summary>
        public Interpreter()
        {
            // initialize parser objects
                scanner=new Scanner();
                parser=new Parser(scanner);
                //highlighter = new TextHighlighter(richTextBox, scanner, parser);

                // read configuration file and item files now
                readConfiguration();
                Logger.DBLog.InfoFormat(" _______________________________________");
                Logger.DBLog.InfoFormat(" ___-|: Darkfriend's Item Rules 2 :|-___");
                Logger.DBLog.InfoFormat(" ___________________Rel.-v {0}_______", version);
        }
Esempio n. 2
0
        public TextHighlighter(RichTextBox textbox, Scanner scanner, Parser parser)
        {
            Textbox = textbox;
            Scanner = scanner;
            Parser = parser;

            ClearUndo();

            //Tree = Parser.Parse(Textbox.Text);
            Textbox.TextChanged += Textbox_TextChanged;
            textbox.KeyDown += textbox_KeyDown;
            Textbox.SelectionChanged += Textbox_SelectionChanged;
            Textbox.Disposed += Textbox_Disposed;

            SwitchContext = null;
            currentContext = Tree;

            threadAutoHighlight = new Thread(AutoHighlightStart);
            threadAutoHighlight.Start();
        }