Because graph languages are easy doing work to see if there is a
alternative to the complex flex+bison solution:

The pacc peg parser generator is unmaintained GNU GPL Free software
and creating a updated version of it now at
https://notabug.org/mooigraph/paccgpl

See also the original version at http://paccrat.org/

When possible prefer GNU GPL versions of tools because of long term maintance

pacc is a compiler-compiler, somewhat like yacc (or bison). Its input is a description of a grammar, and its output is a C function that recognizes strings of that grammar. The significant technical difference is this: yacc reads a context-free grammar (CFGs), and writes a LALR(1) parser; pacc reads a parsing expression grammar (PEG), and writes a packrat parser.

PEGs and packrat parsing offer several advantages over CFGs.

There is also GPL LL1 parser tool llnextgen usable for easy grammar https://os.ghalkes.nl/LLnextgen/

Using the peg parser generator packcc as single c source file at https://github.com/arithy/packcc

PackCC is a packrat parser generator for C. Its main features are as follows:


These grammars to parse (graph) languages can be converted in javascript parsers wit few edits for use with pegjs to have a javascript version of the parser and the tool is at https://pegjs.org/

Now creating grammars for (graph) languages at https://notabug.org/mooigraph/basic

Examples of parsers for graphviz data , gml graph language and more is documented  here


other languages are found on rosettacode at https://rosettacode.org/wiki/Compiler/code_generator#C