flex/
flex.rs

1use fluid_parser::lexer::Lexer;
2use fluid_parser::parser::Parser;
3
4const TEST: &str = r#"# data file for the Fltk User Interface Designer (fluid)
5version 1.0400
6header_name {.h}
7code_name {.cxx}
8avoid_early_includes
9class UserInterface {open
10} {
11  Function {make_window()} {open
12  } {
13    Fl_Window Hello {open
14      xywh {821 256 400 344} type Double align 80 resizable visible
15    } {
16      Fl_Flex {} {open
17        xywh {5 5 390 335} resizable gap 5 set_size_tuples {2  0 30  2 30 }
18      } {
19        Fl_Flex {} {open
20          xywh {5 5 390 30} type HORIZONTAL gap 5 set_size_tuples {3  0 80  1 80  3 30 }
21        } {
22          Fl_Menu_Button {} {
23            label menu open
24            xywh {5 5 80 30}
25          } {}
26          Fl_Box {} {
27            label {https://}
28            xywh {90 5 80 30}
29          }
30          Fl_Input {} {
31            xywh {175 5 185 30}
32          }
33          Fl_Button {} {
34            label I
35            xywh {365 5 30 30}
36          }
37        }
38        Fl_Flex Nmae {open
39          xywh {5 40 390 265} type HORIZONTAL gap 5
40        } {
41          Fl_Text_Display {} {
42            xywh {5 40 390 265}
43          }
44        }
45      }
46    }
47  }
48}"#;
49
50fn main() {
51    let l = Lexer::new(TEST);
52    let mut p = Parser::new(l);
53    let a = p.parse();
54    println!("{:#?}", a);
55}