编译原理 第六章 上机辅导.pptVIP

  • 10
  • 0
  • 约1.3万字
  • 约 52页
  • 2017-09-10 发布于湖北
  • 举报
* 3.3 语法分析器 table:IDENTIFIER { $$=$1; }; fieldsdefinition:field_type { $$=$1; cfdef_end=$1; } |fieldsdefinition , field_type { $$=$1; cfdef_end-next_fdef=$3; cfdef_end=$3; }; * 3.3 语法分析器 field_type:field type { $$=(_createfieldsdef_type *)malloc( sizeof(_createfieldsdef_type)); $$-field=$1; if (strlen($2)==0) /*表示类型为int的时候,用INT表示类型,长度定为4*/ { $$-type=INT; $$-length=4; $$-next_fdef=NULL; } * 3.3 语法分析器 else /*类型为CHAR:用CHAR表示类型,长度定为$2*/ {$$-type=CHAR; $$-length=atoi($2);

文档评论(0)

1亿VIP精品文档

相关文档