Code Monkey home page Code Monkey logo

gramophone's Issues

Test out Lua EBNF

Seems like a good thing to try!

http://parrot.github.io/parrot-docs0/0.4.7/html/languages/lua/doc/lua51.bnf.html

chunk ::= {stat [`;´]} [laststat[`;´]]

        block ::= chunk

        stat ::=  varlist1 `=´ explist1  |
                 functioncall  |
                 do block end  |
                 while exp do block end  |
                 repeat block until exp  |
                 if exp then block {elseif exp then block} [else block] end  |
                 for Name `=´ exp `,´ exp [`,´ exp] do block end  |
                 for namelist in explist1 do block end  |
                 function funcname funcbody  |
                 local function Name funcbody  |
                 local namelist [`=´ explist1]

        laststat ::= return [explist1]  |  break

        funcname ::= Name {`.´ Name} [`:´ Name]

        varlist1 ::= var {`,´ var}

        var ::=  Name  |  prefixexp `[´ exp `]´  |  prefixexp `.´ Name

        namelist ::= Name {`,´ Name}

        explist1 ::= {exp `,´} exp

        exp ::=  nil  |  false  |  true  |  Number  |  String  |  `...´  |
                 function  |  prefixexp  |  tableconstructor  |  exp binop exp  |  unop exp

        prefixexp ::= var  |  functioncall  |  `(´ exp `)´

        functioncall ::=  prefixexp args  |  prefixexp `:´ Name args

        args ::=  `(´ [explist1] `)´  |  tableconstructor  |  String

        function ::= function funcbody

        funcbody ::= `(´ [parlist1] `)´ block end

        parlist1 ::= namelist [`,´ `...´]  |  `...´

        tableconstructor ::= `{´ [fieldlist] `}´

        fieldlist ::= field {fieldsep field} [fieldsep]

        field ::= `[´ exp `]´ `=´ exp  |  Name `=´ exp  |  exp

        fieldsep ::= `,´  |  `;´

        binop ::= `+´  |  `-´  |  `*´  |  `/´  |  `^´  |  `%´  |  `..´  |
                 `<´  |  `<=´  |  `>´  |  `>=´  |  `==´  |  `~=´  |
                 and  |  or

        unop ::= `-´  |  not  |  `#´

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.