Giter Club home page Giter Club logo

faustus's People

Contributors

scalarwaves avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

faustus's Issues

Grammar railroad diagram

Using some online tools like https://www.bottlecaps.de/rr/ui and https://www.bottlecaps.de/convert/ and a bit of manual fixes we can have a nice navigable railroad diagram.

Copy and paste the EBNF shown bellow on https://www.bottlecaps.de/rr/ui on the tab Edit Grammar the click on the tab View Diagram to see/download a navigable railroad diagram.

/* converted on Mon Dec 5, 2022, 14:07 (UTC+01) by bison-to-w3c v0.62 which is Copyright (c) 2011-2022 by Gunther Rademacher <[email protected]> */
// From https://raw.githubusercontent.com/tonal-glyph/faustus/master/compiler/parser/faustparser.y
program  ::= stmtlist
stmtlist ::= statement*
deflist  ::= definition*
number   ::= ( ADD | SUB )? ( INT | FLOAT )
statement
         ::= ( IMPORT LPAR uqstring RPAR | DECLARE name name? string ) ENDDEF
           | definition
           | BDOC docelem* EDOC
docelem  ::= DOCCHAR*
           | doceqn
           | docdgm
           | docntc
           | doclst
           | docmtd
doceqn   ::= BEQN expression EEQN
docdgm   ::= BDGM expression EDGM
docntc   ::= NOTICE
doclst   ::= BLST lstattrdef* ELST
lstattrdef
         ::= ( LSTDEPENDENCIES | LSTMDOCTAGS | LSTDISTRIBUTED ) LSTEQ LSTQ lstattrval LSTQ
lstattrval
         ::= LSTTRUE
           | LSTFALSE
docmtd   ::= BMETADATA name EMETADATA
definition
         ::= ( defname ( LPAR arglist RPAR )? DEF expression | error ) ENDDEF
recinition
         ::= ( recname DEF expression | error ) ENDDEF
defname  ::= ident
recname  ::= DELAY1 ident
expression
         ::= expression ( ( WITH LBRAQ deflist | LETREC LBRAQ recinition* ) RBRAQ | ( PAR | SEQ | SPLIT | MIX | REC ) expression )
           | infixexp
infixexp ::= infixexp ( ( ADD | SUB | MUL | DIV | MOD | POWOP | FDELAY | AND | OR | XOR | LSH | RSH | LT | LE | GT | GE | EQ | NE ) infixexp | DELAY1 | DOT ident | LPAR arglist RPAR | LCROC deflist RCROC )
           | primitive
primitive
         ::= INT
           | FLOAT
           | ADD INT
           | ADD FLOAT
           | SUB INT
           | SUB FLOAT
           | WIRE
           | CUT
           | MEM
           | PREFIX
           | INTCAST
           | FLOATCAST
           | ADD
           | SUB
           | MUL
           | DIV
           | MOD
           | FDELAY
           | AND
           | OR
           | XOR
           | LSH
           | RSH
           | LT
           | LE
           | GT
           | GE
           | EQ
           | NE
           | ATTACH
           | ENABLE
           | CONTROL
           | ACOS
           | ASIN
           | ATAN
           | ATAN2
           | COS
           | SIN
           | TAN
           | EXP
           | LOG
           | LOG10
           | POWOP
           | POWFUN
           | SQRT
           | ABS
           | MIN
           | MAX
           | FMOD
           | REMAINDER
           | FLOOR
           | CEIL
           | RINT
           | RDTBL
           | RWTBL
           | SELECT2
           | SELECT3
           | ident
           | SUB ident
           | LPAR expression RPAR
           | LAMBDA LPAR ident ( PAR ident )* RPAR DOT LPAR expression RPAR
           | CASE LBRAQ rule+ RBRAQ
           | ffunction
           | fconst
           | fvariable
           | COMPONENT LPAR uqstring RPAR
           | LIBRARY LPAR uqstring RPAR
           | ENVIRONMENT LBRAQ stmtlist RBRAQ
           | WAVEFORM LBRAQ number ( PAR number )* RBRAQ
           | button
           | checkbox
           | vslider
           | hslider
           | nentry
           | vgroup
           | hgroup
           | tgroup
           | vbargraph
           | hbargraph
           | soundfile
           | fpar
           | fseq
           | fsum
           | fprod
           | finputs
           | foutputs
ident    ::= IDENT
name     ::= IDENT
arglist  ::= argument ( PAR argument )*
argument ::= argument ( SEQ | SPLIT | MIX | REC ) argument
           | infixexp
string   ::= STRING
uqstring ::= STRING
fstring  ::= STRING
           | FSTRING
fpar     ::= IPAR LPAR ident PAR argument PAR expression RPAR
fseq     ::= ISEQ LPAR ident PAR argument PAR expression RPAR
fsum     ::= ISUM LPAR ident PAR argument PAR expression RPAR
fprod    ::= IPROD LPAR ident PAR argument PAR expression RPAR
finputs  ::= INPUTS LPAR expression RPAR
foutputs ::= OUTPUTS LPAR expression RPAR
ffunction
         ::= FFUNCTION LPAR signature PAR fstring PAR string RPAR
fconst   ::= FCONSTANT LPAR type name PAR fstring RPAR
fvariable
         ::= FVARIABLE LPAR type name PAR fstring RPAR
button   ::= BUTTON LPAR uqstring RPAR
checkbox ::= CHECKBOX LPAR uqstring RPAR
vslider  ::= VSLIDER LPAR uqstring PAR argument PAR argument PAR argument PAR argument RPAR
hslider  ::= HSLIDER LPAR uqstring PAR argument PAR argument PAR argument PAR argument RPAR
nentry   ::= NENTRY LPAR uqstring PAR argument PAR argument PAR argument PAR argument RPAR
vgroup   ::= VGROUP LPAR uqstring PAR expression RPAR
hgroup   ::= HGROUP LPAR uqstring PAR expression RPAR
tgroup   ::= TGROUP LPAR uqstring PAR expression RPAR
vbargraph
         ::= VBARGRAPH LPAR uqstring PAR argument PAR argument RPAR
hbargraph
         ::= HBARGRAPH LPAR uqstring PAR argument PAR argument RPAR
soundfile
         ::= SOUNDFILE LPAR uqstring PAR argument RPAR
signature
         ::= type fun ( OR fun ( OR fun )? )? LPAR typelist? RPAR
fun      ::= IDENT
typelist ::= type ( PAR type )*
rule     ::= LPAR arglist RPAR ARROW expression ENDDEF
type     ::= INTCAST
           | FLOATCAST

//
// Tokens
//

// \("[^"]+"\)\s+return\s+\(\S[^;]+\); -> \2 ::= \1

BDOC ::= "<mdoc>"
NOTICE ::= "<notice/>" //| "<notice />"
BLST ::= "<listing"
BEQN ::= "<equation>"
EEQN ::= "</equation>"
BDGM ::= "<diagram>"
EDGM ::= "</diagram>"
BMETADATA ::= "<metadata>"
EMETADATA ::= "</metadata>"
EDOC ::= "</mdoc>"

LSTTRUE ::= "true"
LSTFALSE ::= "false"
LSTDEPENDENCIES ::= "dependencies"
LSTMDOCTAGS ::= "mdoctags"
LSTDISTRIBUTED ::= "distributed"
LSTEQ ::= "="
LSTQ ::= '"'
ELST ::= "/>"


SEQ ::= ":"
PAR ::= ","
SPLIT ::= "<:"
MIX ::= "+>"
MIX ::= ":>"
REC ::= "~"

ADD ::= "+"
SUB ::= "-"
MUL ::= "*"
DIV ::= "/"
MOD ::= "%"
FDELAY ::= "@"
DELAY1 ::= "'"

AND ::= "&"
OR ::= "|"
XOR ::= "xor"

LSH ::= "<<"
RSH ::= ">>"

LT ::= "<"
LE ::= "<="
GT ::= ">"
GE ::= ">="
EQ ::= "=="
NE ::= "!="

WIRE ::= "_"
CUT ::= "!"

ENDDEF ::= ";"
DEF ::= "="
LPAR ::= "("
RPAR ::= ")"
LBRAQ ::= "{"
RBRAQ ::= "}"
LCROC ::= "["
RCROC ::= "]"

LAMBDA ::= "\\"
DOT ::= "."
WITH ::= "with"
LETREC ::= "letrec"

MEM ::= "mem"
PREFIX ::= "prefix"

INTCAST ::= "int"
FLOATCAST ::= "float"

RDTBL ::= "rdtable"
RWTBL ::= "rwtable"

SELECT2 ::= "select2"
SELECT3 ::= "select3"

FFUNCTION ::= "ffunction"
FCONSTANT ::= "fconstant"
FVARIABLE ::= "fvariable"

BUTTON ::= "button"
CHECKBOX ::= "checkbox"
VSLIDER ::= "vslider"
HSLIDER ::= "hslider"
NENTRY ::= "nentry"
VGROUP ::= "vgroup"
HGROUP ::= "hgroup"
TGROUP ::= "tgroup"
VBARGRAPH ::= "vbargraph"
HBARGRAPH ::= "hbargraph"
SOUNDFILE ::= "soundfile"

ATTACH ::= "attach"

ACOS ::= "acos"
ASIN ::= "asin"
ATAN ::= "atan"
ATAN2 ::= "atan2"

COS ::= "cos"
SIN ::= "sin"
TAN ::= "tan"

EXP ::= "exp"
LOG ::= "log"
LOG10 ::= "log10"
POWOP ::= "^"
POWFUN ::= "pow"
SQRT ::= "sqrt"

ABS ::= "abs"
MIN ::= "min"
MAX ::= "max"

FMOD ::= "fmod"
REMAINDER ::= "remainder"

FLOOR ::= "floor"
CEIL ::= "ceil"
RINT ::= "rint"

ISEQ ::= "seq"
IPAR ::= "par"
ISUM ::= "sum"
IPROD ::= "prod"

INPUTS ::= "inputs"
OUTPUTS ::= "outputs"

IMPORT ::= "import"
COMPONENT ::= "component"
LIBRARY ::= "library"
ENVIRONMENT ::= "environment"

WAVEFORM ::= "waveform"
ENABLE ::= "enable"
CONTROL ::= "control"

DECLARE ::= "declare"

CASE ::= "case"
ARROW ::= "=>"

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.