C语法归约之变量声明和定义(0)

0前言

闲来无事,在屋里多看了一眼《编译原理》(2V),有练练手的冲动——采用LR(1)技术,写了一个C语言的语法归约器!之所以用LR(1)是因为gcc,ucc,tcc和lcc跟商量好似的,清一色的用的LL归约技术,书上也是讲的跟天花一样漂亮,那么就说明它已经十分成熟了,如果再使用LL技术实在是炸不出价值来,源码一抓一大把,看看就够了,重写必要性不大!另外,书中的LR技术讲的项集又是大的没谱,工作量太大;如果使用工具yacc生成,又不知道它咋搞的猫腻,所以就没有踩它们的脚印,自己整套方法high起来^!^!至于后期要不要增加编译的其他部分,再说。现在用它来拉拉风!顺便解释下C语言真正机密——归约!

1、C语言C99文法树

C99文法树图,这是C99标准文法,画成图了,方便查阅,便于理解。其中实线是归约方向,虚线箭头不是归约指向,是箭头指向的产生式中此非终结符的产生式,实线箭头相连两头构成一个产生式!(注:图较大,显示太小,请自行右键图片另存为下载该图片查阅或者干脆查看C99文法,都中)

值得提醒一点的是,单纯从文法上讲,它不是树,更准确的说是图,但为了方便理解,中间交织的内容就没有连接,从而看上去还像一颗树

a、表达式(注,为了便于理解运算符优先级,这部分化成了圈)

b、声明,定义,初始化,抽象类型部分(注,图中有opt的,则表示前面的非终结符可选)

c、语句部分(注,图中有opt的,则表示前面的非终结符可选,鉴于图片大小分布,没有展开)

d、外部定义

e、合成总图(几部分的连接不是绝对的对应,比如expression在多处出现,我只是简单链接一条示意了一下,不要钻牛尖哦)

2、实例探究

如果你没有C语言基础,请按照下面步骤执行,一移动鼠标到浏览器的X,二点击关闭,over,(*^__^*) !如果你是初学者,可能会有点好处;前提是下文你得看得懂!如果你是个码农,可能你会看到之前你没有看到的C的另一层面!如果你是个高级工程师且懂得编译,那么你也按照上面两步走或者高手ALT-F4即可!

阅读说明:(对读懂很重要)

0-仅归约过程,无符号表处理,因此不检查ID的冲突和不对typedef的类型归约

1-归约过程输出的是归约栈的整个栈当前状态

2-连续的栈输出,表示curr的多次归约

3-栈顶非终结符是从上步归约而来

比如:

declaration-specifiers direct-declarator

declaration-specifiers declarator

其中declarator是从direct-declarator归约而来

再比如:

declaration-list type-specifier declaration-specifiers

declaration-list declaration-specifiers

其中declaration-specifiers是由type-specifier declaration-specifiers 归约而来,等等

4-curr输出当前归约的终结符,next是预取下一个要归约的终结符

5-如果curr输出是ID,STR,CONSTANT,则它的真实值是前面的next输出.比如下面的curr: ID, next ; 那么这个ID就是右上vali

6-要结合上面的文法图或者C99标准来解读

7-任何无语法错误的源程序都要归约成一棵树!根结点就是translation-unit

话说千言万语不如一个好例子。当然不可能在这里穷举所有相关语法的实例,而只在常用重点上举几个例子!看看 C语言是怎么被解析的!

2.1、基本全局变量

示例代码

int vali;
char valc;
short vals;
long vall;
unsigned int valui;
signed int valsi;
/*其余float double double float 
  unsigned char, signed char, unsigned short, signed short
  unsigned long, signed long都一样的归约过程,不多余举例*/

归约树

curr: int  next: vali
type-specifier
declaration-specifiers 

curr: ID  next: ;
declaration-specifiers direct-declarator
declaration-specifiers declarator
declaration-specifiers init-declarator
declaration-specifiers init-declarator-list 

curr: ;  next: char
declaration
declaration-list
//归约char valc;
curr: char  next: valc
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ID  next: ;
declaration-list declaration-specifiers direct-declarator
declaration-list declaration-specifiers declarator
declaration-list declaration-specifiers init-declarator
declaration-list declaration-specifiers init-declarator-list 

curr: ;  next: short
declaration-list declaration
declaration-list
//归约short vals;
curr: short  next: vals
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ID  next: ;
declaration-list declaration-specifiers direct-declarator
declaration-list declaration-specifiers declarator
declaration-list declaration-specifiers init-declarator
declaration-list declaration-specifiers init-declarator-list 

curr: ;  next: long
declaration-list declaration
declaration-list
//归约long vall;
curr: long  next: vall
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ID  next: ;
declaration-list declaration-specifiers direct-declarator
declaration-list declaration-specifiers declarator
declaration-list declaration-specifiers init-declarator
declaration-list declaration-specifiers init-declarator-list 

curr: ;  next: unsigned
declaration-list declaration
declaration-list
//归约unsigned int valui;
curr: unsigned  next: int
declaration-list type-specifier 

curr: int  next: valui
declaration-list type-specifier type-specifier
declaration-list type-specifier declaration-specifiers
declaration-list declaration-specifiers 

curr: ID  next: ;
declaration-list declaration-specifiers direct-declarator
declaration-list declaration-specifiers declarator
declaration-list declaration-specifiers init-declarator
declaration-list declaration-specifiers init-declarator-list 

curr: ;  next: signed
declaration-list declaration
declaration-list
//归约signed int valsi;
curr: signed  next: int
declaration-list type-specifier 

curr: int  next: valsi
declaration-list type-specifier type-specifier
declaration-list type-specifier declaration-specifiers
declaration-list declaration-specifiers 

curr: ID  next: ;
declaration-list declaration-specifiers direct-declarator
declaration-list declaration-specifiers declarator
declaration-list declaration-specifiers init-declarator
declaration-list declaration-specifiers init-declarator-list 

curr: ;  next: NULL
declaration-list declaration
declaration-list
translation-unit //完成

提示

int vali;归约过程为例子

int->type-specifier->declaration-specifiers(1)

ID->direct-declarator->declarator->init-declarator->init-declarator-list (2)

(1)和(2)->declaration.

由于下面还有变量的定义,因此

declaration->declaration-list

上面其他变量的归约过程基本一样,不多解释!

从语法来讲,void, char, short, int, long, float, double, unsigned, signed,可以任意组合N长的类型说明符,比如long long long long int unsigned char short,这8个当成一个类型也是能正确归约的。当然它没有意义!有没有意义这是类型检测的工作,属于后话,先不说!

2.2、结构联合枚举类型声明和定义

示例代码

struct AA;
union BB;
enum CC;

struct girl {
	int ga, gb, gc;
};

struct boy {
	struct girl bl;
};

struct woman {
	union inner {
		struct girl gg;
		struct boy bb;
	}sex;
};

union type{
	int vali;
	char ch;
	long vall;
};

enum tag{
	FIRST,
	FOLLOW,
	LAST,
	TEST
};

归约树

curr: struct  next: AA  

curr: ID  next: ;
struct-specifier
type-specifier
declaration-specifiers 

curr: ;  next: union
declaration
declaration-list
//归约union BB;
curr: union  next: BB  

curr: ID  next: ;
declaration-list union-specifier
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ;  next: enum
declaration-list declaration
declaration-list
//归约enum CC;
curr: enum  next: CC  

curr: ID  next: ;
declaration-list enum-specifier
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ;  next: struct
declaration-list declaration
declaration-list
/*归约struct girl {
int ga, gb, gc;
};*/
curr: struct  next: girl  

curr: ID  next: {  

curr: {  next: int  

curr: int  next: ga
declaration-list struct ID { type-specifier
declaration-list struct ID { specifier-qualifier-list 

curr: ID  next: ,
declaration-list struct ID { specifier-qualifier-list direct-declarator
declaration-list struct ID { specifier-qualifier-list declarator
declaration-list struct ID { specifier-qualifier-list struct-declarator-list 

curr: ,  next: gb  

curr: ID  next: ,
declaration-list struct ID { specifier-qualifier-list struct-declarator-list , direct-declarator
declaration-list struct ID { specifier-qualifier-list struct-declarator-list , declarator
declaration-list struct ID { specifier-qualifier-list struct-declarator-list 

curr: ,  next: gc  

curr: ID  next: ;
declaration-list struct ID { specifier-qualifier-list struct-declarator-list , direct-declarator
declaration-list struct ID { specifier-qualifier-list struct-declarator-list , declarator
declaration-list struct ID { specifier-qualifier-list struct-declarator-list 

curr: ;  next: }
declaration-list struct ID { struct-declaration
declaration-list struct ID { struct-declaration-list 

curr: }  next: ;
declaration-list struct-specifier
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ;  next: struct
declaration-list declaration
declaration-list
/*归约struct boy {
struct girl bl;
};*/
curr: struct  next: boy  

curr: ID  next: {  

curr: {  next: struct  

curr: struct  next: girl  

curr: bl  next: ID
declaration-list struct ID { struct-specifier
declaration-list struct ID { type-specifier
declaration-list struct ID { specifier-qualifier-list 

curr: ID  next: ;
declaration-list struct ID { specifier-qualifier-list direct-declarator
declaration-list struct ID { specifier-qualifier-list declarator
declaration-list struct ID { specifier-qualifier-list struct-declarator-list 

curr: ;  next: }
declaration-list struct ID { struct-declaration
declaration-list struct ID { struct-declaration-list 

curr: }  next: ;
declaration-list struct-specifier
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ;  next: struct
declaration-list declaration
declaration-list
/*归约struct woman {
union inner {
struct girl gg;
struct boy bb;
}sex;
};*/
curr: struct  next: woman  

curr: ID  next: {  

curr: {  next: union  

curr: union  next: inner  

curr: ID  next: {  

curr: {  next: struct  

curr: struct  next: girl  

curr: gg  next: ID
declaration-list struct ID { union ID { struct-specifier
declaration-list struct ID { union ID { type-specifier
declaration-list struct ID { union ID { specifier-qualifier-list 

curr: ID  next: ;
declaration-list struct ID { union ID { specifier-qualifier-list direct-declarator
declaration-list struct ID { union ID { specifier-qualifier-list declarator
declaration-list struct ID { union ID { specifier-qualifier-list struct-declarator-list 

curr: ;  next: struct
declaration-list struct ID { union ID { struct-declaration
declaration-list struct ID { union ID { struct-declaration-list 

curr: struct  next: boy  

curr: bb  next: ID
declaration-list struct ID { union ID { struct-declaration-list struct-specifier
declaration-list struct ID { union ID { struct-declaration-list type-specifier
declaration-list struct ID { union ID { struct-declaration-list specifier-qualifier-list 

curr: ID  next: ;
declaration-list struct ID { union ID { struct-declaration-list specifier-qualifier-list direct-declarator
declaration-list struct ID { union ID { struct-declaration-list specifier-qualifier-list declarator
declaration-list struct ID { union ID { struct-declaration-list specifier-qualifier-list struct-declarator-list 

curr: ;  next: }
declaration-list struct ID { union ID { struct-declaration-list struct-declaration
declaration-list struct ID { union ID { struct-declaration-list 

curr: }  next: sex
declaration-list struct ID { union-specifier
declaration-list struct ID { type-specifier
declaration-list struct ID { specifier-qualifier-list 

curr: ID  next: ;
declaration-list struct ID { specifier-qualifier-list direct-declarator
declaration-list struct ID { specifier-qualifier-list declarator
declaration-list struct ID { specifier-qualifier-list struct-declarator-list 

curr: ;  next: }
declaration-list struct ID { struct-declaration
declaration-list struct ID { struct-declaration-list 

curr: }  next: ;
declaration-list struct-specifier
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ;  next: union
declaration-list declaration
declaration-list
/*归约union type{
int vali;
char ch;
long vall;
};*/
curr: union  next: type  

curr: ID  next: {  

curr: {  next: int  

curr: int  next: vali
declaration-list union ID { type-specifier
declaration-list union ID { specifier-qualifier-list 

curr: ID  next: ;
declaration-list union ID { specifier-qualifier-list direct-declarator
declaration-list union ID { specifier-qualifier-list declarator
declaration-list union ID { specifier-qualifier-list struct-declarator-list 

curr: ;  next: char
declaration-list union ID { struct-declaration
declaration-list union ID { struct-declaration-list 

curr: char  next: ch
declaration-list union ID { struct-declaration-list type-specifier
declaration-list union ID { struct-declaration-list specifier-qualifier-list 

curr: ID  next: ;
declaration-list union ID { struct-declaration-list specifier-qualifier-list direct-declarator
declaration-list union ID { struct-declaration-list specifier-qualifier-list declarator
declaration-list union ID { struct-declaration-list specifier-qualifier-list struct-declarator-list 

curr: ;  next: long
declaration-list union ID { struct-declaration-list struct-declaration
declaration-list union ID { struct-declaration-list 

curr: long  next: vall
declaration-list union ID { struct-declaration-list type-specifier
declaration-list union ID { struct-declaration-list specifier-qualifier-list 

curr: ID  next: ;
declaration-list union ID { struct-declaration-list specifier-qualifier-list direct-declarator
declaration-list union ID { struct-declaration-list specifier-qualifier-list declarator
declaration-list union ID { struct-declaration-list specifier-qualifier-list struct-declarator-list 

curr: ;  next: }
declaration-list union ID { struct-declaration-list struct-declaration
declaration-list union ID { struct-declaration-list 

curr: }  next: ;
declaration-list union-specifier
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ;  next: enum
declaration-list declaration
declaration-list
/*归约enum tag{
FIRST,
FOLLOW,
LAST,
TEST
};*/
curr: enum  next: tag  

curr: ID  next: {  

curr: {  next: FIRST  

curr: ID  next: ,
declaration-list enum ID { enumeration-constant
declaration-list enum ID { enumerator
declaration-list enum ID { enumerator-list 

curr: ,  next: FOLLOW  

curr: ID  next: ,
declaration-list enum ID { enumerator-list , enumeration-constant
declaration-list enum ID { enumerator-list , enumerator
declaration-list enum ID { enumerator-list 

curr: ,  next: LAST  

curr: ID  next: ,
declaration-list enum ID { enumerator-list , enumeration-constant
declaration-list enum ID { enumerator-list , enumerator
declaration-list enum ID { enumerator-list 

curr: ,  next: TEST  

curr: ID  next: }
declaration-list enum ID { enumerator-list , enumeration-constant
declaration-list enum ID { enumerator-list , enumerator
declaration-list enum ID { enumerator-list 

curr: }  next: ;
declaration-list enum-specifier
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ;  next: NULL
declaration-list declaration
declaration-list
translation-unit 

2.3、结构联合枚举的初始化

示例代码

struct a {
	int b;
	struct {
		char ch;
		int id;
	} me;
	struct a *next;

} student[10] = {
	1, {1, 2}, 0,
	1, {1, 2}, 0,
	1, {1, 2}, 0,
	1, {1, 2}, 0,
};

struct a b[4] = {
	.b = 0,
	.me = {.ch = a,
		   .id = 0,},
	.c
	.d
	.e = 1,};
union c{
	int i;
	char ch;
} age_sex[5] = {1, 2, 3, 4, 5};

enum {
	WOMEN = 1,
	MAN,
	CHILD
};

归约树

curr: struct  next: a  

curr: ID  next: {  

curr: {  next: int  

curr: int  next: b
struct ID { type-specifier
struct ID { specifier-qualifier-list 

curr: ID  next: ;
struct ID { specifier-qualifier-list direct-declarator
struct ID { specifier-qualifier-list declarator
struct ID { specifier-qualifier-list struct-declarator-list 

curr: ;  next: struct
struct ID { struct-declaration
struct ID { struct-declaration-list 

curr: struct  next: {  

curr: {  next: char  

curr: char  next: ch
struct ID { struct-declaration-list struct { type-specifier
struct ID { struct-declaration-list struct { specifier-qualifier-list 

curr: ID  next: ;
struct ID { struct-declaration-list struct { specifier-qualifier-list direct-declarator
struct ID { struct-declaration-list struct { specifier-qualifier-list declarator
struct ID { struct-declaration-list struct { specifier-qualifier-list struct-declarator-list 

curr: ;  next: int
struct ID { struct-declaration-list struct { struct-declaration
struct ID { struct-declaration-list struct { struct-declaration-list 

curr: int  next: id
struct ID { struct-declaration-list struct { struct-declaration-list type-specifier
struct ID { struct-declaration-list struct { struct-declaration-list specifier-qualifier-list 

curr: ID  next: ;
struct ID { struct-declaration-list struct { struct-declaration-list specifier-qualifier-list direct-declarator
struct ID { struct-declaration-list struct { struct-declaration-list specifier-qualifier-list declarator
struct ID { struct-declaration-list struct { struct-declaration-list specifier-qualifier-list struct-declarator-list 

curr: ;  next: }
struct ID { struct-declaration-list struct { struct-declaration-list struct-declaration
struct ID { struct-declaration-list struct { struct-declaration-list 

curr: }  next: me
struct ID { struct-declaration-list struct-specifier
struct ID { struct-declaration-list type-specifier
struct ID { struct-declaration-list specifier-qualifier-list 

curr: ID  next: ;
struct ID { struct-declaration-list specifier-qualifier-list direct-declarator
struct ID { struct-declaration-list specifier-qualifier-list declarator
struct ID { struct-declaration-list specifier-qualifier-list struct-declarator-list 

curr: ;  next: struct
struct ID { struct-declaration-list struct-declaration
struct ID { struct-declaration-list 

curr: struct  next: a  

curr: ID  next: *
struct ID { struct-declaration-list struct-specifier
struct ID { struct-declaration-list type-specifier
struct ID { struct-declaration-list specifier-qualifier-list 

curr: *  next: next
struct ID { struct-declaration-list specifier-qualifier-list pointer 

curr: ID  next: ;
struct ID { struct-declaration-list specifier-qualifier-list pointer direct-declarator
struct ID { struct-declaration-list specifier-qualifier-list declarator
struct ID { struct-declaration-list specifier-qualifier-list struct-declarator-list 

curr: ;  next: }
struct ID { struct-declaration-list struct-declaration
struct ID { struct-declaration-list 

curr: }  next: student
struct-specifier
type-specifier
declaration-specifiers 

curr: ID  next: [
declaration-specifiers direct-declarator 

curr: [  next: 10  

curr: 10  next: ]
declaration-specifiers direct-declarator [ primary-expression
declaration-specifiers direct-declarator [ postfix-expression
declaration-specifiers direct-declarator [ unary-expression
declaration-specifiers direct-declarator [ cast-expression
declaration-specifiers direct-declarator [ multiplicative-expression
declaration-specifiers direct-declarator [ additive-expression
declaration-specifiers direct-declarator [ shift-expression
declaration-specifiers direct-declarator [ relational-expression
declaration-specifiers direct-declarator [ equality-expression
declaration-specifiers direct-declarator [ AND-expression
declaration-specifiers direct-declarator [ exclusive-OR-expression
declaration-specifiers direct-declarator [ inclusive-OR-expression
declaration-specifiers direct-declarator [ logical-AND-expression
declaration-specifiers direct-declarator [ logical-OR-expression
declaration-specifiers direct-declarator [ conditional-expression
declaration-specifiers direct-declarator [ assignment-expression 

curr: ]  next: =
declaration-specifiers direct-declarator
declaration-specifiers declarator 

curr: =  next: {  

curr: {  next: 1  

curr: 1  next: ,
declaration-specifiers declarator = { primary-expression
declaration-specifiers declarator = { postfix-expression
declaration-specifiers declarator = { unary-expression
declaration-specifiers declarator = { cast-expression
declaration-specifiers declarator = { multiplicative-expression
declaration-specifiers declarator = { additive-expression
declaration-specifiers declarator = { shift-expression
declaration-specifiers declarator = { relational-expression
declaration-specifiers declarator = { equality-expression
declaration-specifiers declarator = { AND-expression
declaration-specifiers declarator = { exclusive-OR-expression
declaration-specifiers declarator = { inclusive-OR-expression
declaration-specifiers declarator = { logical-AND-expression
declaration-specifiers declarator = { logical-OR-expression
declaration-specifiers declarator = { conditional-expression
declaration-specifiers declarator = { assignment-expression
declaration-specifiers declarator = { initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: {  

curr: {  next: 1  

curr: 1  next: ,
declaration-specifiers declarator = { initializer-list , { primary-expression
declaration-specifiers declarator = { initializer-list , { postfix-expression
declaration-specifiers declarator = { initializer-list , { unary-expression
declaration-specifiers declarator = { initializer-list , { cast-expression
declaration-specifiers declarator = { initializer-list , { multiplicative-expression
declaration-specifiers declarator = { initializer-list , { additive-expression
declaration-specifiers declarator = { initializer-list , { shift-expression
declaration-specifiers declarator = { initializer-list , { relational-expression
declaration-specifiers declarator = { initializer-list , { equality-expression
declaration-specifiers declarator = { initializer-list , { AND-expression
declaration-specifiers declarator = { initializer-list , { exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { logical-AND-expression
declaration-specifiers declarator = { initializer-list , { logical-OR-expression
declaration-specifiers declarator = { initializer-list , { conditional-expression
declaration-specifiers declarator = { initializer-list , { assignment-expression
declaration-specifiers declarator = { initializer-list , { initializer
declaration-specifiers declarator = { initializer-list , { initializer-list 

curr: ,  next: 2  

curr: 2  next: }
declaration-specifiers declarator = { initializer-list , { initializer-list , primary-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , postfix-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , unary-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , cast-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , multiplicative-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , additive-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , shift-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , relational-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , equality-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , AND-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , logical-AND-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , logical-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , conditional-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , assignment-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , initializer
declaration-specifiers declarator = { initializer-list , { initializer-list 

curr: }  next: ,
declaration-specifiers declarator = { initializer-list , initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: 0  

curr: 0  next: ,
declaration-specifiers declarator = { initializer-list , primary-expression
declaration-specifiers declarator = { initializer-list , postfix-expression
declaration-specifiers declarator = { initializer-list , unary-expression
declaration-specifiers declarator = { initializer-list , cast-expression
declaration-specifiers declarator = { initializer-list , multiplicative-expression
declaration-specifiers declarator = { initializer-list , additive-expression
declaration-specifiers declarator = { initializer-list , shift-expression
declaration-specifiers declarator = { initializer-list , relational-expression
declaration-specifiers declarator = { initializer-list , equality-expression
declaration-specifiers declarator = { initializer-list , AND-expression
declaration-specifiers declarator = { initializer-list , exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , logical-AND-expression
declaration-specifiers declarator = { initializer-list , logical-OR-expression
declaration-specifiers declarator = { initializer-list , conditional-expression
declaration-specifiers declarator = { initializer-list , assignment-expression
declaration-specifiers declarator = { initializer-list , initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: 1  

curr: 1  next: ,
declaration-specifiers declarator = { initializer-list , primary-expression
declaration-specifiers declarator = { initializer-list , postfix-expression
declaration-specifiers declarator = { initializer-list , unary-expression
declaration-specifiers declarator = { initializer-list , cast-expression
declaration-specifiers declarator = { initializer-list , multiplicative-expression
declaration-specifiers declarator = { initializer-list , additive-expression
declaration-specifiers declarator = { initializer-list , shift-expression
declaration-specifiers declarator = { initializer-list , relational-expression
declaration-specifiers declarator = { initializer-list , equality-expression
declaration-specifiers declarator = { initializer-list , AND-expression
declaration-specifiers declarator = { initializer-list , exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , logical-AND-expression
declaration-specifiers declarator = { initializer-list , logical-OR-expression
declaration-specifiers declarator = { initializer-list , conditional-expression
declaration-specifiers declarator = { initializer-list , assignment-expression
declaration-specifiers declarator = { initializer-list , initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: {  

curr: {  next: 1  

curr: 1  next: ,
declaration-specifiers declarator = { initializer-list , { primary-expression
declaration-specifiers declarator = { initializer-list , { postfix-expression
declaration-specifiers declarator = { initializer-list , { unary-expression
declaration-specifiers declarator = { initializer-list , { cast-expression
declaration-specifiers declarator = { initializer-list , { multiplicative-expression
declaration-specifiers declarator = { initializer-list , { additive-expression
declaration-specifiers declarator = { initializer-list , { shift-expression
declaration-specifiers declarator = { initializer-list , { relational-expression
declaration-specifiers declarator = { initializer-list , { equality-expression
declaration-specifiers declarator = { initializer-list , { AND-expression
declaration-specifiers declarator = { initializer-list , { exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { logical-AND-expression
declaration-specifiers declarator = { initializer-list , { logical-OR-expression
declaration-specifiers declarator = { initializer-list , { conditional-expression
declaration-specifiers declarator = { initializer-list , { assignment-expression
declaration-specifiers declarator = { initializer-list , { initializer
declaration-specifiers declarator = { initializer-list , { initializer-list 

curr: ,  next: 2  

curr: 2  next: }
declaration-specifiers declarator = { initializer-list , { initializer-list , primary-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , postfix-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , unary-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , cast-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , multiplicative-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , additive-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , shift-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , relational-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , equality-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , AND-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , logical-AND-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , logical-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , conditional-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , assignment-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , initializer
declaration-specifiers declarator = { initializer-list , { initializer-list 

curr: }  next: ,
declaration-specifiers declarator = { initializer-list , initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: 0  

curr: 0  next: ,
declaration-specifiers declarator = { initializer-list , primary-expression
declaration-specifiers declarator = { initializer-list , postfix-expression
declaration-specifiers declarator = { initializer-list , unary-expression
declaration-specifiers declarator = { initializer-list , cast-expression
declaration-specifiers declarator = { initializer-list , multiplicative-expression
declaration-specifiers declarator = { initializer-list , additive-expression
declaration-specifiers declarator = { initializer-list , shift-expression
declaration-specifiers declarator = { initializer-list , relational-expression
declaration-specifiers declarator = { initializer-list , equality-expression
declaration-specifiers declarator = { initializer-list , AND-expression
declaration-specifiers declarator = { initializer-list , exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , logical-AND-expression
declaration-specifiers declarator = { initializer-list , logical-OR-expression
declaration-specifiers declarator = { initializer-list , conditional-expression
declaration-specifiers declarator = { initializer-list , assignment-expression
declaration-specifiers declarator = { initializer-list , initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: 1  

curr: 1  next: ,
declaration-specifiers declarator = { initializer-list , primary-expression
declaration-specifiers declarator = { initializer-list , postfix-expression
declaration-specifiers declarator = { initializer-list , unary-expression
declaration-specifiers declarator = { initializer-list , cast-expression
declaration-specifiers declarator = { initializer-list , multiplicative-expression
declaration-specifiers declarator = { initializer-list , additive-expression
declaration-specifiers declarator = { initializer-list , shift-expression
declaration-specifiers declarator = { initializer-list , relational-expression
declaration-specifiers declarator = { initializer-list , equality-expression
declaration-specifiers declarator = { initializer-list , AND-expression
declaration-specifiers declarator = { initializer-list , exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , logical-AND-expression
declaration-specifiers declarator = { initializer-list , logical-OR-expression
declaration-specifiers declarator = { initializer-list , conditional-expression
declaration-specifiers declarator = { initializer-list , assignment-expression
declaration-specifiers declarator = { initializer-list , initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: {  

curr: {  next: 1  

curr: 1  next: ,
declaration-specifiers declarator = { initializer-list , { primary-expression
declaration-specifiers declarator = { initializer-list , { postfix-expression
declaration-specifiers declarator = { initializer-list , { unary-expression
declaration-specifiers declarator = { initializer-list , { cast-expression
declaration-specifiers declarator = { initializer-list , { multiplicative-expression
declaration-specifiers declarator = { initializer-list , { additive-expression
declaration-specifiers declarator = { initializer-list , { shift-expression
declaration-specifiers declarator = { initializer-list , { relational-expression
declaration-specifiers declarator = { initializer-list , { equality-expression
declaration-specifiers declarator = { initializer-list , { AND-expression
declaration-specifiers declarator = { initializer-list , { exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { logical-AND-expression
declaration-specifiers declarator = { initializer-list , { logical-OR-expression
declaration-specifiers declarator = { initializer-list , { conditional-expression
declaration-specifiers declarator = { initializer-list , { assignment-expression
declaration-specifiers declarator = { initializer-list , { initializer
declaration-specifiers declarator = { initializer-list , { initializer-list 

curr: ,  next: 2  

curr: 2  next: }
declaration-specifiers declarator = { initializer-list , { initializer-list , primary-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , postfix-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , unary-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , cast-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , multiplicative-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , additive-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , shift-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , relational-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , equality-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , AND-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , logical-AND-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , logical-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , conditional-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , assignment-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , initializer
declaration-specifiers declarator = { initializer-list , { initializer-list 

curr: }  next: ,
declaration-specifiers declarator = { initializer-list , initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: 0  

curr: 0  next: ,
declaration-specifiers declarator = { initializer-list , primary-expression
declaration-specifiers declarator = { initializer-list , postfix-expression
declaration-specifiers declarator = { initializer-list , unary-expression
declaration-specifiers declarator = { initializer-list , cast-expression
declaration-specifiers declarator = { initializer-list , multiplicative-expression
declaration-specifiers declarator = { initializer-list , additive-expression
declaration-specifiers declarator = { initializer-list , shift-expression
declaration-specifiers declarator = { initializer-list , relational-expression
declaration-specifiers declarator = { initializer-list , equality-expression
declaration-specifiers declarator = { initializer-list , AND-expression
declaration-specifiers declarator = { initializer-list , exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , logical-AND-expression
declaration-specifiers declarator = { initializer-list , logical-OR-expression
declaration-specifiers declarator = { initializer-list , conditional-expression
declaration-specifiers declarator = { initializer-list , assignment-expression
declaration-specifiers declarator = { initializer-list , initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: 1  

curr: 1  next: ,
declaration-specifiers declarator = { initializer-list , primary-expression
declaration-specifiers declarator = { initializer-list , postfix-expression
declaration-specifiers declarator = { initializer-list , unary-expression
declaration-specifiers declarator = { initializer-list , cast-expression
declaration-specifiers declarator = { initializer-list , multiplicative-expression
declaration-specifiers declarator = { initializer-list , additive-expression
declaration-specifiers declarator = { initializer-list , shift-expression
declaration-specifiers declarator = { initializer-list , relational-expression
declaration-specifiers declarator = { initializer-list , equality-expression
declaration-specifiers declarator = { initializer-list , AND-expression
declaration-specifiers declarator = { initializer-list , exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , logical-AND-expression
declaration-specifiers declarator = { initializer-list , logical-OR-expression
declaration-specifiers declarator = { initializer-list , conditional-expression
declaration-specifiers declarator = { initializer-list , assignment-expression
declaration-specifiers declarator = { initializer-list , initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: {  

curr: {  next: 1  

curr: 1  next: ,
declaration-specifiers declarator = { initializer-list , { primary-expression
declaration-specifiers declarator = { initializer-list , { postfix-expression
declaration-specifiers declarator = { initializer-list , { unary-expression
declaration-specifiers declarator = { initializer-list , { cast-expression
declaration-specifiers declarator = { initializer-list , { multiplicative-expression
declaration-specifiers declarator = { initializer-list , { additive-expression
declaration-specifiers declarator = { initializer-list , { shift-expression
declaration-specifiers declarator = { initializer-list , { relational-expression
declaration-specifiers declarator = { initializer-list , { equality-expression
declaration-specifiers declarator = { initializer-list , { AND-expression
declaration-specifiers declarator = { initializer-list , { exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { logical-AND-expression
declaration-specifiers declarator = { initializer-list , { logical-OR-expression
declaration-specifiers declarator = { initializer-list , { conditional-expression
declaration-specifiers declarator = { initializer-list , { assignment-expression
declaration-specifiers declarator = { initializer-list , { initializer
declaration-specifiers declarator = { initializer-list , { initializer-list 

curr: ,  next: 2  

curr: 2  next: }
declaration-specifiers declarator = { initializer-list , { initializer-list , primary-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , postfix-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , unary-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , cast-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , multiplicative-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , additive-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , shift-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , relational-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , equality-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , AND-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , logical-AND-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , logical-OR-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , conditional-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , assignment-expression
declaration-specifiers declarator = { initializer-list , { initializer-list , initializer
declaration-specifiers declarator = { initializer-list , { initializer-list 

curr: }  next: ,
declaration-specifiers declarator = { initializer-list , initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: 0  

curr: 0  next: ,
declaration-specifiers declarator = { initializer-list , primary-expression
declaration-specifiers declarator = { initializer-list , postfix-expression
declaration-specifiers declarator = { initializer-list , unary-expression
declaration-specifiers declarator = { initializer-list , cast-expression
declaration-specifiers declarator = { initializer-list , multiplicative-expression
declaration-specifiers declarator = { initializer-list , additive-expression
declaration-specifiers declarator = { initializer-list , shift-expression
declaration-specifiers declarator = { initializer-list , relational-expression
declaration-specifiers declarator = { initializer-list , equality-expression
declaration-specifiers declarator = { initializer-list , AND-expression
declaration-specifiers declarator = { initializer-list , exclusive-OR-expression
declaration-specifiers declarator = { initializer-list , inclusive-OR-expression
declaration-specifiers declarator = { initializer-list , logical-AND-expression
declaration-specifiers declarator = { initializer-list , logical-OR-expression
declaration-specifiers declarator = { initializer-list , conditional-expression
declaration-specifiers declarator = { initializer-list , assignment-expression
declaration-specifiers declarator = { initializer-list , initializer
declaration-specifiers declarator = { initializer-list 

curr: ,  next: }  

curr: }  next: ;
declaration-specifiers declarator = initializer
declaration-specifiers init-declarator
declaration-specifiers init-declarator-list 

curr: ;  next: struct
declaration
declaration-list 

curr: struct  next: a  

curr: b  next: ID
declaration-list struct-specifier
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ID  next: [
declaration-list declaration-specifiers direct-declarator 

curr: [  next: 4  

curr: 4  next: ]
declaration-list declaration-specifiers direct-declarator [ primary-expression
declaration-list declaration-specifiers direct-declarator [ postfix-expression
declaration-list declaration-specifiers direct-declarator [ unary-expression
declaration-list declaration-specifiers direct-declarator [ cast-expression
declaration-list declaration-specifiers direct-declarator [ multiplicative-expression
declaration-list declaration-specifiers direct-declarator [ additive-expression
declaration-list declaration-specifiers direct-declarator [ shift-expression
declaration-list declaration-specifiers direct-declarator [ relational-expression
declaration-list declaration-specifiers direct-declarator [ equality-expression
declaration-list declaration-specifiers direct-declarator [ AND-expression
declaration-list declaration-specifiers direct-declarator [ exclusive-OR-expression
declaration-list declaration-specifiers direct-declarator [ inclusive-OR-expression
declaration-list declaration-specifiers direct-declarator [ logical-AND-expression
declaration-list declaration-specifiers direct-declarator [ logical-OR-expression
declaration-list declaration-specifiers direct-declarator [ conditional-expression
declaration-list declaration-specifiers direct-declarator [ assignment-expression 

curr: ]  next: =
declaration-list declaration-specifiers direct-declarator
declaration-list declaration-specifiers declarator 

curr: =  next: {  

curr: {  next: .  

curr: .  next: b  

curr: ID  next: =
declaration-list declaration-specifiers declarator = { designator
declaration-list declaration-specifiers declarator = { designator-list 

curr: =  next: 0
declaration-list declaration-specifiers declarator = { designation 

curr: 0  next: ,
declaration-list declaration-specifiers declarator = { designation primary-expression
declaration-list declaration-specifiers declarator = { designation postfix-expression
declaration-list declaration-specifiers declarator = { designation unary-expression
declaration-list declaration-specifiers declarator = { designation cast-expression
declaration-list declaration-specifiers declarator = { designation multiplicative-expression
declaration-list declaration-specifiers declarator = { designation additive-expression
declaration-list declaration-specifiers declarator = { designation shift-expression
declaration-list declaration-specifiers declarator = { designation relational-expression
declaration-list declaration-specifiers declarator = { designation equality-expression
declaration-list declaration-specifiers declarator = { designation AND-expression
declaration-list declaration-specifiers declarator = { designation exclusive-OR-expression
declaration-list declaration-specifiers declarator = { designation inclusive-OR-expression
declaration-list declaration-specifiers declarator = { designation logical-AND-expression
declaration-list declaration-specifiers declarator = { designation logical-OR-expression
declaration-list declaration-specifiers declarator = { designation conditional-expression
declaration-list declaration-specifiers declarator = { designation assignment-expression
declaration-list declaration-specifiers declarator = { designation initializer
declaration-list declaration-specifiers declarator = { initializer-list 

curr: ,  next: .  

curr: .  next: me  

curr: ID  next: =
declaration-list declaration-specifiers declarator = { initializer-list , designator
declaration-list declaration-specifiers declarator = { initializer-list , designator-list 

curr: =  next: {
declaration-list declaration-specifiers declarator = { initializer-list , designation 

curr: {  next: .  

curr: .  next: ch  

curr: ID  next: =
declaration-list declaration-specifiers declarator = { initializer-list , designation { designator
declaration-list declaration-specifiers declarator = { initializer-list , designation { designator-list 

curr: =  next: a
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation 

curr: ID  next: ,
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation primary-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation postfix-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation unary-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation cast-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation multiplicative-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation additive-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation shift-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation relational-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation equality-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation exclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation inclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation logical-AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation logical-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation conditional-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation assignment-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { designation initializer
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list 

curr: ,  next: .  

curr: .  next: id  

curr: ID  next: =
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designator
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designator-list 

curr: =  next: 0
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation 

curr: 0  next: ,
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation primary-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation postfix-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation unary-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation cast-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation multiplicative-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation additive-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation shift-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation relational-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation equality-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation exclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation inclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation logical-AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation logical-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation conditional-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation assignment-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list , designation initializer
declaration-list declaration-specifiers declarator = { initializer-list , designation { initializer-list 

curr: ,  next: }  

curr: }  next: ,
declaration-list declaration-specifiers declarator = { initializer-list , designation initializer
declaration-list declaration-specifiers declarator = { initializer-list 

curr: ,  next: .  

curr: .  next: c  

curr: ID  next: .
declaration-list declaration-specifiers declarator = { initializer-list , designator
declaration-list declaration-specifiers declarator = { initializer-list , designator-list 

curr: .  next: d  

curr: ID  next: .
declaration-list declaration-specifiers declarator = { initializer-list , designator-list designator
declaration-list declaration-specifiers declarator = { initializer-list , designator-list 

curr: .  next: e  

curr: ID  next: =
declaration-list declaration-specifiers declarator = { initializer-list , designator-list designator
declaration-list declaration-specifiers declarator = { initializer-list , designator-list 

curr: =  next: 1
declaration-list declaration-specifiers declarator = { initializer-list , designation 

curr: 1  next: ,
declaration-list declaration-specifiers declarator = { initializer-list , designation primary-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation postfix-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation unary-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation cast-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation multiplicative-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation additive-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation shift-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation relational-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation equality-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation exclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation inclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation logical-AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation logical-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation conditional-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation assignment-expression
declaration-list declaration-specifiers declarator = { initializer-list , designation initializer
declaration-list declaration-specifiers declarator = { initializer-list 

curr: ,  next: }  

curr: }  next: ;
declaration-list declaration-specifiers declarator = initializer
declaration-list declaration-specifiers init-declarator
declaration-list declaration-specifiers init-declarator-list 

curr: ;  next: union
declaration-list declaration
declaration-list 

curr: union  next: c  

curr: ID  next: {  

curr: {  next: int  

curr: int  next: i
declaration-list union ID { type-specifier
declaration-list union ID { specifier-qualifier-list 

curr: ID  next: ;
declaration-list union ID { specifier-qualifier-list direct-declarator
declaration-list union ID { specifier-qualifier-list declarator
declaration-list union ID { specifier-qualifier-list struct-declarator-list 

curr: ;  next: char
declaration-list union ID { struct-declaration
declaration-list union ID { struct-declaration-list 

curr: char  next: ch
declaration-list union ID { struct-declaration-list type-specifier
declaration-list union ID { struct-declaration-list specifier-qualifier-list 

curr: ID  next: ;
declaration-list union ID { struct-declaration-list specifier-qualifier-list direct-declarator
declaration-list union ID { struct-declaration-list specifier-qualifier-list declarator
declaration-list union ID { struct-declaration-list specifier-qualifier-list struct-declarator-list 

curr: ;  next: }
declaration-list union ID { struct-declaration-list struct-declaration
declaration-list union ID { struct-declaration-list 

curr: }  next: age_sex
declaration-list union-specifier
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ID  next: [
declaration-list declaration-specifiers direct-declarator 

curr: [  next: 5  

curr: 5  next: ]
declaration-list declaration-specifiers direct-declarator [ primary-expression
declaration-list declaration-specifiers direct-declarator [ postfix-expression
declaration-list declaration-specifiers direct-declarator [ unary-expression
declaration-list declaration-specifiers direct-declarator [ cast-expression
declaration-list declaration-specifiers direct-declarator [ multiplicative-expression
declaration-list declaration-specifiers direct-declarator [ additive-expression
declaration-list declaration-specifiers direct-declarator [ shift-expression
declaration-list declaration-specifiers direct-declarator [ relational-expression
declaration-list declaration-specifiers direct-declarator [ equality-expression
declaration-list declaration-specifiers direct-declarator [ AND-expression
declaration-list declaration-specifiers direct-declarator [ exclusive-OR-expression
declaration-list declaration-specifiers direct-declarator [ inclusive-OR-expression
declaration-list declaration-specifiers direct-declarator [ logical-AND-expression
declaration-list declaration-specifiers direct-declarator [ logical-OR-expression
declaration-list declaration-specifiers direct-declarator [ conditional-expression
declaration-list declaration-specifiers direct-declarator [ assignment-expression 

curr: ]  next: =
declaration-list declaration-specifiers direct-declarator
declaration-list declaration-specifiers declarator 

curr: =  next: {  

curr: {  next: 1  

curr: 1  next: ,
declaration-list declaration-specifiers declarator = { primary-expression
declaration-list declaration-specifiers declarator = { postfix-expression
declaration-list declaration-specifiers declarator = { unary-expression
declaration-list declaration-specifiers declarator = { cast-expression
declaration-list declaration-specifiers declarator = { multiplicative-expression
declaration-list declaration-specifiers declarator = { additive-expression
declaration-list declaration-specifiers declarator = { shift-expression
declaration-list declaration-specifiers declarator = { relational-expression
declaration-list declaration-specifiers declarator = { equality-expression
declaration-list declaration-specifiers declarator = { AND-expression
declaration-list declaration-specifiers declarator = { exclusive-OR-expression
declaration-list declaration-specifiers declarator = { inclusive-OR-expression
declaration-list declaration-specifiers declarator = { logical-AND-expression
declaration-list declaration-specifiers declarator = { logical-OR-expression
declaration-list declaration-specifiers declarator = { conditional-expression
declaration-list declaration-specifiers declarator = { assignment-expression
declaration-list declaration-specifiers declarator = { initializer
declaration-list declaration-specifiers declarator = { initializer-list 

curr: ,  next: 2  

curr: 2  next: ,
declaration-list declaration-specifiers declarator = { initializer-list , primary-expression
declaration-list declaration-specifiers declarator = { initializer-list , postfix-expression
declaration-list declaration-specifiers declarator = { initializer-list , unary-expression
declaration-list declaration-specifiers declarator = { initializer-list , cast-expression
declaration-list declaration-specifiers declarator = { initializer-list , multiplicative-expression
declaration-list declaration-specifiers declarator = { initializer-list , additive-expression
declaration-list declaration-specifiers declarator = { initializer-list , shift-expression
declaration-list declaration-specifiers declarator = { initializer-list , relational-expression
declaration-list declaration-specifiers declarator = { initializer-list , equality-expression
declaration-list declaration-specifiers declarator = { initializer-list , AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , exclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , inclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , logical-AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , logical-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , conditional-expression
declaration-list declaration-specifiers declarator = { initializer-list , assignment-expression
declaration-list declaration-specifiers declarator = { initializer-list , initializer
declaration-list declaration-specifiers declarator = { initializer-list 

curr: ,  next: 3  

curr: 3  next: ,
declaration-list declaration-specifiers declarator = { initializer-list , primary-expression
declaration-list declaration-specifiers declarator = { initializer-list , postfix-expression
declaration-list declaration-specifiers declarator = { initializer-list , unary-expression
declaration-list declaration-specifiers declarator = { initializer-list , cast-expression
declaration-list declaration-specifiers declarator = { initializer-list , multiplicative-expression
declaration-list declaration-specifiers declarator = { initializer-list , additive-expression
declaration-list declaration-specifiers declarator = { initializer-list , shift-expression
declaration-list declaration-specifiers declarator = { initializer-list , relational-expression
declaration-list declaration-specifiers declarator = { initializer-list , equality-expression
declaration-list declaration-specifiers declarator = { initializer-list , AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , exclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , inclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , logical-AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , logical-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , conditional-expression
declaration-list declaration-specifiers declarator = { initializer-list , assignment-expression
declaration-list declaration-specifiers declarator = { initializer-list , initializer
declaration-list declaration-specifiers declarator = { initializer-list 

curr: ,  next: 4  

curr: 4  next: ,
declaration-list declaration-specifiers declarator = { initializer-list , primary-expression
declaration-list declaration-specifiers declarator = { initializer-list , postfix-expression
declaration-list declaration-specifiers declarator = { initializer-list , unary-expression
declaration-list declaration-specifiers declarator = { initializer-list , cast-expression
declaration-list declaration-specifiers declarator = { initializer-list , multiplicative-expression
declaration-list declaration-specifiers declarator = { initializer-list , additive-expression
declaration-list declaration-specifiers declarator = { initializer-list , shift-expression
declaration-list declaration-specifiers declarator = { initializer-list , relational-expression
declaration-list declaration-specifiers declarator = { initializer-list , equality-expression
declaration-list declaration-specifiers declarator = { initializer-list , AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , exclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , inclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , logical-AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , logical-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , conditional-expression
declaration-list declaration-specifiers declarator = { initializer-list , assignment-expression
declaration-list declaration-specifiers declarator = { initializer-list , initializer
declaration-list declaration-specifiers declarator = { initializer-list 

curr: ,  next: 5  

curr: 5  next: }
declaration-list declaration-specifiers declarator = { initializer-list , primary-expression
declaration-list declaration-specifiers declarator = { initializer-list , postfix-expression
declaration-list declaration-specifiers declarator = { initializer-list , unary-expression
declaration-list declaration-specifiers declarator = { initializer-list , cast-expression
declaration-list declaration-specifiers declarator = { initializer-list , multiplicative-expression
declaration-list declaration-specifiers declarator = { initializer-list , additive-expression
declaration-list declaration-specifiers declarator = { initializer-list , shift-expression
declaration-list declaration-specifiers declarator = { initializer-list , relational-expression
declaration-list declaration-specifiers declarator = { initializer-list , equality-expression
declaration-list declaration-specifiers declarator = { initializer-list , AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , exclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , inclusive-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , logical-AND-expression
declaration-list declaration-specifiers declarator = { initializer-list , logical-OR-expression
declaration-list declaration-specifiers declarator = { initializer-list , conditional-expression
declaration-list declaration-specifiers declarator = { initializer-list , assignment-expression
declaration-list declaration-specifiers declarator = { initializer-list , initializer
declaration-list declaration-specifiers declarator = { initializer-list 

curr: }  next: ;
declaration-list declaration-specifiers declarator = initializer
declaration-list declaration-specifiers init-declarator
declaration-list declaration-specifiers init-declarator-list 

curr: ;  next: enum
declaration-list declaration
declaration-list 

curr: enum  next: {  

curr: {  next: WOMEN  

curr: ID  next: =
declaration-list enum { enumeration-constant 

curr: =  next: 1  

curr: 1  next: ,
declaration-list enum { enumeration-constant = primary-expression
declaration-list enum { enumeration-constant = postfix-expression
declaration-list enum { enumeration-constant = unary-expression
declaration-list enum { enumeration-constant = cast-expression
declaration-list enum { enumeration-constant = multiplicative-expression
declaration-list enum { enumeration-constant = additive-expression
declaration-list enum { enumeration-constant = shift-expression
declaration-list enum { enumeration-constant = relational-expression
declaration-list enum { enumeration-constant = equality-expression
declaration-list enum { enumeration-constant = AND-expression
declaration-list enum { enumeration-constant = exclusive-OR-expression
declaration-list enum { enumeration-constant = inclusive-OR-expression
declaration-list enum { enumeration-constant = logical-AND-expression
declaration-list enum { enumeration-constant = logical-OR-expression
declaration-list enum { enumeration-constant = conditional-expression
declaration-list enum { enumeration-constant = constant-expression
declaration-list enum { enumerator
declaration-list enum { enumerator-list 

curr: ,  next: MAN  

curr: ID  next: ,
declaration-list enum { enumerator-list , enumeration-constant
declaration-list enum { enumerator-list , enumerator
declaration-list enum { enumerator-list 

curr: ,  next: CHILD  

curr: ID  next: }
declaration-list enum { enumerator-list , enumeration-constant
declaration-list enum { enumerator-list , enumerator
declaration-list enum { enumerator-list 

curr: }  next: ;
declaration-list enum-specifier
declaration-list type-specifier
declaration-list declaration-specifiers 

curr: ;  next: NULL
declaration-list declaration
declaration-list
translation-unit 

下文:数组和指针

时间: 2024-12-16 21:09:07

C语法归约之变量声明和定义(0)的相关文章

内存四域,变量声明和定义,寄存器,c内嵌汇编,auto,堆栈,常量,静态变量

 1.内存四大区域 2.在程序中,变量的声明可以有多份,定义只能有一份 3.寄存器在cpu里面,没有地址 4.c语言内嵌汇编语言 5.auto变量 自动分配内存,自动释放内存. 6.栈的大小由编译器决定 修改栈的方式,右击项目à属性à配置属性à链接器à系统à堆栈保留大小 7.卡死cpu,卡死内存的程序 8.在堆上申请空间后赋值后,不可以释放内容.要通过free方法进行释放对空间. 9.常量字符串在代码区.代码区是智能读的. 10.常量本质 10.静态变量,全局变量的差别 A全局变量可以跨文件

变量声明和定义的区别

我们在程序设计中,时时刻刻都用到变量的定义和变量的声明,可有些时候我们对这个概念不是很清楚,知道它是怎么用,但却不知是怎么一会事,下面我就简单的把他们的区别介绍如下:(望我的指点对你受益) 变量的声明有两种情况: 1.一种是需要建立存储空间的.例如:int a 在声明的时候就已经建立了存储空间. 2.另一种是不需要建立存储空间的. 例如:extern int a 其中变量a是在别的文件中定义的. 前者是“定义性声明(defining declaration)”或者称为“定义(definition

【C++注意事项】2 变量声明和定义

不可能将所有的C++程序放到一个文件中咯,因此C++就支持了分离式编译(separate compilation)机制,它允许将程序分为若干个文件,每个文件可被独立编译.这样说明了,当你的程序有很多文件时,修改其中一个文件后不需要将所有文件都重新编译一遍,只需要编译修改过的就好,然后将它们都链接起来. C++是如何支持分离式编译的呢?通过将声明和定义分离开来. 声明(declaration)使得名字为程序所知,一个文件如果想使用别处定义的名字则必须包含该名字的声明. 定义(definition)

变量声明和定义的关系

extern int i;    //声明i而非定义i int j;        //声明并定义j 任何包含了显示初始化的声明即成为定义.我们能由extern关键字标记的变量赋一个初始值,但是这么做也就抵消了extern的作用.extern语句如果包含初始值就不再是声明,而变成定义了: extern double pi = 3.1416;    //定义 在函数体内部,如果试图初始化一个由extern关键字标记的变量,将引发错误. Note:变量能且只能被定义一次,但是可以被多次声明

C++ Prime:变量声明和定义的关系

为了允许把程序拆分为多个逻辑部分来编写,C++语言支持分离式编译机制,允许将程序分割为若干个文件,每个文件可以独立编译. 为了支持分离式编译,C++将声明和定义区分开.声明使得名字为程序所知,一个文件如果想使用别处定义的名字必须包含对那个名字的声明.定义则负责创建与名字关联的实体. 变量声明规定了变量的类型和名字,定义还额外的申请储存空间,也可能会为变量赋一个初值. 想声明一个变量而不是定义它,在变量名之前添加关键字extern,而且不要显示地初始化变量: extern int i; // 声明

变量声明与定义的区别

本质区别在于是否分配内存.int a; 在声明的时候就已经建立了存储空间,所以既是声明又是定义extern int a; a是在别的文件中定义的,所以这里仅是声明类中的变量只是声明而不是定义,只有在实例化以后才会分配内存.EnclosingClass jb; //声明jb = new EnclosingClass(); //定义

变量声明和定义

一.由来 C++支持分离式编译机制,该机制允许将程序分为若干个文件,每个文件可被独立编译. 如果将程序分为多个文件,则需要有在文件间共享代码的方法. 为了支持分离式编译,C++语言将声明和定义区分开来. 二.区别 声明使得名字为程序所熟知,一个文件如果想用别处定义得到名字则必须包含对那个名字的声明.变量声明规定了变量的类型和名字 extern int i ; //声明 i 而非定义 i 定义负责创建与名字关联的实体.定义除了要规定变量的类型和名字,还申请存储空间,也可能会为变量赋一个初始值. i

C++11类内static成员变量声明与定义

众所周知,将一个类内的某个成员变量声明为static型,可以使得该类实例化得到的对象实现对象间数据共享. 在C++中,通常将一个类的声明写在头文件中,将这个类的具体定义(实现)写在cpp源文件中. 因此,就引出了static成员变量的声明与定义问题: 1. 如果一个类内成员变量是static的,且需要将之设定为常量(const),那么这个变量声明与初始化均可写在头文件内. 举个例子: 1 // Scanner.hpp 2 class Scanner { 3 public: 4 const sta

C++ 变量的声明与定义的区别

变量声明和定义的区别 我们在程序设计中,时时刻刻都用到变量的定义和变量的声明,可有些时候我们对这个概念不是很清楚,知道它是怎么用,但却不知是怎么一会事,下面我就简单的把他们的区别介绍如下:(望我的指点对你受益) 变量的声明有两种情况: 1.一种是需要建立存储空间的.例如:int a 在声明的时候就已经建立了存储空间. 2.另一种是不需要建立存储空间的. 例如:extern int a 其中变量a是在别的文件中定义的. 前者是“定义性声明(defining declaration)”或者称为“定义