Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dudesoccer123/java-syntax-validator
This project aims to develop a custom lexer and parser in Python using PLY (Python Lex-Yacc) to validate common syntax in the Java programming language.
https://github.com/dudesoccer123/java-syntax-validator
Last synced: 19 days ago
JSON representation
This project aims to develop a custom lexer and parser in Python using PLY (Python Lex-Yacc) to validate common syntax in the Java programming language.
- Host: GitHub
- URL: https://github.com/dudesoccer123/java-syntax-validator
- Owner: dudesoccer123
- Created: 2024-03-15T10:17:38.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-15T10:24:29.000Z (10 months ago)
- Last Synced: 2024-03-15T11:39:44.216Z (10 months ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JAVA-Syntax-Validator
This project aims to develop a custom lexer and parser in Python using PLY (Python Lex-Yacc) to validate common syntax in the Java programming language.## Features
- **Custom Lexer**: Tokenizes input Java code according to defined regular expressions.
- **Custom Parser**: Parses tokenized input according to specified grammar rules to validate syntax.
- **Modular Design**: Easily extendable for adding more syntax validations.## Installation
1. Clone this repository:
```bash
git clone https://github.com/your_username/java-syntax-validator.git
```2. Install the required Python packages:
```bash
pip install ply
```
## Usage### Running the Array Declaration Syntax Validation
1. Navigate to the project directory.
2. Run the following command:```bash
python code_array.py
```3. Enter a sample array declaration statement when prompted, e.g. `int[] arr = new int[50];`.
4. The program will output whether the input statement is a valid Java array declaration or not.### Running Other Syntax Validations
1. Repeat steps 2-4 from the above section, replacing `code_array.py` with the corresponding validator script (e.g., `code_construct.py`).
---
**Note:** This project is intended for educational purposes and may not cover the full spectrum of Java syntax. Use at your discretion.