https://github.com/gituser12981u2/mathematicalexpressionparser
This Java application is designed to parse and evaluate mathematical expressions. It utilizes a Lexer to tokenize input, a Parser to construct an abstract syntax tree (AST), and evaluates these expressions to return results in fractional form.
https://github.com/gituser12981u2/mathematicalexpressionparser
abstract-syntax-tree ast calculator java lexer parser
Last synced: about 1 year ago
JSON representation
This Java application is designed to parse and evaluate mathematical expressions. It utilizes a Lexer to tokenize input, a Parser to construct an abstract syntax tree (AST), and evaluates these expressions to return results in fractional form.
- Host: GitHub
- URL: https://github.com/gituser12981u2/mathematicalexpressionparser
- Owner: gituser12981u2
- License: gpl-3.0
- Created: 2022-12-22T03:08:06.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-27T20:17:56.000Z (about 2 years ago)
- Last Synced: 2025-02-06T00:37:09.255Z (over 1 year ago)
- Topics: abstract-syntax-tree, ast, calculator, java, lexer, parser
- Language: Java
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Java Expression Parser
## Project Overview
This Java application is designed to parse and evaluate mathematical expressions. It utilizes a Lexer to tokenize input, a Parser to construct an abstract syntax tree (AST), and evaluates these expressions to return results in fractional form.
## Files Description
- **`App.java`**: The main entry point of the application that sets up the environment and starts the parser.
- **`ASTNode.java`**: Defines nodes for the abstract syntax tree used by the parser to represent expressions.
- **`Fraction.java`**: Handles operations and representations of fractions to maintain accuracy in calculations.
- **`Lexer.java`**: Responsible for breaking down the input into recognizable tokens.
- **`Parser.java`**: Parses tokens to construct an AST based on the defined grammar of expressions.
- **`Token.java`**: Represents a token object with a specific type and value.
- **`TokenType.java`**: Enumerates possible types of tokens that can be recognized by the lexer.
## Setup and Running
To run this project, ensure you have Java installed on your machine.
1. **Compile the project:**
```bash
javac App.java
```
2. **Run the application:**
```bash
java App
```
## Contributing
Contributions to this project are welcome. Please adhere to the following steps for contributions:
1. Fork the repository.
2. Create a new branch for your feature.
3. Add your contributions.
4. Submit a pull request.
## License
This project is relased under the GLU 3.0 License. Details can be fount in the '[LICENSE](LICENSE)' file.