/* $echo file: rule7.dat $echo test: undefined terminal ### $echo Error */ /* FILE: rule_def_phrase.lex Dates: 3 Jun 2004 Purpose: parse a rule definition construct Verifies if the symbol being defined is duplicate within yacco2's symbol table. Adds symbol to global symbol table. Output: T_rule_def assorted errors */ fsm (fsm-id "rule_def_phrase.lex" ,fsm-filename rule_def_phrase ,fsm-namespace NS_rule_def_phrase ,fsm-class Crule_def_phrase{ user-prefix-declaration using namespace NS_yacco2_terminals; #include "c:/yacco2/compiler/grammars/ws.h" #include "c:/yacco2/compiler/grammars/c_comments.h" #include "c:/yacco2/compiler/grammars/identifier.h" #include "c:/yacco2/compiler/grammars/c_string.h" #include "c:/yacco2/compiler/grammars/terminal_def_directives.h" #include "c:/yacco2/compiler/grammars/terminal_def_delabort_tags.h" #include "c:/yacco2/compiler/grammars/subrules_phrase.h" #include "c:/yacco2/compiler/grammars/rule_lhs_phrase.h" #include "c:/yacco2/compiler/cweb/symbol table/yacco2_ste.h" #include "c:/yacco2/compiler/grammars/parallel_monitor_phrase.h" *** user-declaration public: T_rule_def* rule_def_; *** constructor rule_def_ = 0; *** destructor delete rule_def_; // stop_parse: clean up software dodos *** op if(rule_def_ != 0){ delete rule_def_; rule_def_ = 0; } rule_def_ = new T_rule_def; *** } ,fsm-version "1.0",fsm-date "24 mar 2004",fsm-debug "true" ,fsm-comments "into the valley of ...") parallel-parser ( parallel-thread-function TH_rule_def_phrase *** parallel-la-boundary eolr *** ) @"/yacco2/compiler/grammars/yacco2_T_includes.T" rules{ Rrule_def_phrase AD AB(){ -> Rid -> ### } Rid AD AB( lhs ,parallel-control-monitor{ arbitrator-code *** } ){ -> ||| identifier NS_identifier::TH_identifier { op Crule_def_phrase* fsm = (Crule_def_phrase*)abs_parser()->fsm_tbl(); const char* skey = Sub_rule_1.p2__->identifier()->c_str(); fsm->rule_def_->rule_name(skey); Sub_rule_1.p2__->auto_delete(true); *** } -> |.| { op CAbs_lr1_sym* sym = new LR1_err_no_rule_name_present; sym->rc(abs_parser()->current_token(),abs_parser()); RSVP(sym) abs_parser()->stop_parse(true); *** } } }// end of rules