How to define a grammar for a programming language
问题 How to define a grammar (context-free) for a new programming language (imperative programming language) that you want to design from scratch. In other words: How do you proceed when you want to create a new programming language from scratch. 回答1: One step at a time. No seriously, start with expressions and operators, work upwards to statements, then to functions/classes etc. Keep a list of what punctuation is used for what. In parallel define syntax for referring to variables, arrays, hashes,