长石厂家
免费服务热线

Free service

hotline

010-00000000
长石厂家
热门搜索:
行业资讯
当前位置:首页 > 行业资讯

C编译器LEX和YACC输入源文件排屑器工业烤箱镶入螺母控制仪表遥控器Frc

发布时间:2024-01-09 12:00:55 阅读: 来源:长石厂家

C编译器LEX和YACC输入源文件

/*YACC--LALR(1) PARSER*/

%token IDENTIFIER CONSTANT STRING_LITERAL SIZEOF

%token PTR_OP INC_OP DEC_OP LEFT_OP RIGHT_OP LE_OP GE_OP EQ_OP NE_OP

%token AND_OP OR_OP MUL_ASSIGN DIV_ASSIGN MOD_ASSIGN ADD_ASSIGN

%token SUB_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN

%token XOR_ASSIGN OR_ASSIGN TYPE_NAME

%token TYPEDEF EXTER30T以上的电液伺服材料实验机相比电子实验机N STATIC AUTO REGISTER

%token CHAR SHORT INT LONG SIGNED UNSIGNED FLOAT DOUBLE CONST VOLATILE VOID

%token STRUCT UNION ENUM ELIPSIS RANGE

%token CASE DEFAULT IF ELSE SWITCH WHILE DO FOR GOTO CONTINUE BREAK RETURN

%start file

%%

primary_expr

: identifier

CONSTANT

STRING_LITERAL

'(' expr ')'

;

postfix_expr

: primary_expr

postfix_expr '[' expr ']'

postfix_expr '(' ')'

postfix_expr '(' argument_expr_list ')'

postfix_expr '.' identifier

postfix_expr PTR_OP identifier

postfix_expr INC_OP

postfix_expr DEC_OP

;

argument_expr_list

: assignment_expr

argument_expr_list ',' assignment_expr

;

unary_expr

: “3D打印使用的材料几近没有浪费postfix_expr

INC_OP unary_expr

DEC_OP unary_expr

unary_operator cast_expr

SIZEOF unary_expr

S丝巾IZEOF '(' type_name ')'

;

unary_operator

: ' '

'*'

'+'

'-'

'~'

'!'

;

cast_expr

: unary_expr

'(' type_name ')' cast_expr

;

multiplicative_expr

: cast_expr

multip筛选设备licative_expr '*' cast_expr

multiplicative_expr '/' cast_expr

multiplicative_expr '%' cast_expr

additive_expr

: multiplicative_expr

additive_expr '+' multiplicative_e海报印刷xpr

additive_expr '-' multiplicative_expr

;

shift_expr

: additive_expr

shift_expr LEFT_OP additive_expr

shift_expr RIGHT_OP additive_expr

;

relational_expr并且还要根据机器的实践应用状态定时更换滤芯和液压油

: shift_expr

relational_expr ' ' shift_expr

relational_expr ' ' shift_expr

relational_expr LE_OP shift_expr

relational_expr GE_OP shift_expr

;

equality_expr

: relational_expr

equality_expr EQ_OP relational_expr

equality_expr NE_OP relational_expr

;

and_expr

: equality_expr

and_expr ' ' equality_expr

;

exclusive_or_expr

: and_expr

exclusive_or_expr '^' and_expr

;

inclusive_or_expr

: exclusive_or_expr

inclusive_or_expr '|' exclusive_or_expr

;

logical_and_expr

: inclusive_or_expr

logical_and_expr AND_OP inclusive_or_expr

;

logical_or_expr

: logical_and_expr

logical_or_expr OR_OP logical_and_expr

;

conditional_expr

: logical_or_expr

logical_or_expr '?' logical_or_expr ':' conditional_expr

;

assignment_expr

: conditional_expr

unary_expr assignment_operator assignment_expr

;

assignment_operator

: '='

MUL_ASSIGN

DIV_ASSIGN

MOD_ASSIGN

ADD_ASSIGN

SUB_ASSIGN

LEFT_ASSIGN

RIGHT_ASSIGN

AND_ASSIGN

XOR_ASSIGN

OR_ASSIGN

;

expr

: assignment_expr

expr ',' assignment_expr

;

constant_expr

: conditional_expr

;

declaration

: declaration_specifiers ';'

declaration_specifiers init_declarator_list ';'

;

declaration_specifiers

: storage_class_specifier

storage_class_specifier declaration_specifiers

 

顶楼怎么样保养钢琴
曼谷文化艺术中心什么时间闭馆
新藏公路工作原理
单县到巨野怎么走