Giter Club home page Giter Club logo

grammars's Introduction

Grammar

The grammar is a schema that makes it easy and visual to generate data (using compose elements) or combine arbitrary data to the grammar to create an AST and therefore validate the composition of the data and order it in a logical way.

The following section explains:

  • The composition of each part of the grammar structure
  • How to assign a grammar instance to a variable
  • How to compose an AST by combining arbitrary data with a grammar instance
  • How to save a grammar instance into the database
  • How to retrieve a grammar instance from the database
  • How to execute the token tests of a grammar instance and receive its results and coverage reports

Variable

The first letter of a variable must be a lower-case letter, then can be followed by any letter, lower-case or upper-case. A variable can contain only one (1) letter.

// valid one-letter variable:
a

// valid variable where the second letter is upper-case:
aVariable

// valid variable where the second letter is lower-case:
variable

Value

The "value" is represented by an unsigned integer and therefore must be a number between 0 and 255 (range: [0,255]). It must always be assigned to a variable in order to be used in the composition of tokens.

There is no test suites for values.

// valid assignment of the value '122' to a variable:
myVariable: 122;

Compose

The "compose" is a series of "value" and other "compose" elements exclusively. A "compose" always contains a specific series of bytes. Each element of its composition is repeated only once if there is no occurence following the element. If there is an "occurence" value, the element is repeated by this amount of time. The "occurence" is an unsigned integer.

Please note each element of a "compose" is created using a variable name, a pipe (|) and an occurence. The pipe (|) only acts as a syntaxic separator. If the element is only repeated once, the occurence one (1) and its pipe (|) is optional.

There is no test suites for "compose".

// compose the world "actually"
wordActually: letterA letterC letterT letterU letterA letterL|2 letterY|1;

// values, where each byte is a ASCII representation of a letter:
letterA: 97;
letterC: 99;
letterT: 116;
letterU: 117;
letterA: 97;
letterL: 108;
letterY: 108;

Test suites

Cardinality

Token

Everything

External Grammar

Channels

Root

grammars's People

Contributors

steve-rodrigue avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.