AFL Grammar?


#1

I want to write a simple AFL lexer in Python for use in Pygments. Can anyone point me to the full AFL grammar (parts of it are scattered in the documentation)?


#2

Download the community edition sources, and you’ll find these Flex and Bison input files:

src/query/parser/{Lexer.ll,Parser.yy}

That’s the full grammar. If you need to just parse array schemas, there is a usually-good-enough Python parser in

utils/scidblib/scidb_schema.py

The soon-to-be-published 16.9 version of this module has many improvements over prior versions.

Hope this helps!


#3

Thanks mjl. Lexer.ll and Parser.yy have just what I was looking for. I’ve previously used the schema definitions in scidb_schema.py, but will checkout the new version.