#945 Support for forks and joins

This commit is contained in:
Knut Sveidqvist
2019-10-06 14:11:17 +02:00
parent 4f1186a610
commit dce09586cd
4 changed files with 41 additions and 6 deletions

View File

@@ -43,8 +43,10 @@
<SCALE>\s+"width" {this.popState();}
<INITIAL,struct>"state"\s+ { this.pushState('STATE'); }
<STATE>.*"<<fork>>" {this.popState();console.log('Fork: ',yytext);return 'FORK';}
<STATE>.*"<<join>>" {this.popState();console.log('Join: ',yytext);return 'JOIN';}
<STATE>.*"<<fork>>" {this.popState();yytext=yytext.slice(0,-8).trim(); console.warn('Fork Fork: ',yytext);return 'FORK';}
<STATE>.*"<<join>>" {this.popState();yytext=yytext.slice(0,-8).trim();console.warn('Fork Join: ',yytext);return 'JOIN';}
<STATE>.*"[[fork]]" {this.popState();yytext=yytext.slice(0,-8).trim();console.warn('Fork Fork: ',yytext);return 'FORK';}
<STATE>.*"[[join]]" {this.popState();yytext=yytext.slice(0,-8).trim();console.warn('Fork Join: ',yytext);return 'JOIN';}
<STATE>["] this.begin("STATE_STRING");
<STATE>"as"\s* {this.popState();this.pushState('STATE_ID');return "AS";}
<STATE_ID>[^\n\{]* {this.popState();console.log('STATE_ID', yytext);return "ID";}
@@ -135,8 +137,12 @@ statement
//console.warn('Adding document for state with id ', $3, $4); yy.addDocument($3);
$$={ stmt: 'state', id: $3, type: 'default', description: $1, doc: $5 }
}
| FORK
| JOIN
| FORK {
$$={ stmt: 'state', id: $1, type: 'fork' }
}
| JOIN {
$$={ stmt: 'state', id: $1, type: 'join' }
}
| CONCURRENT
| note notePosition ID NOTE_TEXT
{