Module Computor.Ast

This file will contain all custom types for computorv1

exception Syntax_error of string

Exception raised with unknown syntaxes

exception Big_degree

Exception raised when equation has a monome with a degree > 2, this obeys the specifications of the project

exception Too_many_variables

Exception raised when equation has a two or more distinct variables, this obeys the specifications of the project

type monome = float * (string * int) option

Type for a monomes generated after receving result of parsing, the optionnal part of the type is to enlarge scope of parsable input by accepting monomes like a | ax | ax^n | a * x | a * x^n

type polynome =
| Mon of monome
| Add of polynome * polynome
| Sub of polynome * polynome

Recursive type definition for parser

type equation = polynome * polynome