Added possibility to read grammar from console