Parser fixes

This commit is contained in:
Artur Meski
2018-02-17 20:45:08 +00:00
parent 6dbdd586d6
commit 83e48eb08d
3 changed files with 13 additions and 6 deletions

5
rs.hh
View File

@@ -96,6 +96,10 @@ public:
void printSystem(void); void printSystem(void);
}; };
class RctSysWithCtxAut : private RctSys
{
};
// Context Automaton // Context Automaton
class CtxAut class CtxAut
{ {
@@ -107,6 +111,5 @@ class CtxAut
}; };
}; };
#endif #endif

View File

@@ -41,6 +41,9 @@ blank [ \t]
"reactions" return token::REACTIONS; "reactions" return token::REACTIONS;
"initial-contexts" return token::INITIALCONTEXTS; "initial-contexts" return token::INITIALCONTEXTS;
"context-entities" return token::CONTEXTENTITIES; "context-entities" return token::CONTEXTENTITIES;
"context-automaton" return token::CONTEXTAUTOMATON;
"transitions" return token::TRANSITIONS;
"states" return token::STATES;
"rsctl-property" return token::RSCTLFORM; "rsctl-property" return token::RSCTLFORM;
"{" return token::LCB; "{" return token::LCB;
"}" return token::RCB; "}" return token::RCB;

View File

@@ -45,6 +45,7 @@ class rsin_driver;
} }
%token REACTIONS INITIALCONTEXTS CONTEXTENTITIES RSCTLFORM %token REACTIONS INITIALCONTEXTS CONTEXTENTITIES RSCTLFORM
%token CONTEXTAUTOMATON STATES TRANSITIONS
%token LCB RCB LRB RRB LSB RSB LAB RAB SEMICOL COMMA RARR %token LCB RCB LRB RRB LSB RSB LAB RAB SEMICOL COMMA RARR
%token AND OR XOR IMPLIES NOT %token AND OR XOR IMPLIES NOT
%token EX EU EF EG AX AU AF AG E A X U F G EMPTY %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 //%right SRB
%type <frsctl> rsctl_form %type <frsctl> rsctl_form
%type <ent> entity %type <ent> f_entity
%type <act> action %type <act> action
%type <actionsVec> actions %type <actionsVec> actions
%type <fboolctx> bool_contexts %type <fboolctx> bool_contexts
@@ -201,19 +202,19 @@ action:
{ {
$$ = new Action_f; $$ = new Action_f;
} }
| entity { | f_entity {
$$ = new Action_f; $$ = new Action_f;
$$->insert(*$1); $$->insert(*$1);
free($1); free($1);
} }
| action COMMA entity { | action COMMA f_entity {
$$ = $1; $$ = $1;
$$->insert(*$3); $$->insert(*$3);
free($3); free($3);
} }
; ;
entity: IDENTIFIER { f_entity: IDENTIFIER {
$$ = new Entity_f(*$1); $$ = new Entity_f(*$1);
free($1); free($1);
} }