summaryrefslogtreecommitdiff
path: root/src/main.zig
blob: 8741cd768a8f11fce8f193b9453bb7ead55b4f39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const std = @import("std");
const Regex = @import("regex.zig");

pub fn main() !void {
    const stdio = std.io.getStdIn().writer();
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    var allocator = gpa.allocator();

    defer _ = gpa.deinit();

    var lexer = Regex.Lexer.init("bz*[a-z](l)", &allocator);

    _ = try lexer.scan();

    var parser = Regex.Parser.init(&lexer.tokens, &allocator);

    const pt = try parser.parse();

    try stdio.print("{}\n", .{pt});

    parser.deinit();
    lexer.deinit();
}