How ppazosp/interpppreter works
Project type and purpose
• This is an academic‐style, command‐driven interactive mathematical expression interpreter written in C.
• It uses Flex for lexical analysis, Bison for parsing, Readline for the REPL interface, and supports dynamic libraries for extensibility.
File structure
• Top‑level:
• Makefile – build orchestration
• ippp (final executable)
• / – all headers (.h)
• src/ – implementation (.c, .l, .y)
• resources/ – sample input files and dynamic libraries
• Key source files in src/:
• lex.l / lex.yy.c: lexer
• syn.y / syn.tab.c: parser
• main.c: entry point and REPL loop
• hash_table.c, symbol_table.c, stack.c: core runtime data structures
• error_handler.c, functions.c, dll.c: runtime services (errors, built‑in funcs, dynamic libs)
README for additional insights
• Describes commands (LOAD, IMPORT, WORKSPACE, etc.) and language conventions.
• Emphasis on dynamically loaded functions, history via Readline, and memory checking with Valgrind.
Elements
• Clear, descriptive labels for each module (e.g., “Lexer (Flex)”, “Parser (Bison)”)
• Yellow for compiler stages (lex, parse)
• Blue for runtime modules (symbol table, stack)
• Green for I/O and dynamic linking
• Gray for build tools
• Related files under each module (e.g., lex.l & lex.yy.c under Lexer)
Detail without over‑splitting
• Logical component distinctly (don’t lump lexer + parser into one block)
• How commands map onto pipeline invocations (LOAD uses file I/O + REPL, IMPORT uses DLL loader)
• Build step as a side module generating the ippp executable