syntax analyser: basic framework