How sudokentucky/olc2_proyecto1_202100106 works
Main Components
• Frontend:
• Represents the user interface built in React/TypeScript.
• Contains components like the Code Editor, Error Table, AST Viewer, Symbol Table, Command Execution, and Console.
• Responsible for sending user input (code) to the backend and displaying results (errors, generated AST, and symbols).
• Backend:
• Developed in C# with ASP.NET Core.
• Hosts the API (with controllers such as Compile.cs) that processes user input.
• Contains the core interpretation pipeline using ANTLR: Lexical analysis, Syntax analysis, Semantic analysis, and AST generation.
• Houses the analyzer modules (Environment, SymbolTable, various Visitors, and AST generation via DOTgenerator) which are the heart of the interpreter.
• ANTLR/Grammar Files:
• Represented in the directories “client/.antlr” and “client/grammar” where the Lexer, Parser, and supporting grammar artifacts are generated.
• Play a central role in the translation pipeline.
Relationships and Data Flow
• Within the Backend, show the sequence of processing:
• The code input received by the Compile Controller.
• The invocation of the ANTLR-generated Lexers/Parsers.
• Use of the Analyzer components (including ErrorListener, Symbol Table, AST building, Visitor pattern implementations) to perform complete analysis.
• Generation of artifacts (error lists, symbol tables, AST in DOT format) which are then sent back to the frontend.
• From the Lexer/Parser modules to the AST generation component.
• From the AST to the Visitor implementations that traverse or execute the tree.
Important Architectural Patterns & Design Principles
• MVC/MVP-Like Separation: The frontend handles user interactions while the backend concentrates on business logic.
• Pipeline for Language Interpretation: Clearly segment the interpreter into stages (Lexical, Syntax, Semantic, AST Generation) and represent these as subcomponents within the backend.
• Use of Visitor Pattern: Emphasize the multiple “Visitor” classes in the Analyzer which systematically handle different elements of the language during tree traversal.
Relevant Technologies & Frameworks
• Frontend: React, TypeScript, Vite, TailwindCSS.
• Backend: C#, ASP.NET Core (including Middleware such as CORS and HTTPS redirection), ANTLR for parser generation.
• Communication is over HTTP/REST.