Changeset 678


Ignore:
Timestamp:
2001-12-11T15:05:13+01:00 (22 years ago)
Author:
levsa
Message:

dump code for dumping the pccts ast

Location:
branches/pdetest-levsa/modeq
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/pdetest-levsa/modeq/ast/Makefile

    r489 r678  
    3232#AFLAGS = -CC -gt
    3333#AFLAGS = -gt -gl
    34 AFLAGS = -gt -gl -gh
     34AFLAGS = -gt -gh
    3535#DFLAGS = -C2 -CC -cs
    3636DFLAGS = -C2
     
    4141      yacclib.c \
    4242      attrib.c  \
    43       parsemod.c
     43      parsemod.c \
     44      dump.c
    4445OBJ = $(SRC:.c=.o)
    4546ANTLR_SPAWN = modgram.c \
  • branches/pdetest-levsa/modeq/ast/parsemod.c

    r333 r678  
    66#include "yacclib.h"
    77#include <errno.h>
     8#include "dump.h"
     9
     10extern int dump_ast; /* defined in ../runtime/rtopts.c */
    811
    912/* Also see rml-1.3.6/examples/etc/ccall.c */
     
    2023    fprintf(stderr,"*");
    2124
    22   if(zzchild(ast))
     25  if(zzchild(ast)) {
    2326    fprintf(stderr,"(");
    24   else if(zzsibling(ast))
     27    print_token(zzchild(ast));
     28  }
     29  else if(zzsibling(ast)) {
    2530    fprintf(stderr,",");
     31    print_token(zzsibling(ast));
     32  }
    2633}
    2734
     
    7986      /* if( !root )
    8087       *   RML_TAILCALLK(rmlFC); */
    81      
     88
     89      if (dump_ast)
     90  dump(root);
    8291      rmlA0 = sibling_list(root);
    8392     
  • branches/pdetest-levsa/modeq/runtime/rtopts.c

    r573 r678  
    1111static int debug_flag_info;
    1212static int params_struct;
     13int dump_ast;
     14
    1315
    1416static char **debug_flags;
     
    2527  params_struct = 0;
    2628  debug_all = 0;
     29  dump_ast = 0;
    2730}
    2831
     
    113116  }
    114117  break;
     118      case 'r':
     119  dump_ast = 1;
     120  break;
    115121      default:
    116122  fprintf(stderr, "# Unknown option: %s\n", arg);
     
    192198
    193199
     200RML_BEGIN_LABEL(RTOpts__dump_5fast)
     201{
     202  rmlA0 = RML_PRIM_MKBOOL(dump_ast);
     203  RML_TAILCALLK(rmlSC);
     204}
     205RML_END_LABEL
     206
Note: See TracChangeset for help on using the changeset viewer.