Annotation of parser3/src/main/compile.y, revision 1.28
1.24 paf 1: /*
1.28 ! paf 2: $Id: compile.y,v 1.27 2001/02/23 12:37:58 paf Exp $
1.24 paf 3: */
4:
1.1 paf 5: %{
1.9 paf 6: #define YYSTYPE Array/*<op>*/ *
7: #define YYPARSE_PARAM pc
8: #define YYLEX_PARAM pc
9: #define YYDEBUG 1
1.1 paf 10: #define YYERROR_VERBOSE
1.9 paf 11: #define yyerror(msg) real_yyerror((parse_control *)pc, msg)
12: #define YYPRINT(file, type, value) yyprint(file, type, value)
1.1 paf 13:
14: #include <stdio.h>
15: #include <string.h>
16: #include <stdlib.h>
17:
18: #include "compile_tools.h"
1.8 paf 19: #include "pa_value.h"
1.12 paf 20: #include "pa_request.h"
1.1 paf 21:
1.9 paf 22: int real_yyerror(parse_control *pc, char *s);
23: static void yyprint(FILE *file, int type, YYSTYPE value);
1.1 paf 24: int yylex(YYSTYPE *lvalp, void *pc);
25:
26:
1.8 paf 27: // local convinient inplace typecast & var
1.9 paf 28: #define PC ((parse_control *)pc)
1.25 paf 29: #define POOL *PC->pool
30: #undef NEW
31: #define NEW new(POOL)
1.1 paf 32: %}
33:
34: %pure_parser
35:
1.13 paf 36: %token EON
1.4 paf 37: %token STRING
1.1 paf 38: %token BOGUS
39:
40: %%
41:
1.10 paf 42: all:
43: one_big_piece {
1.25 paf 44: String& name_main=*NEW String(POOL);
1.11 paf 45: name_main.APPEND_CONST(MAIN_METHOD_NAME);
1.25 paf 46: Array& param_names=*NEW Array(POOL);
47: Array& local_names=*NEW Array(POOL);
48: Method *method=NEW Method(POOL, name_main, param_names, local_names, *$1);
1.8 paf 49: *PC->methods+=method;
1.10 paf 50: }
51: | methods;
52:
53: methods: method | methods method;
54: one_big_piece: maybe_codes;
55:
56: method: '@' STRING bracketed_maybe_strings maybe_bracketed_strings maybe_comment '\n'
57: maybe_codes {
58: const String *name=LA2S($2);
59:
60: YYSTYPE params_names_code=$3;
1.25 paf 61: Array& params_names=*NEW Array(POOL);
1.10 paf 62: for(int i=0; i<params_names_code->size(); i+=2)
63: params_names+=LA2S(params_names_code, i);
64:
65: YYSTYPE locals_names_code=$4;
1.25 paf 66: Array& locals_names=*NEW Array(POOL);
1.10 paf 67: for(int i=0; i<locals_names_code->size(); i+=2)
68: locals_names+=LA2S(locals_names_code, i);
69:
1.25 paf 70: Method *method=NEW Method(POOL, *name, params_names, locals_names, *$7);
1.10 paf 71: *PC->methods+=method;
1.8 paf 72: };
1.10 paf 73:
74: maybe_bracketed_strings: empty | bracketed_maybe_strings;
75: bracketed_maybe_strings: '[' maybe_strings ']' {$$=$2};
76: maybe_strings: empty | strings;
77: strings: STRING | strings ';' STRING { $$=$1; P($$, $3) };
78:
79: maybe_comment: empty | STRING;
1.1 paf 80:
81: /* codes */
82:
1.10 paf 83: maybe_codes: empty | codes;
84:
1.1 paf 85: codes: code | codes code {
86: $$=$1;
1.9 paf 87: P($$, $2);
1.1 paf 88: };
89: code: write_str_literal | action;
90: action: get | put | with | call;
91:
92: /* get */
93:
94: get: '$' any_name {
95: $$=$2; /* stack: resulting value */
1.17 paf 96: OP($$, OP_WRITE); /* value=pop; write(value) */
1.1 paf 97: };
98:
1.13 paf 99: any_name: name_without_curly_rdive EON | name_in_curly_rdive;
1.1 paf 100:
101: name_in_curly_rdive: '{' name_without_curly_rdive '}' { $$=$2 };
1.19 paf 102: name_without_curly_rdive: name_without_curly_rdive_read | name_without_curly_rdive_root;
103: name_without_curly_rdive_read: name_without_curly_rdive_code {
1.25 paf 104: $$=N(POOL);
1.22 paf 105: Array *diving_code=$1;
106: String *first_name=LA2S(diving_code);
1.23 paf 107: if(first_name && *first_name==SELF_NAME) {
1.22 paf 108: OP($$, OP_WITH_SELF); /* stack: starting context */
109: P($$, diving_code,
110: /* skip over... */
111: diving_code->size()>2?3/*OP_+string+get_element*/:2/*OP_+string*/);
112: } else {
113: OP($$, OP_WITH_READ); /* stack: starting context */
114: P($$, diving_code);
115: }
116: /* diving code; stack: current context */
1.1 paf 117: };
1.19 paf 118: name_without_curly_rdive_root: ':' name_without_curly_rdive_code {
1.25 paf 119: $$=N(POOL);
1.19 paf 120: OP($$, OP_WITH_ROOT); /* stack: starting context */
121: P($$, $2); /* diving code; stack: current context */
122: };
123: name_without_curly_rdive_code: name_advance2 | name_path name_advance2 { $$=$1; P($$, $2) };
1.1 paf 124:
125: /* put */
126:
1.28 ! paf 127: put: '$' name_expr_wdive '(' constructor_value ')' {
1.1 paf 128: /*
129: TODO: подсмотреть в $3, и если там первым элементом self,
1.23 paf 130: то выкинуть его и делать не WITH_WRITE, а WITH_SELF
1.1 paf 131: если ничего не осталось - $self(xxx)
132: обругать
133: */
1.20 paf 134: $$=$2; /* stack: context,name */
135: P($$, $4); /* stack: context,name,constructor_value */
136: OP($$, OP_CONSTRUCT); /* value=pop; name=pop; context=pop; construct(context,name,value) */
137: };
1.28 ! paf 138: name_expr_wdive: name_expr_wdive_write | name_expr_wdive_root;
! 139: name_expr_wdive_write: name_expr_dive_code {
1.25 paf 140: $$=N(POOL);
1.23 paf 141: Array *diving_code=$1;
142: String *first_name=LA2S(diving_code);
143: if(first_name && *first_name==SELF_NAME) {
144: OP($$, OP_WITH_SELF); /* stack: starting context */
145: P($$, diving_code,
146: /* skip over... */
147: diving_code->size()>2?3/*OP_+string+get_element*/:2/*OP_+string*/);
148: } else {
149: OP($$, OP_WITH_WRITE); /* stack: starting context */
150: P($$, diving_code);
151: }
152: /* diving code; stack: current context */
1.20 paf 153: };
1.28 ! paf 154: name_expr_wdive_root: ':' name_expr_dive_code {
1.25 paf 155: $$=N(POOL);
1.20 paf 156: OP($$, OP_WITH_ROOT); /* stack: starting context */
1.9 paf 157: P($$, $2); /* diving code; stack: context,name */
1.1 paf 158: };
1.20 paf 159:
1.1 paf 160: constructor_value:
161: constructor_one_param_value
162: | constructor_two_params_value /* $var(=;2*2) $var(%d;2*2) $var(+;1) */
163: ;
1.27 paf 164:
1.1 paf 165: constructor_one_param_value:
1.26 paf 166: empty_value /* optimized $var() case */
1.17 paf 167: | STRING /* optimized $var(STRING) case */
1.1 paf 168: | complex_constructor_param_value /* $var(something complex) */
169: ;
170: complex_constructor_param_value: complex_constructor_param_body {
1.25 paf 171: $$=N(POOL);
1.3 paf 172: OP($$, OP_CREATE_EWPOOL); /* stack: empty write context */
1.9 paf 173: P($$, $1); /* some codes to that context */
174: OP($$, OP_REDUCE_EWPOOL); /* context=pop; stack: context.value() */
1.1 paf 175: };
1.27 paf 176: complex_constructor_param_body: codes__excluding_sole_str_literal;
177: codes__excluding_sole_str_literal: action | code codes { $$=$1; P($$, $2) };
178:
1.4 paf 179: constructor_two_params_value: STRING ';' constructor_one_param_value {
1.7 paf 180: char *operator_or_fmt=LA2S($1)->cstr();
1.25 paf 181: $$=N(POOL);
1.9 paf 182: P($$, $1); /* stack: ncontext name operator_or_fmt */
1.3 paf 183: P($$, $3); /* stack: ncontext name operator_or_fmt expr */
1.1 paf 184: switch(operator_or_fmt[0]) {
185: case '=': case '%':
1.3 paf 186: OP($$, OP_EXPRESSION_EVAL);
1.1 paf 187: break;
188: case '+': case '-': case '*': case '/':
1.3 paf 189: OP($$, OP_MODIFY_EVAL);
1.1 paf 190: break;
191: default:
1.6 paf 192: strcpy(PC->error, "invalid modification operator");
193: YYERROR;
1.1 paf 194: }
195: /* stack: ncontext name value */
196: };
197:
198: /* call */
199:
1.28 ! paf 200: call: '^' name_without_curly_rdive store_params EON { /* ^field.$method{vasya} */
! 201: $$=$2; /* with_xxx,diving code; stack: context,method_name */
1.9 paf 202: OP($$, OP_GET_METHOD_FRAME); /* stack: context,method_frame */
203: P($$, $3); /* filling method_frame.store_params */
204: OP($$, OP_CALL); /* method_frame=pop; ncontext=pop; call(ncontext,method_frame) */
1.1 paf 205: };
206:
1.9 paf 207: store_params: store_param | store_params store_param { $$=$1; P($$, $2) };
1.1 paf 208: store_param: store_round_param | store_curly_param;
209: store_round_param: '(' store_param_parts ')' {$$=$2};
1.9 paf 210: store_param_parts: store_param_part | store_param_parts ';' store_param_part { $$=$1; P($$, $3) };
1.1 paf 211: store_param_part: constructor_one_param_value {
212: $$=$1;
1.9 paf 213: OP($$, OP_STORE_PARAM);
1.1 paf 214: }
1.10 paf 215: store_curly_param: '{' maybe_codes '}' {
1.25 paf 216: $$=N(POOL);
1.3 paf 217: OP($$, OP_CODE_ARRAY);
1.9 paf 218: AA($$, $2);
219: OP($$, OP_CREATE_JUNCTION);
220: OP($$, OP_STORE_PARAM);
1.1 paf 221: };
222:
223: /* name */
224:
1.20 paf 225: name_expr_dive_code: name_expr_value | name_path name_expr_value { $$=$1; P($$, $2) };
1.1 paf 226:
1.9 paf 227: name_path: name_step | name_path name_step { $$=$1; P($$, $2) };
1.1 paf 228: name_step: name_advance1 '.';
229: name_advance1: name_expr_value {
230: /* stack: context */
231: $$=$1; /* stack: context,name */
1.9 paf 232: OP($$, OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */
1.1 paf 233: };
234: name_advance2: name_expr_value {
235: /* stack: context */
236: $$=$1; /* stack: context,name */
1.9 paf 237: OP($$, OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */
1.1 paf 238: }
1.4 paf 239: | STRING BOGUS
1.1 paf 240: ;
241: name_expr_value:
1.4 paf 242: STRING /* subname_is_const */
1.1 paf 243: | name_expr_subvar_value /* $subname_is_var_value */
244: | name_expr_with_subvar_value /* xxx$part_of_subname_is_var_value[$...] */
245: ;
246: name_expr_subvar_value: '$' subvar_ref_name_rdive {
247: $$=$2;
1.9 paf 248: OP($$, OP_GET_ELEMENT);
1.1 paf 249: };
1.4 paf 250: name_expr_with_subvar_value: STRING subvar_get_writes {
1.25 paf 251: $$=N(POOL);
1.3 paf 252: OP($$, OP_CREATE_EWPOOL);
1.9 paf 253: P($$, $1);
1.17 paf 254: OP($$, OP_WRITE);
1.9 paf 255: P($$, $2);
256: OP($$, OP_REDUCE_EWPOOL);
1.1 paf 257: };
1.18 paf 258: subvar_ref_name_rdive: subvar_ref_name_rdive_read | subvar_ref_name_rdive_root;
259: subvar_ref_name_rdive_read: STRING {
1.25 paf 260: $$=N(POOL);
1.18 paf 261: OP($$, OP_WITH_READ);
1.9 paf 262: P($$, $1);
1.1 paf 263: };
1.18 paf 264: subvar_ref_name_rdive_root: ':' STRING {
1.25 paf 265: $$=N(POOL);
1.18 paf 266: OP($$, OP_WITH_ROOT);
267: P($$, $2);
268: };
1.9 paf 269: subvar_get_writes: subvar__get_write | subvar_get_writes subvar__get_write { $$=$1; P($$, $2) };
1.1 paf 270: subvar__get_write: '$' subvar_ref_name_rdive {
271: $$=$2;
1.17 paf 272: OP($$, OP_GET_ELEMENT__WRITE);
1.1 paf 273: };
274:
275:
276: /* with */
277:
278: with: '$' name_without_curly_rdive '{' codes '}' {
279: $$=$2;
1.9 paf 280: OP($$, OP_CREATE_RWPOOL);
281: P($$, $4);
282: OP($$, OP_REDUCE_RWPOOL);
1.17 paf 283: OP($$, OP_WRITE);
1.1 paf 284: };
285:
1.27 paf 286: /* basics */
1.1 paf 287:
1.4 paf 288: write_str_literal: STRING {
1.1 paf 289: $$=$1;
1.17 paf 290: OP($$, OP_WRITE);
1.1 paf 291: };
1.26 paf 292: empty_value: empty {
1.27 paf 293: $$=$1;
294: PVS($$, NEW VString(POOL));
1.26 paf 295: };
1.25 paf 296: empty: /* empty */ { $$=N(POOL) };
1.1 paf 297:
298: %%
299:
300: /*
301: 000$111(2222)00
302: 000$111{3333}00
1.9 paf 303: $,^: push,=0
1.1 paf 304: 1:( { break=pop
305: 2:( ) pop
306: 3:{ } pop
307:
308: 000^111(2222)4444{33333}4000
1.9 paf 309: $,^: push,=0
1.1 paf 310: 1:( { break=pop
311: 2:( )=4
312: 3:{ }=4
313: 4:[^({]=pop
314: */
315:
316: int yylex(YYSTYPE *lvalp, void *pc) {
317: #define lexical_brackets_nestage PC->brackets_nestages[PC->sp]
318:
319: register int c;
320: int result;
321:
322: if(PC->pending_state) {
323: result=PC->pending_state;
324: PC->pending_state=0;
325: return result;
326: }
327:
1.9 paf 328: char *begin=PC->source;
329: char *end;
330: int begin_line=PC->line;
1.1 paf 331: while(1) {
1.9 paf 332: c=*(end=(PC->source++));
1.1 paf 333:
1.4 paf 334: if(c=='\n') {
1.1 paf 335: PC->line++;
1.8 paf 336: PC->col=0;
1.10 paf 337: } else
1.4 paf 338: PC->col++;
1.1 paf 339:
340: /* escaping: ^^ ^$ ^; ^) ^} ^( ^{ */
341: if(c=='^') {
342: char pending_c=*PC->source;
343:
1.9 paf 344: if(pending_c=='^' || pending_c=='$' || pending_c==';' ||
345: pending_c=='(' || pending_c==')' ||
346: pending_c=='{' || pending_c=='}') {
1.1 paf 347: /* append piece till ^ */
1.9 paf 348: PC->string->APPEND(begin, end-begin, PC->file, begin_line);
1.1 paf 349: /* reset piece 'start' position & line */
1.9 paf 350: begin=PC->source/*^*/;
351: begin_line=PC->line;
1.1 paf 352: /* skip over ^ and _ */
353: PC->source+=2;
354: /* skip analysis = forced literal */
355: continue;
356: }
357: }
358: switch(PC->ls) {
1.10 paf 359:
360: // USER'S = NOT OURS
1.1 paf 361: case LS_USER:
362: if(c=='$') {
1.10 paf 363: push_LS(PC, LS_VAR_NAME_SIMPLE);
1.1 paf 364: result=c;
365: goto break2;
366: }
367: if(c=='^') {
1.10 paf 368: push_LS(PC, LS_METHOD_NAME);
369: result=c;
370: goto break2;
371: }
372: if(c=='@' && PC->col==0+1) {
1.1 paf 373: result=c;
1.10 paf 374: push_LS(PC, LS_DEF_NAME);
375: goto break2;
376: }
377:
378: break;
379:
380: // METHOD DEFINITION
381: case LS_DEF_NAME:
382: if(c=='[') {
383: result=c;
384: PC->ls=LS_DEF_PARAMS;
385: goto break2;
386: }
387: if(c=='\n') { // wrong. bailing out
388: result=c;
389: pop_LS(PC);
390: goto break2;
391: }
392: break;
393: case LS_DEF_PARAMS:
394: if(c==';') {
395: result=c;
396: goto break2;
397: }
398: if(c==']') {
399: result=c;
400: PC->ls=*PC->source=='['?LS_DEF_LOCALS:LS_DEF_COMMENT;
401: goto break2;
402: }
403: if(c=='\n') { // wrong. bailing out
404: result=c;
405: pop_LS(PC);
406: goto break2;
407: }
408: break;
409: case LS_DEF_LOCALS:
410: if(c=='[' || c==';') {
411: result=c;
412: goto break2;
413: }
414: if(c==']') {
415: result=c;
416: PC->ls=LS_DEF_COMMENT;
417: goto break2;
418: }
419: if(c=='\n') { // wrong. bailing out
420: result=c;
421: pop_LS(PC);
422: goto break2;
423: }
424: break;
425: case LS_DEF_COMMENT:
426: if(c=='\n') {
427: result=c;
428: pop_LS(PC);
1.1 paf 429: goto break2;
430: }
431: break;
432:
1.10 paf 433: // VARIABLE GET/PUT/WITH
1.1 paf 434: case LS_VAR_NAME_SIMPLE:
435: if(c==0 ||
436: c==' '|| c=='\t' || c=='\n' ||
437: c==')' || c=='}') {
438: pop_LS(PC);
1.4 paf 439: PC->source--; PC->col--;
1.13 paf 440: result=EON;
1.1 paf 441: goto break2;
442: }
1.13 paf 443: if(begin==end && c=='{') { /* ${name}, no need of EON, switching LS */
1.1 paf 444: PC->ls=LS_VAR_NAME_CURLY;
445: result=c;
446: goto break2;
447: }
1.18 paf 448: if(c==':') {
449: result=c;
450: goto break2;
451: }
1.1 paf 452: if(c=='(') {
453: PC->ls=LS_VAR_ROUND;
454: lexical_brackets_nestage=1;
455: result=c;
456: goto break2;
457: }
458: if(c=='{') {
459: PC->ls=LS_VAR_CURLY;
460: lexical_brackets_nestage=1;
461: result=c;
462: goto break2;
463: }
464: if(c=='.'/* name part delim */ || c=='$'/* name part subvar */) {
465: result=c;
466: goto break2;
467: }
468: break;
469: case LS_VAR_NAME_CURLY:
1.18 paf 470: if(c==':') {
471: result=c;
472: goto break2;
473: }
1.1 paf 474: if(c=='}') { /* ${name} finished, restoring LS */
475: pop_LS(PC);
476: result=c;
477: goto break2;
478: }
479: if(c=='.'/* name part delim */ || c=='$'/*name part subvar*/) {
480: result=c;
481: goto break2;
482: }
483: break;
484: case LS_VAR_ROUND:
485: if(c=='$') {
1.10 paf 486: push_LS(PC, LS_VAR_NAME_SIMPLE);
1.1 paf 487: result=c;
488: goto break2;
489: }
490: if(c=='^') {
1.10 paf 491: push_LS(PC, LS_METHOD_NAME);
1.1 paf 492: result=c;
493: goto break2;
494: }
495: if(c==')') {
496: if(--lexical_brackets_nestage==0) {
497: pop_LS(PC);
498: result=c;
499: goto break2;
500: }
501: }
502: if(c==';'/* operator_or_fmt;value delim */) {
503: result=c;
504: goto break2;
505: }
506: if(c=='(')
507: lexical_brackets_nestage++;
508: break;
509: case LS_VAR_CURLY:
510: if(c=='$') {
1.10 paf 511: push_LS(PC, LS_VAR_NAME_SIMPLE);
1.1 paf 512: result=c;
513: goto break2;
514: }
515: if(c=='^') {
1.10 paf 516: push_LS(PC, LS_METHOD_NAME);
1.1 paf 517: result=c;
518: goto break2;
519: }
520: if(c=='}')
521: if(--lexical_brackets_nestage==0) {
522: pop_LS(PC);
523: result=c;
524: goto break2;
525: }
526: if(c=='{')
527: lexical_brackets_nestage++;
528: break;
529:
1.10 paf 530: // METHOD CALL
1.1 paf 531: case LS_METHOD_NAME:
532: if(c=='(') {
533: PC->ls=LS_METHOD_ROUND;
534: lexical_brackets_nestage=1;
535: result=c;
536: goto break2;
537: }
538: if(c=='{') {
539: PC->ls=LS_METHOD_CURLY;
540: lexical_brackets_nestage=1;
541: result=c;
542: goto break2;
543: }
544: if(c=='.'/* name part delim */ || c=='$'/* name part subvar */) {
545: result=c;
546: goto break2;
547: }
548: break;
549: case LS_METHOD_ROUND:
550: if(c=='$') {
1.10 paf 551: push_LS(PC, LS_VAR_NAME_SIMPLE);
1.1 paf 552: result=c;
553: goto break2;
554: }
555: if(c=='^') {
1.10 paf 556: push_LS(PC, LS_METHOD_NAME);
1.1 paf 557: result=c;
558: goto break2;
559: }
560: if(c==';'/* param delim */) {
561: result=c;
562: goto break2;
563: }
564: if(c==')')
565: if(--lexical_brackets_nestage==0) {
566: PC->ls=LS_METHOD_AFTER;
567: result=c;
568: goto break2;
569: }
570: if(c=='(')
571: lexical_brackets_nestage++;
572: break;
573: case LS_METHOD_CURLY:
574: if(c=='$') {
1.10 paf 575: push_LS(PC, LS_VAR_NAME_SIMPLE);
1.1 paf 576: result=c;
577: goto break2;
578: }
579: if(c=='^') {
1.10 paf 580: push_LS(PC, LS_METHOD_NAME);
1.1 paf 581: result=c;
582: goto break2;
583: }
584: if(c=='}')
585: if(--lexical_brackets_nestage==0) {
586: PC->ls=LS_METHOD_AFTER;
587: result=c;
588: goto break2;
589: }
590: if(c=='{')
591: lexical_brackets_nestage++;
592: break;
593: case LS_METHOD_AFTER:
594: if(c=='(') {/* )( }( */
595: PC->ls=LS_METHOD_ROUND;
596: lexical_brackets_nestage=1;
597: result=c;
598: goto break2;
599: }
600: if(c=='{') {/* ){ }{ */
601: PC->ls=LS_METHOD_CURLY;
602: lexical_brackets_nestage=1;
603: result=c;
604: goto break2;
605: }
606: pop_LS(PC);
1.4 paf 607: PC->source--; PC->col--;
1.13 paf 608: result=EON;
1.1 paf 609: goto break2;
610: }
1.9 paf 611: if(c==0) {
1.1 paf 612: result=-1;
1.21 paf 613: // PC->source--; PC->col--;
1.1 paf 614: break;
615: }
616: }
617:
618: break2:
1.9 paf 619: if(begin==end)
1.1 paf 620: return result;
621: else {
622: PC->pending_state=result;
1.10 paf 623: // strip last \n before LS_DEF_NAME or EOF
624: if((c=='@' || c==0) && end[-1]=='\n')
625: end--;
626: // append last piece
1.9 paf 627: PC->string->APPEND(begin, end-begin, PC->file, begin_line/*, start_col*/);
1.17 paf 628: // create STRING value: array of OP_VALUE+vstring
1.25 paf 629: *lvalp=L(NEW VString(PC->string));
1.10 paf 630: // new pieces storage
1.25 paf 631: PC->string=NEW String(POOL);
1.10 paf 632: // go!
1.4 paf 633: return STRING;
1.1 paf 634: }
635: }
636:
1.9 paf 637: int real_yyerror(parse_control *pc, char *s) /* Called by yyparse on error */
1.1 paf 638: {
1.16 paf 639: //fprintf(stderr, "[%s]\n", s);
1.6 paf 640:
641: s[MAX_STRING-1]=0; strcpy(pc->error, s);
1.1 paf 642: return 1;
643: }
644:
645: static void
1.9 paf 646: yyprint(
1.1 paf 647: FILE *file,
648: int type,
649: YYSTYPE value)
650: {
1.9 paf 651: if(type==STRING)
652: fprintf(file, " \"%s\"", LA2S(value)->cstr());
1.1 paf 653: }
654:
E-mail: