grammar_type.cpp proof of concept