陈述和表达的概念 [英] Concept of Statements and Expressions

查看:97
本文介绍了陈述和表达的概念的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想知道语句的严肃定义

和表达式是:


i知道表达式被计算为一个值,即:

1 == 2

5 + 7

foo(1,2)


并执行声明:

休息;

5 + 7;

if(foo(1,2)){...}


但是......

C标准如何定义语句和表达式?

表达式语句怎么样?


TIA

Hello, i would like to know what the serious definition of statements
and expressions is:

i know an expression are evaluated to a value, i.e:
1 == 2
5+7
foo( 1,2)

and a statement is executed:
break;
5+7;
if( foo(1,2) ){ ... }

but...
How does the C standard define Statements and Expressions??
And what about expression statements?

TIA

推荐答案



Neroku写道:

Neroku wrote:
您好,我想知道语句
和表达式的严肃定义是什么:

我知道表达式被计算为一个值,即:
1 == 2
5 + 7
foo(1,2)
并执行一条陈述:
休息;
5 + 7;
if(foo(1,2)){...}

但......
C标准如何定义语句和表达式sions ??
那些表达式语句呢?
Hello, i would like to know what the serious definition of statements
and expressions is:

i know an expression are evaluated to a value, i.e:
1 == 2
5+7
foo( 1,2)

and a statement is executed:
break;
5+7;
if( foo(1,2) ){ ... }

but...
How does the C standard define Statements and Expressions??
And what about expression statements?




6.5p1表达式

表达式是一系列运算符和操作数指定

计算一个

值,或者指定一个对象或一个函数,或者生成

副作用,或者

执行其组合。 [...]


6.8p2语句和块

语句指定要执行的操作。 [...]


寻找N1124.pdf以查看其余的定义。这里要粘贴很多





6.5p1 Expressions
An expression is a sequence of operators and operands that specifies
computation of a
value, or that designates an object or a function, or that generates
side effects, or that
performs a combination thereof. [...]

6.8p2 Statements and blocks
A statement specifies an action to be performed. [...]

Look for N1124.pdf to see the rest of the definitions. There''s to much
to paste here.


Vladimir Oka写道:
Vladimir Oka wrote:
6.5p1表达式
表达式是一系列运算符和操作数,用于指定
值的计算,或指定对象或函数,或生成
副作用,或
执行其组合。 [...]
6.5p1 Expressions
An expression is a sequence of operators and operands that specifies
computation of a
value, or that designates an object or a function, or that generates
side effects, or that
performs a combination thereof. [...]




包括看不见的操作员。


-

pete



That includes the invisible operator.

--
pete


" Vladimir Oka" <无**** @ btopenworld.com>写道:
"Vladimir Oka" <no****@btopenworld.com> writes:
Neroku写道:
您好,我想知道陈述
和表达的严肃定义是什么:

我知道一个表达式被评估为一个值,即:
1 == 2
5 + 7
foo(1,2)

并执行一个语句:
休息;
5 + 7;
if(foo(1,2)){...}

但是...
如何C标准是否定义了语句和表达式?
那么表达式语句呢?
Hello, i would like to know what the serious definition of statements
and expressions is:

i know an expression are evaluated to a value, i.e:
1 == 2
5+7
foo( 1,2)

and a statement is executed:
break;
5+7;
if( foo(1,2) ){ ... }

but...
How does the C standard define Statements and Expressions??
And what about expression statements?



6.5p1表达式
表达式是一系列运算符和操作数,用于指定
值的计算,或指定对象或功能,或产生副作用,或执行其组合的值。 [...]



6.5p1 Expressions
An expression is a sequence of operators and operands that specifies
computation of a value, or that designates an object or a function,
or that generates side effects, or that performs a combination
thereof. [...]




这个定义实际上是不准确的。例如,



显然是一个表达式,但它不包含运算符,因此

没有操作数。 (不,没有隐含的隐形算子。)


-

基思汤普森(The_Other_Keith) ks *** @ mib.org < http://www.ghoti.net/~kst>

圣地亚哥超级计算机中心< *> ; < http://users.sdsc.edu/~kst>

我们必须做点什么。这是事情。因此,我们必须这样做。



This definition is actually inaccurate. For example,
42
is clearly an expression, but it contains no operators and therefore
no operands. (No, there''s no implicit invisible operator.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.


这篇关于陈述和表达的概念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆