How sudokentucky/olc1_proyecto2_202100106 works
Below are guidelines that specifically capture the essential architectural elements:
Main Components
• Back-end Interpreter Engine:
• Parser & Grammar: Located in back-end/Grammar (using Jison in parser.jison). This component is responsible for lexing/parsing the source input.
• Analyzer/Interpreter: Under back-end/src/Analizador, you see directories for instructions, expressions, environment (symbol tables, arrays), error handling, and abstract syntax tree (AST) generation. These modules form the core execution and interpretation logic.
• AST & DOT Generation: The presence of back-end/src/Analizador/Tree (including AST.ts and DotGenerator.ts) signals that the AST is built and potentially visualized with Graphviz dot language.
• Documentation & Manuals: The Documentacion folder includes technical and user manuals which could be referenced as part of system documentation but are not part of runtime architecture.
• Front-end User Interface:
• UI Components: Found under front-end/src/components (e.g., AST.tsx, CommandExecution.tsx, ErrorTable.tsx, SymbolTable.tsx, Navbar.tsx, FileInput.tsx). These provide the different views for interacting with the system.
• Custom Hooks: In front-end/src/hooks (such as useCommandExecution, useErrors, useGenerateDot, and useSymbolTable) which abstract state management and behavior for handling outputs from the back-end.
• Entry and Configuration: The index.html, main.tsx along with Vite configuration files establish how the application is bootstrapped.
Understand the Relationships and Interactions
• The Front-end acts as the presentation layer, gathering program inputs (e.g., via FileInput.tsx) and streaming commands.
• The input is then handed over—directly or via an API call—to the Back-end Interpreter.
• Within the back-end, the parser (using the Jison grammar) processes the source code to generate an AST.
• The Analyzer/Interpreter traverses the AST, invoking various Instruction modules, Expression handlers, and updating the Environment (symbol tables) accordingly.
• As analysis proceeds, errors are captured and aggregated, while the AST might be translated into a DOT graph for visualization.
• Processed results (for example, execution outcomes, errors, and symbol table details) are then sent back to the front-end where they are rendered in appropriate components.
Important Architectural Patterns/Design Principles
• Separation of Concerns: The project clearly separates the interpreter logic (back-end) from the user interface (front-end).
• Modular Design: Diverse language constructs are implemented in distinct modules (e.g., separate files for each instruction like loops, conditionals, arithmetic).
• Extensibility: The back-end’s rich module structure (with abstract and concrete implementations of expressions and instructions) supports future language enhancements.
• Clear Data Flow: With dedicated hooks in the front-end processing data streams (outputs such as errors, AST graphs), the design highlights a unidirectional data flow.
Relevant Technologies, Frameworks, and Libraries
• Node.js & TypeScript: The back-end is written in TypeScript (tsconfig.json present), and the project uses Node.js features.
• Jison: For grammar parsing & language processing.
• React with Vite: The front-end is built using React with Vite as the build tool.
• Graphviz (implied by DotGenerator.ts): For AST visualization.
• The Grammar/Parser module (using Jison)
• The Analyzer/Interpreter module, broken down to show sub-components (Environment management, Error processing, Instruction execution)
• The AST and DOT Generation sub-module.
• Input flow from Front-end → Back-end (code submission).
• Processing flow inside the Back-end (from Parser → AST → Execution/Analysis).
• Output flow from Back-end → Front-end (execution results, error logs, graphical representations).
• Annotations highlighting design principles like “Separation of Concerns” and “Modularity”.