Need somebody good in C++ and rust programming on urgent basis

profilesilvester@13
main1.rs

use std::env; use std::fs; // use regex::Regex; struct Token { token_type: String, value: String, } fn classify_tokens(tokens: Vec<String>) -> Vec<Token> { let mut result: Vec<Token> = Vec::new(); for t in tokens { let c = t.chars().nth(0).unwrap(); if t == "=" { result.push(Token{token_type:"EQUALS".to_string(), value:"".to_string()}); } else if t == "NEWLINE" { result.push(Token{token_type:"NEWLINE".to_string(), value:"".to_string()}); } else if t == "\"" { result.push(Token{token_type:"STRING_LITERAL".to_string(), value:t.to_string()}); } else if t == "+" || t == "-" { result.push(Token{token_type:"OPERATION".to_string(), value:c.to_string()}); } else if c == 'X' { result.push(Token{token_type:"VARIABLE".to_string(), value:t.to_string()}); } else if t == "ISSET" || t == "NUMBER" || t == "STRING" || t == "BRANCH" || t == "INPUT" || t == "PRINT" || t == "VALUE" || t == "TYPE" { result.push(Token{token_type:"KEYWORD".to_string(), value:t.to_string()}); } else if c.is_numeric() { result.push(Token{token_type:"NUMBER".to_string(), value:t.to_string()}); } else { result.push(Token{token_type:"SYNTAX ERROR".to_string(), value:t.to_string()}); } } return result; } fn tokenize(contents: &String) -> Vec<String> { let mut result = Vec::new(); let mut active_quote: bool = false; let mut active_comment: bool = false; let mut token_buffer: String = "".to_string(); for c in contents.chars() { if c == '"' && !active_comment { token_buffer.push_str(&c.to_string()); token_buffer.push_str(&c.to_string()); if active_quote { result.push(token_buffer); token_buffer = "".to_string(); } active_quote = !active_quote; } else if c == ' ' && !active_comment { if active_quote { token_buffer.push_str(&c.to_string()); } else { result.push(token_buffer); token_buffer = "".to_string(); } } else if c == '\n' { if active_comment { active_comment = false; token_buffer = "".to_string(); result.push("NEWLINE".to_string()); continue; } if active_quote { token_buffer.push_str(&c.to_string()); } else { result.push(token_buffer); result.push("NEWLINE".to_string()); token_buffer = "".to_string(); } } else if c == 'C' && !active_quote { active_comment = true; } else { token_buffer.push_str(&c.to_string()); } } if !(token_buffer == "") { result.push(token_buffer); } result.retain(|x| x != ""); return result; } fn main() { // read in the file let args: Vec<_> = env::args().collect(); if args.len() != 2 { println!("Format: string_lang <filename>"); return; } let filename = &args[1]; let contents: String = fs::read_to_string(filename) .expect("Something went wrong reading the file"); // get a vector of tokens as strings let tokens = tokenize(&contents); // get a vector array of tokens as Token objects let result = classify_tokens(tokens); for t in result { println!("{} : '{}'", t.token_type, t.value); } }