The syntax is OK in the sense of, it is an operand, an operator, an operand, so syntactically it's OK.
这里的语法应该是好的,有个运算对象,一个运算符,另外一个运算对象,因此语法上是没错的。
And in fact, as a sidebar, that is not syntactically correct, there's a simple button that you push that will check your syntax.
实际上,有个小道消息,你放入了,一个语义,结构。
It is in fact syntactically valid.
这只是语法上说得通。
OK. What happens if you actually have something that's both syntactically correct, and appears to have correct static semantics, and you run it?
好,当你的代码语法,没错误,并且也有正确的静态语义,你去运行它的时候会发生什么呢?
If you've turned in a program that's not syntactically correct, the TAs give you a zero.
不正确的,问题组,助教会给你们一个零分。
It's syntactically correct. Right?
在语义构造上是对的,对么?
It's not since syntactically correct, right?
因此这并不是语法正确的对不对?
What's the point? Again, you can have things that are syntactically legal but not semantically meaningful, and static semantics is going to be a way of helping us decide what expressions, what pieces of code, actually have real meaning to it. All right?
重点是什么?重申,你可以有东西在语义结构的逻辑上有意义,但是在语义上无意义,而static语义,将是一个帮助我们,决定哪些表达,哪部分的代码实际上,有意义的途径,好么?
应用推荐