Constructed using the following tools and technologies:
This project implements the backend of an SLR (Simple LR) parser, a type of parsing algorithm used to analyze context-free grammars. The backend is built using Spring Boot and handles the parsing logic, which includes efficient grammar analysis and table generation. The parser supports various input formats and grammar rules, providing a robust and efficient solution for syntax analysis.
- LR(1) Parsing Algorithm: The code implements the LR(1) parsing algorithm, which is a popular technique for parsing context-free grammars.
- Table Generation: The code generates a set of parse tables (action and goto tables) that can be used to parse context-free grammars.
- Conflict Resolution: The code includes conflict resolution strategies to handle conflicts that arise during the parsing process.
- Error Handling: The code handles errors by returning false when an invalid action is encountered or when a reduce operation fails.
- Duplicate Item Handling: The code checks for duplicate items before adding them to the stack to prevent unnecessary processing.
- Reduce State Handling: The code updates the parse tables and stack when a reduce state is encountered, applying the production rules accordingly.
SLR_Parsing/
├── README.md
├── .mvn/
│ └── wrapper/
│ └── maven-wrapper.properties
├── mvnw
├── pom.xml
├── .gitattributes
├── mvnw.cmd
├── .gitignore
└── src/
├── test/
│ └── java/
│ └── com/
│ └── compiler/
│ └── slr_parser/
│ └── SlrParserApplicationTests.java
└── main/
├── resources/
│ └── application.properties
└── java/
└── com/
└── compiler/
└── slr_parser/
├── service/
│ └── ParserService.java
├── SlrParserApplication.java
├── controller/
│ └── ParserController.java
├── util/
│ ├── FirstFollowGenerator.java
│ ├── TableGenerator.java
│ └── ParseString.java
└── model/
├── ProductionRule.java
├── ParsingTable.java
├── Grammar.java
├── LR0Item.java
├── ParseCheckRequest.java
└── FirstFollow.java
18 directories, 21 files
Here's a detailed installation guide for the SLR Parsing project:
Welcome to the SLR Parsing project! This guide will help you set up and run the project on your local machine.
Before installing the project, ensure that you have the following software installed:
- Node.js: Install Node.js (version 14 or higher) from the official website: https://nodejs.org/en/download/
- Docker: Install Docker Community Edition (version 20 or higher) from the official website: https://www.docker.com/products/docker-desktop
- Java Development Kit (JDK): Install JDK (version 11 or higher) for building and running Java-based applications
- Maven: Install Maven (version 3 or higher) for building and managing dependencies
- Clone the repository: Clone the SLR Parsing project from GitHub using the following command:
git clone https://github.com/Eemayas/SLR_Parsing.git
- Navigate to the project directory: Navigate into the cloned project directory:
cd SLR_Parsing/
- Install dependencies: Install the required dependencies for Node.js and Maven using the following commands:
npm install
mvn clean install
- Configure environment variables: Configure any necessary environment variables, such as
JAVA_HOME
andM2_HOME
, to point to your installed JDK and Maven directories.
- Build the project: Build the SLR Parsing project using Maven:
mvn clean package
- Run the application: Run the SLR Parsing application using the following command:
java -jar target/slr-parser-<version>.jar
Replace <version>
with the actual version of your built JAR file.
Common issues that may arise during installation include:
- Node.js installation: If you encounter issues with Node.js installation, refer to the official documentation for troubleshooting: https://nodejs.org/en/download/package-manager/
- Docker setup: For Docker-related issues, visit the official documentation for troubleshooting: https://docs.docker.com/engine/install/
- Maven configuration: If Maven fails to build or install dependencies, ensure that your
settings.xml
file is correctly configured and points to the correct repository URLs. - Java runtime errors: Ensure that your JDK version meets the project's requirements (version 11 or higher).
To resolve these issues, follow the provided links for official documentation and troubleshooting guides.
That's it! You've successfully set up and installed the SLR Parsing project on your local machine.
Contributions are welcome! Here are several ways you can contribute:
- Submit Pull Requests: Review open PRs, and submit your own PRs.
- Join the Discussions: Share your insights, provide feedback, or ask questions.
- Report Issues: Submit bugs found or log feature requests for SLR_Parsing.
- Fork the Repository:
- Start by forking the project repository to your GitHub account.
- Clone the Repository:
- Clone your forked repository to your local machine using the command:
git clone https://github.com/your-username/SLR_Parsing.git
- Replace
your-username
with your GitHub username.
- Create a New Branch:
- Create a new branch for your changes using the command:
git checkout -b your-branch-name
- Make Your Changes:
- Edit, add, or delete files as needed. Ensure your changes align with the project's contribution guidelines.
- Commit Your Changes:
- Stage your changes and commit them with a descriptive message:
git add . git commit -m "Your descriptive message"
- Stage your changes and commit them with a descriptive message:
- Push Your Changes:
- Push your branch to your forked repository:
git push origin your-branch-name
- Push your branch to your forked repository:
- Create a Pull Request (PR):
- Go to the original repository on GitHub and click “Compare & pull request.” Provide a clear description of the changes and submit the PR.
Once your PR is reviewed and approved, it will be merged into the main branch.
Avatar | Contributor | GitHub Profile | No of Contributions |
---|---|---|---|
Eemayas | @Eemayas | 3 |
This project is licensed under the MIT License - see the LICENSE file for details.