Giter Site home page Giter Site logo

pussy's Introduction

pussy lang

Синтаксис:

letter      = "A"|..|"Z"|"a"|..|"z"
digit       = "0"|..|"9"
ident       = letter {letter|digit}
integer     = digit {digit}
vardecl     = ident "=" integer "\n"
varlist     = vardecl {vardecl}
prccall     = ident "\n"
assigment   = ident "=" (integer | ident) "\n"
ifstatement = ident "#" (integer | ident) [ident] "\n"
statement   = prccall | assigment | ifstatement
sequence    = statement { statement}
prcdecl     = ident ":" "\n" sequence
prclist     = prcdecl {prcdecl}
program     = varlist prclist

Пример:

arg1 = 2
arg2 = 2
tmp1 = 0
res1 = 0
inc:
  res1
  tmp1
  tmp1 # arg2
  tmp1 = 0
sum:
  res1 = arg1
  tmp1 # arg2 inc
main:
  sum

Семантика:

  1. Выполнение алгоритма начинается с вызова последней процедуры (см. main)
  2. Вызов переменной по имени означает инкремент оной (см. первые два оператора в процедуре inc)
  3. tmp1 # arg2 inc - означает вызов процедуры inc если tmp1 не равно arg2
  4. Условие без указания процедуры означает рекурсивный вызов

pussy's People

Contributors

ilovb avatar

Stargazers

 avatar

Watchers

 avatar  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.