Home » Perso. » Nodable is node-able !

Nodable is node-able !

This software is a node-able bidirectionnal expression editor.

More precisely, it means Text-to-Node and Node-to-Text seamless edition.

It’s a proof of concept that node and code are compatible.

C++ / OpenGL / SDL2 / ImGui

Previous versions

Architecture

The software is built to be dynamically reflective. The base class Object has members called Member. They can be added, modified or removed at runtime. A Member wraps a Variant class that can handle basic data types such as Booleans (bool), Numbers (double) or Strings (std::string).

Two Members can be linked by a Wire. A Wire is an oriented edge, so it has a source and a target Value.

The Object derived class Entity is able to attach Component on it. Component is the base class for all components. For now there are ony few components :

  • View : to draw the entity on screen (derived: NodeView, WireView, ApplicationView…)
  • Operation : to perform a computation (derived: BinaryOperation, BinaryOperationAdd, …Substract, …Multiply, … Divide)
  • Container : to contain other entities.
  • DataAccess: to load/save and entity to a JSON file.

Variable class is an Entity with a single Member named « value ».

Lexer class is an Entity able to convert an expression to a graph.

Application is a class to rule them all !

Source code

If you’re interested by the code source, you can download it from github.com

The language :

Introduction:

For now the syntax used is really simple and works quite like a calculator.

Operands :

An operand could be :

  • a Boolean (ex: true, false)
  • a Number (ex: 1, 0.5, 100.456, etc.)
  • a String (ex: « Hello », « World », etc.)
  • a Symbol (ex: a, b, myVar, etc.)

Operand -> { Boolean , Number , String , Symbol }

Operators:

An operator could be only a binary operator :

  • an Addition
  • a Substraction
  • a Multiplication
  • a Division
  • an Assignment

Binary Operator -> { + , – , * , / , = }

All these binary operators supports precedence.

Expressions:

An expression could be :

  • a single Operand
  • a tuple formed by an Operand, a Binary Operator and an other Expression.

Expression -> { Operand , ( Operand , Binary Operator , Expression ) }

Unary operands are not allowed, so you can’t evaluate expressions like

Expression -> { ( Unary Operator, Expression ) } (ex: -10)

Platform compatibility :

Windows 7+ 32bits (64bits compatible)

History

Bibliography

Dependencies

Licence

Nodable is licensed under the GPL License, see LICENSE for more information.

Each submodule is licensed, browse /extern folder.

Laisser un commentaire