person_struct_parser 0.4.2

Rust parser for person struct #parser #grammar #person_struct
Documentation
1
2
3
4
5
6
7
8
9
10
11
alpha = { 'a'..'z' | 'A'..'Z' }
digit = { '0'..'9' }
non_digit = { !digit ~ . }
non_alpha = { !alpha ~ . }
all_characters_without_digits = { non_digit+ }
all_characters_without_alpha = { non_alpha+ }

name = {(all_characters_without_digits)+ ~ (alpha)+ ~ (all_characters_without_digits)+}
age = {(all_characters_without_alpha)+ ~ (digit)+ ~ (all_characters_without_alpha)+}
city = {(all_characters_without_digits)+ ~ (alpha)+ ~ (all_characters_without_digits)+}
person = {name ~ age ~ city}