Git Product home page Git Product logo

mexpeditor's Introduction

Math Expression Editor

Simple example of Xtext project.

The project implements a simple editor for mathematical expressions. The editor allows defining:

  • constants
  • variables
  • expressions

Constants

Constants are introduced by the keyword Const, followed by an identifier that allows using constant in expressions and a numerical value. Examples of constants are:

  • Const c1 : 10;
  • Const c2 : 3;

Variables

The definition of a variable has the same syntax of the definition of constants, but it is prefixed by keyword Var. Examples of variables are:

  • Var x : 7;
  • Var y : 12;

Expressions

Expressions allow combining constants, variables, and numerical values with mathematical operators + and -. The definition of and expression follows the same syntax used for constants and variables, but it is prefixed by keyword Exp. Examples of expressions are:

  • Exp e1 : x + c1;
  • Exp e2 : 7 - c2 + y;

Expression definition also support the use of parentheses

  • Exp e3 : (x + c1 ) - (7 - c2 + y);

Syntactic checkers

The editor implements some basic syntactic checkers:

  • Constant and variable identifiers cannot be duplicated. For instance, the following is not permitted

Const c1 : 10;

Var c1 : 7;

  • Constant and variable identifiers used in a expression must be defined. For instance, the following is not permitted

Var x : 7;

Exp e : x + y ;

Requirements

The project has been developed with Eclipse version 2022-06 (4.24.0) and Xtext version 2.27.0.

mexpeditor's People

Contributors

deid00 avatar anhtuduong 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.