CA parsing (without interpretation)

This commit is contained in:
Artur Meski
2018-02-17 22:09:48 +00:00
parent bd4b74703d
commit f5a7d857c6
2 changed files with 21 additions and 4 deletions

View File

@@ -53,6 +53,7 @@ blank [ \t]
"]" return token::RSB; "]" return token::RSB;
"<" return token::LAB; "<" return token::LAB;
">" return token::RAB; ">" return token::RAB;
":" return token::COL;
";" return token::SEMICOL; ";" return token::SEMICOL;
"," return token::COMMA; "," return token::COMMA;
"->" return token::RARR; "->" return token::RARR;

View File

@@ -46,7 +46,7 @@ class rsin_driver;
%token REACTIONS INITIALCONTEXTS CONTEXTENTITIES RSCTLFORM %token REACTIONS INITIALCONTEXTS CONTEXTENTITIES RSCTLFORM
%token CONTEXTAUTOMATON STATES TRANSITIONS %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 COL 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
@@ -176,18 +176,34 @@ actentity: IDENTIFIER {
ctxaut: ctxaut:
| STATES LCB autstates RCB ctxaut | STATES LCB autstates RCB ctxaut
| TRANSITIONS LCB auttrans RCB ctxaut | TRANSITIONS LCB auttransitions RCB ctxaut
; ;
autstate: IDENTIFIER { autstate: IDENTIFIER {
} }
;
autstates: autstates:
| autstate autstate
| autstate COMMA autstates | autstate COMMA autstates
; ;
auttrans: auttransitions:
| auttrans
| auttrans SEMICOL auttransitions
;
auttrans: LCB contextset RCB COL autstate RARR autstate
;
contextset:
ctxentity
| contextset COMMA ctxentity
;
ctxentity: IDENTIFIER {
//
}
; ;
/* formulae */ /* formulae */