procc_ll/
token.rs

1
2
3
4
5
6
7
8
9
10
use crate::Program;
use crate::values::Values;
///trait that is used to define a structure, contains one method to run the token and another to verify that the token is compatible
pub trait Token {
    /// Execute the token, requires the string token and the program block
    fn exec(&self, input: &str, program: &mut Program) -> Option<Values>;
    /// Verify it is a token
    fn is_token(&self, c: &str) -> bool;
}