lemon-py.gv 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. /* ast of a parser generated with lemon-py parser tool
  2. https://github.com/aubreyrjones/lemon-py
  3. This project wraps the Lemon parser generator.
  4. lemon-py provides functions that compile a EBNF grammar and a lexer definition into a standalone native module for Python 3.x or (with a little work) C++ . The resulting lexer+parser is implemented entirely in native code, and has no external dependencies (including on this project or any Python code) and is suitable for use as a submodule in other projects. You can just import it and run parse().
  5. */
  6. digraph "AST" {
  7. node [shape=record, style=filled];
  8. 0 [shape=record, label="{<f0>line:1 | <f1> + }",shape=record];
  9. node [shape=record, label="{<f0>line:1 | <f1> / }"] 1;
  10. 0 -> 1;
  11. node [shape=record, label="{<f0>line:1 | <f1> + }"] 2;
  12. 1 -> 2;
  13. node [shape=record, label="{<f0>line:1 | { <f1> INT_LIT | <f2> 5}}"] 3;
  14. 2 -> 3;
  15. node [shape=record, label="{<f0>line:1 | { <f1> FLOAT_LIT | <f2> 7.2}}"] 4;
  16. 2 -> 4;
  17. node [shape=record, label="{<f0>line:1 | <f1> fncall }"] 5;
  18. 1 -> 5;
  19. node [shape=record, label="{<f0>line:1 | { <f1> FNCALL | <f2> log}}"] 6;
  20. 5 -> 6;
  21. node [shape=record, label="{<f0>line:1 | <f1> arglist }"] 7;
  22. 5 -> 7;
  23. node [shape=record, label="{<f0>line:1 | <f1> neg }"] 8;
  24. 7 -> 8;
  25. node [shape=record, label="{<f0>line:1 | { <f1> INT_LIT | <f2> 24}}"] 9;
  26. 8 -> 9;
  27. node [shape=record, label="{<f0>line:1 | { <f1> STRING | <f2> nonsense}}"] 10;
  28. 0 -> 10;
  29. }