Migrated first 6 gists.

This commit is contained in:
Miguel Astor
2023-01-13 18:18:55 -04:00
parent 92fcabcfba
commit 8af706e97d
16 changed files with 290 additions and 0 deletions

1
rmfen.l/README.md Normal file
View File

@@ -0,0 +1 @@
Flex lexer for rithmomachia boards represented in reduced modified FEN notation.

20
rmfen.l/rmfen.l Normal file
View File

@@ -0,0 +1,20 @@
%{
#include <stdio.h>
%}
%option outfile="rmfen.c"
%option always-interactive
%option nounput noinput
space [1-7]
piece (c|s|t|C|S|T)([1-9][0-9]{0,2})"."
pyramid (p|P){piece}+"."
boardpiece ({pyramid}|{piece})
row (({space}|{boardpiece}){0,7}{boardpiece})?
board ({row}"/"){15}{row}
%%
{board} { printf("Valid board: %s\n", yytext); }
. { printf("Unknown text %s\n", yytext); }