feazy v1.0.0-c
Description
The main goal of this project is to build a high-level language that makes front-end development more interactive and easiest. This mission consists of producing a context-free grammar on a simple way to get an effortless syntax to learn and code, and implementing the necessary concepts to make an uncomplicated language, with keeping the process of transpilation speedy.
NOTES:
- All Feazy files are saved with (.fz) extension
- Feazy is a case sensitive language
Used technologies & libraries
NodeJS, Nearley, JSON, CommanderJS, InquirerJS
How it works?
Feazy transpiler is a CLI application developed simply to use it easily. Feazy has three commands you can call:
- Create (alias: c)
- Transpile (alias: t)
- Detect (alias: d) Every command has its own functionality and options.
Create
This command is used to create new Feazy project and initialize environement. Syntax: "Feazy create" or "Feazy c" Feazy use inquirerJS to make interactive Q&A like: This files that will be initialized automatically in your project folder: This is initialized homepage: This file where you can define globale variables to use many times:
Transpile
This command is used to transpile Feazy project to HTML & CSS project. Syntax: "Feazy transpile options" or "Feazy t options" Options:
- Project location ("--in project_dir" or "-i project_dir")
- Live transpilation ("--live interval" or "-l interval") (Interval per minute)
Example: "Feazy t -i project_dir -l 5"
Detect
This command is used to detect Feazy code errors. Syntax: "Feazy detect options" or "Feazy d options" Options:
- Project location ("--in project_dir" or "-i project_dir")
Example: "Feazy d -i project_dir"
Documentation
Feazy language has their own context-free grammar combined with many production roles that define its syntax and parsing method using nested object written with JSON.
Variables
With Feazy, you havn't to declare variable with specific type and use it then! All you need to do is assign to variable directly and use it as a global one
@a = 1;
@b = 2;
@c = @b + @a;
@bg = #FFF;
$body .body{
bg-color= @bg;
};
Feazy supports probably all known variable types, such as:
- Integer
- Float
- String
- Boolean
- Character
- Color hex
Operators & mathematical expressions
For easy front-end development, avoid CSS margin and padding problems you can save your values with variables. Also, you can use operators and expressions!
@a = 1 + 1;
@b = 4 - @a;
@c = 2 / @b;
@d = @b * @c;
@e = sin(@d) + cos(@a);
@f = @e * pi;
Statements
Statements in Feazy are so easy to write and clean to read.
$body: tagname .body: classname (optional) content: attribut used to set content attr:value: operator used between the attribut and value to notice that is a CSS attribut attr=value: operator used between the attribut and value to notice that is a HTML attribut
Feazy:
$body .body{
background: #FFF;
$h1 {
content= "Hello, World!";
};
};
Transpiled to:
<body class="body">
<h1>
Hello, World!
</h1>
</body>
.body {
background: #FFF;
}
Including
Including is one of the important features that will offer distribution and easy project management. Include is used to reuse a bloc of code many times with writing it only one time. heading.fz
$h1 .h1{
content="Hello, World!";
};
$body .body{
@include("heading.fz");
};
Means:
$body .body{
$h1 {
content= "Hello, World!";
};
};
Using
Using is a feature that gives the opportunity to developer to declare all global variables in one file
@use("strings.fz");
@name= "Feazy";
@description= "Context-free language";
@ver= 0.1;
HTML and CSS native, PHP and JS integration
To make developer feel free and adapt with Feazy this feature is the best. HTML
#HTML
<p>Hello again</p>
#HTML
CSS
#CSS
.p {
color: #FFF;
}
#CSS
PHP
#PHP
echo("Hello again");
#PHP
JavaScript
#JS
alert("Hello again");
#JS
Comments
As any another language, comments are importants to remember your code or to explain it to anyone else
\\ This is a comment
Copyrights
© Feazy Produced and developed by Mouhammed Ajel & Sarah Ben Yahia as a graduation project. Framed by Mr. Riadh Hadj Mtir