use stable grammar to check if is undefined