Exemplo n.º 1
0
        public Python()
        {
            DisplayName = "Python";
            // Variable names
            RegexRules.Add(@"(\w)+", Color.SpringGreen);

            // Primitive Data Types
            //RegexRules.Add(@"int|float|char|short|long|double|decimal|signed|unsigned", Color.DarkViolet);

            // true / false
            RegexRules.Add(@"True|False", Color.Magenta);

            // Statements
            RegexRules.Add(@"return|break|continue|global|import", Color.Orange);
            RegexRules.Add(@"(if|else|elif|while|for|switch|in|is|not|case|def)(?=[\x20\:]+)", Color.Yellow);

            // Functions
            RegexRules.Add(@"(\w+)[\x20\t]*(?=\()", Color.Fuchsia);

            // Operators
            RegexRules.Add(@"\+|-|\*|\/|%|;|=", Color.Aqua);
            RegexRules.Add(@"<|>|&&|\|\||!|<=|>=", Color.DarkGray);
            RegexRules.Add(@"\[|\]|\(|\)|{|}", Color.Brown);

            RegexRules.Add(@"(?![^\w])[\d.\-]+x?[\d]*[fd]?", Color.Orange); // Numbers (f,d suffix) (0x0)
            RegexRules.Add("\"([^\"])*\"", Color.Green);                    // Strings
            RegexRules.Add("\'([^\'])*\'", Color.LightSeaGreen);            // Chars

            // Comments
            RegexRules.Add("#.*", Color.DarkGray);
        }
Exemplo n.º 2
0
        public AdvancedNote()
        {
            DisplayName = "Adv. Note";

            Color listColor = Color.RoyalBlue;

            // Dot lists
            RegexRules.Add(@"\*", listColor);

            // Line lists
            RegexRules.Add(@"-", listColor);

            // Task lists
            RegexRules.Add(@"\[\x20\]", Color.Gray);
            RegexRules.Add(@"\[\?\]", Color.Yellow);
            RegexRules.Add(@"\[!\]", Color.Red);
            RegexRules.Add(@"\[X\]", Color.Lime);
            RegexRules.Add(@"\[O\]", Color.Aqua);

            // Titles
            RegexRules.Add("--[^-]+--", Color.DarkOrange);

            // Sub-titles
            RegexRules.Add(">>.+", Color.Violet);

            // Numbered lists
            RegexRules.Add(@"\d\.", listColor);
        }
Exemplo n.º 3
0
        public AssemblyMIPS()
        {
            DisplayName       = "MIPS ASM";
            PreferredEncoding = Encoding.ASCII;

            // Undefined tokens (raw labels)
            RegexRules.Add(@"\w+", Color.Green);

            // Directives
            RegexRules.Add(@"\.\w+", Color.OrangeRed);

            // Labels
            RegexRules.Add(@"\w+:", Color.SpringGreen);

            // Instruction name
            RegexRules.Add(@"addi|add|addiu|addu|andi|and|beq|bne|jalr|jr|jal|j|lbu|lb|lui|lw|mul|nor|ori|or|sltu|slti|sltiu|slt|sllv|sll|sra|srl|srlv|sb|sw|sub|subu|xor|xori", Color.Cyan);

            // Extra Instructions & psuedo instructions
            RegexRules.Add(@"syscall|la|li|ble|move|nop", Color.Blue);

            // Numbers
            RegexRules.Add(@"0x[0-9abcdefABCDEF]+|(-?([0-9])+(\.[0-9]+)?)", Color.Orange);

            // Strings
            RegexRules.Add("\"([^\"])*\"", Color.Orange);

            // Registers
            RegexRules.Add(@"\$\w+", Color.Yellow);

            // Comments
            RegexRules.Add("#.*", Color.DarkGray);
        }
Exemplo n.º 4
0
        public KiwiShell()
        {
            DisplayName       = "KiwiShell";
            PreferredEncoding = Encoding.ASCII;
            RegexRules        = Batch.Instance.RegexRules; // Inherit from Batch

            // Primitive Data Types
            RegexRules.Add(@"string|number|bool", Color.DarkViolet);

            // true / false
            RegexRules.Add(@"true|false", Color.Azure);

            // Statements
            RegexRules.Add(@"set|goto|if|else", Color.Yellow);

            // Operators
            RegexRules.Add(@"\+|-|\*|\/|%|;|=", Color.Aqua);
            RegexRules.Add(@"<|>|&&|\|\||!|<=|>=", Color.DarkGray);
            RegexRules.Add(@"\[|\]|\(|\)|{|}", Color.Brown);

            // Loops
            RegexRules.Add(@":\w+(\[.*\])?", Color.RoyalBlue);
            RegexRules.Add(@"(?::)\w+(?=\[.*\])", Color.AliceBlue);

            // Comments
            RegexRules.Add("//.*", Color.DarkGray);
        }
Exemplo n.º 5
0
        public C()
        {
            DisplayName = "C";
            // Variable names
            RegexRules.Add(@"(\w)+", Color.SpringGreen);

            // Primitive Data Types
            RegexRules.Add(@"int|intptr_t|float|char|short|long|double|decimal|signed|unsigned|void", Color.DarkViolet);

            // true / false
            RegexRules.Add(@"true|false", Color.Azure);

            // Functions
            RegexRules.Add(@"(\w+)[\x20\t]*(?=\()", Color.Fuchsia);

            // Statements
            RegexRules.Add(@"return|break|continue", Color.Yellow);
            RegexRules.Add(@"(do)(?:[\x20\t]*)(?={)", Color.Yellow);
            RegexRules.Add(@"(case)(?:.*)(?=:)", Color.Yellow);
            RegexRules.Add(@"(if|else|while|for|switch)(?:[\x20\t]*)(?=\()", Color.Yellow);

            // Operators
            RegexRules.Add(@"\+|-|\*|\/|%|;|=", Color.Aqua);
            RegexRules.Add(@"<|>|&&|\|\||!|<=|>=", Color.DarkGray);
            RegexRules.Add(@"\[|\]|\(|\)|{|}", Color.Brown);


            // #            (#[a-z]+)([\x20\t]+("|<)[\w.\\]+("|>))?
            RegexRules.Add("(#[a-z]+)([\\x20\\t]+<[\\w.\\\\]+>)?", Color.DarkOrange);
            RegexRules.Add("(#[a-z]+)", Color.Yellow);

            RegexRules.Add(@"-?(?![^\w])\d+x[\dA-F]+|-?(?![^\w])[\d.]+[fd]?", Color.Orange); // Numbers (f,d suffix) (0x0)
            RegexRules.Add("\"([^\"])*\"", Color.Green);                                     // Strings
            RegexRules.Add(@"'(\\?[^'])?'", Color.LightSeaGreen);                            // Chars

            // Comments
            RegexRules.Add("//.*", Color.DarkGray);
            // Add multi-line comments
        }
Exemplo n.º 6
0
        public WordLang()
        {
            DisplayName = "WordLang";

            // Operations
            RegexRules.Add("[,\\.<]", Color.RoyalBlue);
            RegexRules.Add(">[\x20\t]*\\w+", Color.Lime);
            RegexRules.Add("-[\x20\t]*\\w+", Color.Yellow);

            // Debug
            RegexRules.Add("\\?", Color.Red);

            // Escaped Characters
            RegexRules.Add("\\\\.", Color.Turquoise);

            // Variables
            RegexRules.Add("'[^\']+'", Color.Orange);

            // Conditions
            RegexRules.Add("\\w+!+", Color.Yellow);

            // Comments
            RegexRules.Add("\"[^\"]+\"", Color.DarkGreen);
        }