package core:text/regex/compiler

⌘K
Ctrl+K
or
/

    Overview

    package regex_compiler implements a bytecode compiler for the virtual machine included alongside it.

    Operands larger than u8 are written in system endian order.

    More details can be found in the documentation for the virtual machine.

    Types

    Compiler ¶

    Compiler :: struct {
    	flags:      bit_set[regex_common.Flag; u8],
    	class_data: [dynamic]regex_parser.Rune_Class_Data,
    }
    Related Procedures With Parameters

    Error ¶

    Error :: enum int {
    	None, 
    	Program_Too_Big, 
    	Too_Many_Classes, 
    }
    Related Procedures With Returns

    Node ¶

    Node :: regex_parser.Node

    Node_Alternation ¶

    Node_Alternation :: regex_parser.Node_Alternation

    Node_Anchor ¶

    Node_Anchor :: regex_parser.Node_Anchor

    Node_Concatenation ¶

    Node_Concatenation :: regex_parser.Node_Concatenation

    Node_Group ¶

    Node_Group :: regex_parser.Node_Group

    Node_Match_All_And_Escape ¶

    Node_Match_All_And_Escape :: regex_parser.Node_Match_All_And_Escape

    Node_Optional ¶

    Node_Optional :: regex_parser.Node_Optional

    Node_Optional_Non_Greedy ¶

    Node_Optional_Non_Greedy :: regex_parser.Node_Optional_Non_Greedy

    Node_Repeat_N ¶

    Node_Repeat_N :: regex_parser.Node_Repeat_N

    Node_Repeat_One ¶

    Node_Repeat_One :: regex_parser.Node_Repeat_One

    Node_Repeat_One_Non_Greedy ¶

    Node_Repeat_One_Non_Greedy :: regex_parser.Node_Repeat_One_Non_Greedy

    Node_Repeat_Zero ¶

    Node_Repeat_Zero :: regex_parser.Node_Repeat_Zero

    Node_Repeat_Zero_Non_Greedy ¶

    Node_Repeat_Zero_Non_Greedy :: regex_parser.Node_Repeat_Zero_Non_Greedy

    Node_Rune ¶

    Node_Rune :: regex_parser.Node_Rune

    Node_Rune_Class ¶

    Node_Rune_Class :: regex_parser.Node_Rune_Class

    Node_Wildcard ¶

    Node_Wildcard :: regex_parser.Node_Wildcard

    Node_Word_Boundary ¶

    Node_Word_Boundary :: regex_parser.Node_Word_Boundary

    Opcode ¶

    Opcode :: regex_vm.Opcode

    Program ¶

    Program :: [dynamic]regex_vm.Opcode

    Rune_Class_Data ¶

    Rune_Class_Data :: regex_parser.Rune_Class_Data

    Rune_Class_Range ¶

    Rune_Class_Range :: regex_parser.Rune_Class_Range

    Token ¶

    Token :: regex_tokenizer.Token

    Token_Kind ¶

    Token_Kind :: regex_tokenizer.Token_Kind

    Tokenizer ¶

    Tokenizer :: regex_tokenizer.Tokenizer

    Constants

    JUMP_SIZE ¶

    JUMP_SIZE :: size_of(Opcode) + 1 * size_of(u16)

    SPLIT_SIZE ¶

    SPLIT_SIZE :: size_of(Opcode) + 2 * size_of(u16)

    Variables

    This section is empty.

    Procedures

    append_raw ¶

    append_raw :: proc(code: ^[dynamic]regex_vm.Opcode, data: $T) {…}

    classes_are_exact ¶

    classes_are_exact :: proc(q, w: ^regex_parser.Rune_Class_Data) -> bool {…}

    compile ¶

    compile :: proc(tree: regex_parser.Node, flags: bit_set[regex_common.Flag; u8]) -> (code: [dynamic]regex_vm.Opcode, class_data: [dynamic]regex_parser.Rune_Class_Data, err: Error) {…}

    generate_code ¶

    generate_code :: proc(c: ^Compiler, node: regex_parser.Node) -> (code: [dynamic]regex_vm.Opcode) {…}

    get_jump_targets ¶

    get_jump_targets :: proc(code: []regex_vm.Opcode) -> (jump_targets: map[int]int) {…}

    inject_raw ¶

    inject_raw :: proc(code: ^[dynamic]regex_vm.Opcode, start: int, data: $T) {…}

    map_all_classes ¶

    map_all_classes :: proc(tree: regex_parser.Node, collection: ^[dynamic]regex_parser.Rune_Class_Data) {…}

    trace ¶

    trace :: proc(w: io.Stream, code: []regex_vm.Opcode) {…}

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2024-11 (vendor "odin") Windows_amd64 @ 2024-11-16 21:10:10.878897000 +0000 UTC