Expresol
Library for executing customizable script-languages in python
Install / Use
/learn @CarsonScott/ExpresolREADME
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
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
108.0kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
347.2kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
