This is usually done with reference to a context-free grammar which recursively defines components that can make up an expression and the order in which they must appear.
Ovo se obično čini korišćenjem kontekstno slobodne gramatike koja rekurzivno definiše komponente koje mogu činiti izraz i redosled kojim one moraju da se pojavljuju.