in reply to What is the difference between a Statement and an Expression?
expression -> expression + term | expression - term | term statement-> id = expression | if expression then statement | while expression do statement
Notice that in my language grammar (taken directly out of he 'Red Dragon' Compiler Book, Aho, Sethi, Ullman). Statements always begin with either a identifier or a keyword.
$x = 1+1; <--- statement starts with an identifier x followed by an expression 1+1 </code>
mitd-Made in the Dark
'My favourite colour appears to be grey.'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: What is the difference between a Statement and an Expression?
by JavaFan (Canon) on Mar 02, 2012 at 01:15 UTC |