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.
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.
To run this project, ensure you have Java installed on your machine.
-
Compile the project:
javac App.java
-
Run the application:
java App
Contributions to this project are welcome. Please adhere to the following steps for contributions:
- Fork the repository.
- Create a new branch for your feature.
- Add your contributions.
- Submit a pull request.
This project is relased under the GLU 3.0 License. Details can be fount in the 'LICENSE' file.