Adding example diagram as a template for a new diagram

This commit is contained in:
Knut Sveidqvist
2022-09-28 17:49:47 +02:00
parent bed9b1bb99
commit f46f8752ca
15 changed files with 374 additions and 16 deletions

View File

@@ -0,0 +1,43 @@
%lex
%options case-insensitive
%{
// Pre-lexer code can go here
%}
%%
"info" return 'info' ;
[\s\n\r]+ return 'NL' ;
[\s]+ return 'space';
"showInfo" return 'showInfo';
<<EOF>> return 'EOF' ;
. return 'TXT' ;
/lex
%start start
%% /* language grammar */
start
// %{ : info document 'EOF' { return yy; } }
: info document 'EOF' { return yy; }
;
document
: /* empty */
| document line
;
line
: statement { }
| 'NL'
;
statement
: showInfo { yy.setInfo(true); }
;
%%