Giter Club home page Giter Club logo

expression-language's People

Contributors

marat1961 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

expression-language's Issues

Grammar railroad diagram

Looking for people using CocoR I found this project and I've done a experimental tool to convert CocoR grammars to a kind of EBNF understood by https://www.bottlecaps.de/rr/ui to generate railroad diagrams see bellow the converted and with some hand made changes of el.atg to allow view it at https://www.bottlecaps.de/rr/ui the order of the rules could be changed to a better view of the railroad diagrams. Copy and paste the EBNF bellow on https://www.bottlecaps.de/rr/ui tab Edit Grammar then switch to the tab View Diagram.

Cheers !

//eol  '+' lf  '+' tab
El ::= CompositeExpression  ( CompositeExpression  )*
CompositeExpression ::=  ( "${" Value '}'  | "#{" Value '}'  )
Value ::= Expression  ( '?' Expression ':' Expression  )?
Expression ::= SimpleExpression  ( RelOp SimpleExpression  )?
SimpleExpression ::=  ( UnaryOp  )? Term  ( AddOp Term  )*
Term ::= Factor  ( MulOp Factor  )*
Factor ::= Number  | String  | "true"  | "false"  |  ( "null"  | "nil"  )  |  ( '!'  | "not"  ) Factor  | '(' Expression ')'  | Designator  ( Parameters  )?
Designator ::=  ( '.' Identifier  | '[' Expression ']'  )*
Parameters ::= '('  ( Expression  ( ',' Expression  )*  )? ')'
Number ::= Int  | HexInt  | Float
AddOp ::= '+'  | '-'  |  ( "or"  | "||"  )
UnaryOp ::= '-'  | "empty"
MulOp ::=  ( "and"  | "&&"  )  | '*'  | '/'  | "div"  |  ( '%'  | "mod"  )
RelOp ::=  ( '>'  | "gt"  )  |  ( '<'  | "lt"  )  |  ( ">="  | "ge"  )  |  ( "<="  | "le"  )  |  ( '='  | "=="  | "eq"  )  |  ( "!="  | "<>"  | "ne"  )

eol ::= '\r'
lf ::= '\n'
tab ::= '\t'
char ::= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
letter ::= "_"  '+' char
digit ::= "0123456789"
hexDigit ::= digit  '+' "ABCDEF"  '+' "abcdef"
noQuote ::= ANY  '-' "'"  '-' eol
noApos ::= ANY  '-' '"'  '-' eol
noBrackets ::= ANY  '-' "${"  '-' "#{"
apos ::= '"'
quote ::= "'"
Identifier  ::= letter  ( letter  | digit  )*
Int  ::= digit  ( digit  )*
HexInt  ::= '0'  ( 'x'  | 'X'  ) hexDigit  ( hexDigit  )*
Float  ::= digit  ( digit  )* '.'  ( digit  )*  (  ( 'E'  | 'e'  )  ( '+'  | '-'  )? digit  ( digit  )*  )?
String  ::=  ( '"'  ( '\' '0'  ( 'x'  | 'X'  ) hexDigit  ( hexDigit  )?  | '\'  ( 't'  | 'b'  | 'n'  | 'r'  | 'f'  | "'"  | '"'  | '\'  )  | noApos  ) '"'  )  |  ( "'"  ( '\' '0'  ( 'x'  | 'X'  ) hexDigit  ( hexDigit  )?  | "'"  ( 't'  | 'b'  | 'n'  | 'r'  | 'f'  | "'"  | '"'  | '\'  )  | noQuote  ) "'"  )

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.