All Projects → CarsonScott → expresol

CarsonScott / expresol

Licence: other
Library for executing customizable script-languages in python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to expresol

gitsum
parse and summarise git repository history
Stars: ✭ 43 (+290.91%)
Mutual labels:  parse
easy-json-parse
Parse your json safely and easily.
Stars: ✭ 33 (+200%)
Mutual labels:  parse
warframe-worldstate-parser
📗 An Open parser for Warframe's Worldstate in Javascript
Stars: ✭ 50 (+354.55%)
Mutual labels:  parse
carnotzet
Modular and Re-usable Docker Environments using Maven
Stars: ✭ 44 (+300%)
Mutual labels:  environment
Splain
small parser to create more interesting language/sentences
Stars: ✭ 15 (+36.36%)
Mutual labels:  parse
eval-estree-expression
Safely evaluate JavaScript (estree) expressions, sync and async.
Stars: ✭ 22 (+100%)
Mutual labels:  parse
CROHME extractor
CROHME dataset extractor for OFFLINE-text-recognition task.
Stars: ✭ 77 (+600%)
Mutual labels:  parse
carsBase
База автомобилей с марками и моделями JSON, CSV, XLSX и MySQL
Stars: ✭ 49 (+345.45%)
Mutual labels:  parse
datascience-environment
Docker Environment for data science
Stars: ✭ 18 (+63.64%)
Mutual labels:  environment
laravel-conditional-providers
THIS PACKAGE HAS BEEN DEPRECATED — Load Laravel service providers and facades based on the current environment.
Stars: ✭ 26 (+136.36%)
Mutual labels:  environment
environment-variables
🌳 Provides an abstraction of environment variables.
Stars: ✭ 33 (+200%)
Mutual labels:  environment
ngx-env
Easily inject environment variables into your Angular applications
Stars: ✭ 73 (+563.64%)
Mutual labels:  environment
pyenvdiff-lib
Python environment comparison tool
Stars: ✭ 23 (+109.09%)
Mutual labels:  environment
Android-Shortify
An Android library used for making an Android application more faster with less amount of code. Shortify for Android provides basic functionalities of view and resource binding, view customization, JSON parsing, AJAX, various readymade dialogs and much more.
Stars: ✭ 21 (+90.91%)
Mutual labels:  parse
dotfiles
My personal app/env configs and dotfiles.
Stars: ✭ 27 (+145.45%)
Mutual labels:  environment
der-parser
BER/DER parser written in pure Rust. Fast, zero-copy, safe.
Stars: ✭ 73 (+563.64%)
Mutual labels:  parse
daedalOS
Desktop environment in the browser.
Stars: ✭ 5,073 (+46018.18%)
Mutual labels:  environment
Robotics-Warehouse
A warehouse environment for robotics simulation in Unity.
Stars: ✭ 17 (+54.55%)
Mutual labels:  environment
crafter
Benchmarking the Spectrum of Agent Capabilities
Stars: ✭ 173 (+1472.73%)
Mutual labels:  environment
parse-cloud-class
Extendable way to set up Parse Cloud classes behaviour
Stars: ✭ 40 (+263.64%)
Mutual labels:  parse

expresol

Expresol is a library for executing customizable script-languages in python. The expresol library contains two main components, the memory and the parser, which collectively work as an information system whose data is accessible via statements that manipulate stored variables when executed. Each statement is converted to an executable form containing hierarchical sets of operators and data. Each set contains a set of elements, corresponding to either variables or operators. The most common possible structure of a valid statement is as follows:

(a + b)

containing three elements, 'a', '+' and 'b', where the middle element denotes an operator and the rest denote variables.

The second possible structure is:

(~ a)

containing two elements, '~' and 'a', where The left symbol denotes an operator and the right denotes a variable.

The last possible structure is:

(a)

where 'a' denotes a variable. The identity function is assigned by default if no operator is present, meaning the output of this statement simply returns the value of 'a'.


Example

  • Import library and create memory with 10 elements

      from expresol import *
      memory = Memory(10)
    
  • Store functions, data, and syntax markers in memory

      memory.var(0, Marker('open'))
      memory.var(1, Marker('close'))
      memory.var(2, Marker('end'))
      memory.var(3, AND)
      memory.var(4, True)
      memory.var(5, True)
    
  • Assign symbols to elements that allow data to be accessed when observed in a statement

      memory.ref(0, '(', 'grammar')
      memory.ref(1, ')', 'grammar')
      memory.ref(2, ';', 'grammar')
      memory.ref(3, '&', 'operator')
      memory.ref(4, 'x1', 'data')
      memory.ref(5, 'x2', 'data')
    
  • Create parser and store data types with characters that are used to form valid symbols for instances of each type

      parser = Parser()
      parser.type('grammar', '();')
      parser.type('operator', '&|!+-*/=')
      parser.type('number', '1234567890')
      parser.type('data', 'abcdefghijklmnopqrstuvwxyz')
    
  • Store pairs of data types that reflect the valid transitions between consecutive elements in a statement

      parser.rule('operator','operator')
      parser.rule('grammar','none')
      parser.rule('none','grammar')
      parser.rule('data','number')
      parser.rule('data','data')
    
  • Define and execute statement

      statement = "(x1 & x2);"
      output = parser(statement, memory)
    

OUTPUT: True

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].