contratos
v0.0.1
Published
contratos
Downloads
24
Maintainers
Readme
contratos
Programming language to create and bind packages, classes and processes.
Index
The idea
The idea of this language is that you create easily the contracts of 3 onthologies in which you should be able to wrap any software project:
package
: any type of software moduleclass
: a function that creates objectsprocess
: a function
It is too simple, but this is the idea, to keep it simple, at least firstly.
Playground
You can play freely with it at:
There, you can use suggestions to find out the syntax of the language instead of continue reading.
Installation
$ npm install -g contratos
Get started
CLI usage
Write a simple contratos
script (simple.cnt
):
package package1
class ClassOne
process process1
Then compile it from the console:
$ contratos compile simple.cnt
A simple.cnt.json
will be created representing the ast
of your script. And that is all.
API usage
Syntax examples
These examples demonstrate all the available options per each idea: package
, class
and process
.
A package
package package1
file "somefile.txt"
A process
process process1
file "x"
uses classes Class1, Class2
uses processes process1, process2
that receives parameter1, parameter2
that modifies parameter1, Class1.property
that returns output
A class
class A
file "class-a"
extends AncestorOfA
implements MutationOfA1, MutationOfA2
uses packages package1, package2, package3
uses classes Class1, Class2, Class3
uses processes process1, process2, process3
has
static property property1 set to 100
property property2 set to 200
static method method1
uses packages package1
uses classes Class1, Class2
uses processes process1, process2
that receives parameter1, parameter2
that modifies parameter1, Class1.property
that returns output
method method2
uses packages package1
uses classes Class1, Class2
uses processes process1, process2
that receives parameter1, parameter2
that modifies parameter1, Class1.property
that returns output
described as a custom description.
Issues
Please, send your issues and suggestions at the page of issues in the Github project, here.
License
This project is under WTFPL or do What The Fuck you want to Public License, so do what you want with it.