Skip to content

Rewriter00x/my_corp_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Danylo Burliai Parser

My parser for educational purposes It can parse corporate user entry, in format Name Surname, n.surname@domain.com

some img

for arg in args {
match arg.as_str() {
"--file" => { is_file = true; },
"--email" => { is_user = false; },
_ => { s = arg; },
}
}

Grammar:

lower_word = _{ ASCII_ALPHA_LOWER+ }
email_domain = { lower_word ~ ("." ~ lower_word){1, 2}}
email_name = { lower_word ~ "." ~ lower_word }
email = { email_name ~ "@" ~ email_domain}
just_email = { SOI ~ email_name ~ "@" ~ email_domain ~ EOI }

capital_letter_word = _{ ASCII_ALPHA_UPPER ~ (ASCII_ALPHA_LOWER)* }
name = { capital_letter_word }
surname = { capital_letter_word }
user = { name ~ WHITE_SPACE ~ surname ~ ", " ~ email}

file_email = { SOI ~ (email ~ NEWLINE)* ~ (email ~ NEWLINE?) ~ EOI }
file_user = { SOI ~ (user ~ NEWLINE)* ~ (user ~ NEWLINE?) ~ EOI }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages