parser.y
来自「一个开源的JAVA虚拟机」· Y 代码 · 共 75 行
Y
75 行
%{#include <jpr/type.h>#include "globals.h"%}%defines%union{ const char *utf8; ju2 index;}%token TOK_ATTRIBUTE%token <utf8> TOK_UTF8%token TOK_CONSTANT%token TOK_CLASS%token TOK_FIELD%token TOK_METHOD%token TOK_LBRACKET%token TOK_RBRACKET%token <index> TOK_INDEX%type <index> constant_id%type <index> field_id%type <index> method_id%start input%%input: declarations class_annotation constant_annotations field_annotations method_annotations;declarations: attribute_declaration;attribute_declaration : TOK_ATTRIBUTE TOK_UTF8 { define_attribute_name($2); };class_annotation: /* empty */| TOK_CLASS TOK_UTF8 { define_class_annotation($2); };constant_annotations: /* empty */| constant_annotation constant_annotations;constant_annotation : TOK_CONSTANT constant_id TOK_UTF8 { define_constant_annotation($2, $3); };constant_id : TOK_LBRACKET TOK_INDEX TOK_RBRACKET { $$ = $2; };field_annotations: /* empty */| field_annotation field_annotations;field_annotation : TOK_FIELD field_id TOK_UTF8 { define_field_annotation($2, $3); };field_id : TOK_LBRACKET TOK_INDEX TOK_RBRACKET { $$ = $2; };method_annotations: /* empty */| method_annotation method_annotations;method_annotation : TOK_METHOD method_id TOK_UTF8 { define_method_annotation($2, $3); };method_id : TOK_LBRACKET TOK_INDEX TOK_RBRACKET { $$ = $2; };%%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?