From 83e48eb08dc105d95177261c3232532f6bdd9f38 Mon Sep 17 00:00:00 2001 From: Artur Meski Date: Sat, 17 Feb 2018 20:45:08 +0000 Subject: [PATCH] Parser fixes --- rs.hh | 5 ++++- rsin_parser.ll | 5 ++++- rsin_parser.yy | 9 +++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/rs.hh b/rs.hh index f7aaf69..c8d77fc 100644 --- a/rs.hh +++ b/rs.hh @@ -96,6 +96,10 @@ public: void printSystem(void); }; +class RctSysWithCtxAut : private RctSys +{ +}; + // Context Automaton class CtxAut { @@ -107,6 +111,5 @@ class CtxAut }; }; - #endif diff --git a/rsin_parser.ll b/rsin_parser.ll index 2b42dca..23e010d 100644 --- a/rsin_parser.ll +++ b/rsin_parser.ll @@ -41,7 +41,10 @@ blank [ \t] "reactions" return token::REACTIONS; "initial-contexts" return token::INITIALCONTEXTS; "context-entities" return token::CONTEXTENTITIES; -"rsctl-property" return token::RSCTLFORM; +"context-automaton" return token::CONTEXTAUTOMATON; +"transitions" return token::TRANSITIONS; +"states" return token::STATES; +"rsctl-property" return token::RSCTLFORM; "{" return token::LCB; "}" return token::RCB; "(" return token::LRB; diff --git a/rsin_parser.yy b/rsin_parser.yy index da0e527..fa10762 100644 --- a/rsin_parser.yy +++ b/rsin_parser.yy @@ -45,6 +45,7 @@ class rsin_driver; } %token REACTIONS INITIALCONTEXTS CONTEXTENTITIES RSCTLFORM +%token CONTEXTAUTOMATON STATES TRANSITIONS %token LCB RCB LRB RRB LSB RSB LAB RAB SEMICOL COMMA RARR %token AND OR XOR IMPLIES NOT %token EX EU EF EG AX AU AF AG E A X U F G EMPTY @@ -59,7 +60,7 @@ class rsin_driver; //%right SRB %type rsctl_form -%type entity +%type f_entity %type action %type actions %type bool_contexts @@ -201,19 +202,19 @@ action: { $$ = new Action_f; } - | entity { + | f_entity { $$ = new Action_f; $$->insert(*$1); free($1); } - | action COMMA entity { + | action COMMA f_entity { $$ = $1; $$->insert(*$3); free($3); } ; -entity: IDENTIFIER { +f_entity: IDENTIFIER { $$ = new Entity_f(*$1); free($1); }