Code Monkey home page Code Monkey logo

gituser12981u2 / mathematicalexpressionparser Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 26 KB

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.

License: GNU General Public License v3.0

Java 100.00%
abstract-syntax-tree ast calculator java lexer parser

mathematicalexpressionparser's Introduction

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:

    javac App.java
  2. Run the application:

    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' file.

mathematicalexpressionparser's People

Contributors

gituser12981u2 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.