50 |
{ |
{ |
51 |
char *muscle; |
char *muscle; |
52 |
char *string; |
char *string; |
53 |
|
char *literal; |
54 |
char character; |
char character; |
55 |
int yacc; |
int yacc; |
56 |
} |
} |
57 |
|
|
58 |
|
/* Name of a muscle. */ |
59 |
%token <muscle> MUSCLE |
%token <muscle> MUSCLE |
60 |
|
/* A string dedicated to Bison (%%"foo"). */ |
61 |
%token <string> STRING |
%token <string> STRING |
62 |
|
/* Raw data, to output directly. */ |
63 |
|
%token <literal> RAW |
64 |
|
/* Spaces. */ |
65 |
|
%token <literal> BLANKS |
66 |
|
/* Raw data, but char by char. */ |
67 |
%token <character> CHARACTER |
%token <character> CHARACTER |
68 |
|
|
69 |
%token LINE |
%token LINE |
89 |
section : section.header section.body { } |
section : section.header section.body { } |
90 |
; |
; |
91 |
|
|
92 |
section.header : SECTION gb MUSCLE gb STRING gb section.yacc gb '\n' |
section.header : SECTION BLANKS MUSCLE BLANKS STRING BLANKS section.yacc '\n' |
93 |
{ |
{ |
94 |
char *name = 0; |
char *name = 0; |
95 |
char *limit = 0; |
char *limit = 0; |
148 |
| section.body TOKENS { token_definitions_output (parser, &output_line); } |
| section.body TOKENS { token_definitions_output (parser, &output_line); } |
149 |
| section.body ACTIONS { actions_output (parser, &output_line); } |
| section.body ACTIONS { actions_output (parser, &output_line); } |
150 |
| section.body CHARACTER { fputc ($2, parser); } |
| section.body CHARACTER { fputc ($2, parser); } |
151 |
|
| section.body RAW { fputs ($2, parser); } |
152 |
|
| section.body BLANKS { fputs ($2, parser); } |
153 |
| section.body MUSCLE { |
| section.body MUSCLE { |
154 |
const char* value = muscle_find ($2); |
const char* value = muscle_find ($2); |
155 |
if (value) |
if (value) |
164 |
} |
} |
165 |
} |
} |
166 |
; |
; |
|
|
|
|
gb : /* Empty. */ { } |
|
|
| gb CHARACTER { /* Do not echo garbage characters. */ } |
|
|
; |
|
|
|
|
167 |
%% |
%% |
168 |
|
|
169 |
static int |
static int |